1
0
mirror of https://github.com/golang/go synced 2024-11-18 20:54:40 -07:00
go/internal/lsp/source
Heschi Kreinick 761dbfd69d internal/span: support line directives
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>
2019-11-25 19:20:43 +00:00
..
comment_test.go internal/lsp: convert comments to markdown before sending to client 2019-10-04 18:35:38 +00:00
comment.go internal/lsp: convert comments to markdown before sending to client 2019-10-04 18:35:38 +00:00
completion_format.go internal/lsp: use AST to construct placeholders 2019-11-25 01:11:57 +00:00
completion_keywords.go internal/lsp: add some keyword completions 2019-10-22 20:49:18 +00:00
completion_labels.go internal/lsp: fix label completion in range and type switch stmts 2019-10-22 21:33:09 +00:00
completion_literal.go internal/span: support line directives 2019-11-25 19:20:43 +00:00
completion_snippet.go internal/lsp: reorganize and refactor code 2019-11-21 02:33:28 +00:00
completion.go internal/span: support line directives 2019-11-25 19:20:43 +00:00
deep_completion.go internal/lsp/source: attach Package to completions when available 2019-11-05 20:21:09 +00:00
diagnostics.go internal/lsp: use snapshot to get reverse dependencies 2019-11-22 02:13:35 +00:00
errors.go internal/lsp: move the missing imports handling into the metadata 2019-09-25 23:05:17 +00:00
folding_range.go internal/span: support line directives 2019-11-25 19:20:43 +00:00
format.go internal/lsp: use version numbers in diagnostic messages 2019-11-21 20:01:42 +00:00
highlight.go internal/lsp: use AST to construct placeholders 2019-11-25 01:11:57 +00:00
hover.go internal/lsp: add documentation for package-level vars 2019-11-25 18:28:23 +00:00
identifier.go internal/lsp: use AST to construct placeholders 2019-11-25 01:11:57 +00:00
implementation.go internal/lsp: use AST to construct placeholders 2019-11-25 01:11:57 +00:00
options.go internal/lsp: reorganize the generated Go code for the lsp protocol 2019-11-18 19:51:19 +00:00
references.go internal/lsp: only search for references in reverse dependencies 2019-11-25 14:46:06 +00:00
rename_check.go internal/lsp: improve literal func completion candidates 2019-11-07 21:18:00 +00:00
rename.go internal/lsp: use AST to construct placeholders 2019-11-25 01:11:57 +00:00
signature_help.go internal/lsp: use AST to construct placeholders 2019-11-25 01:11:57 +00:00
source_test.go internal/lsp: delete the source.Diagnostic.File field 2019-11-22 00:05:30 +00:00
suggested_fix.go internal/lsp: move error range computations into cache package 2019-10-21 22:12:58 +00:00
symbols.go internal/lsp: reorganize and refactor code 2019-11-21 02:33:28 +00:00
tidy.go internal/lsp: support running go mod tidy as a code action 2019-09-20 13:08:46 +00:00
util.go internal/span: support line directives 2019-11-25 19:20:43 +00:00
view.go internal/lsp: handle first change behavior on the server side 2019-11-22 18:53:53 +00:00