mirror of
https://github.com/golang/go
synced 2024-11-18 20:54:40 -07:00
761dbfd69d
When //line directives are in play, the ast.File's Offset function will return offsets in the generated file. We want offsets in the authored file, so we need to pass a Converter for the authored file, in addition to the ast.File for the generated file. For the same reason, we have to start (Range).Span() by translating into positions in the authored file, then calculate offsets from that. A lot of call sites outside of the LSP don't pass the Converter, but they probably don't matter much. I think everything inside does because it ends up using mappedRange. Updates golang/go#35720. Change-Id: I7be09b3a50720b078e862d48cfdb02208f8187ae Reviewed-on: https://go-review.googlesource.com/c/tools/+/208501 Run-TryBot: Heschi Kreinick <heschi@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com> Reviewed-by: Rebecca Stambler <rstambler@golang.org> |
||
---|---|---|
.. | ||
comment_test.go | ||
comment.go | ||
completion_format.go | ||
completion_keywords.go | ||
completion_labels.go | ||
completion_literal.go | ||
completion_snippet.go | ||
completion.go | ||
deep_completion.go | ||
diagnostics.go | ||
errors.go | ||
folding_range.go | ||
format.go | ||
highlight.go | ||
hover.go | ||
identifier.go | ||
implementation.go | ||
options.go | ||
references.go | ||
rename_check.go | ||
rename.go | ||
signature_help.go | ||
source_test.go | ||
suggested_fix.go | ||
symbols.go | ||
tidy.go | ||
util.go | ||
view.go |