go/internal/lsp/testdata/semantic
pjw 70fb962d80 internal/lsp/semantic: semantic tokens for imports of versions
For
import "a/bar/foo"
the existing code just decides the last component is the package name.
But for
import "a/bar/v2" this is incorrect, as the packge name is 'bar'.
The new code uses the result of parsing to derive the package name
from the import string.

That is, the package name was determined syntactically, it is
now determined semantically.

Fixes https://golang.org/issue/47784

Change-Id: Iccdd25e7e3f591e6514b1e0258e9e1879af9ff2d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/343909
Trust: Peter Weinberger <pjw@google.com>
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-08-31 17:42:36 +00:00
..
README.md internal/lsp: in semantic tokens, better distinguish between types and variables 2021-05-11 14:51:35 +00:00
a.go internal/lsp/semantic: improve semantic token processing 2021-07-14 22:42:09 +00:00
a.go.golden internal/lsp/semantic: semantic tokens for imports of versions 2021-08-31 17:42:36 +00:00
b.go internal/lsp: in semantic tokens, better distinguish between types and variables 2021-05-11 14:51:35 +00:00
b.go.golden internal/lsp: in semantic tokens, better distinguish between types and variables 2021-05-11 14:51:35 +00:00
semantic_test.go

README.md

The golden files are the output of gopls semtok <src-file>, with -- semantic -- inserted as the first line (the spaces are mandatory) and an extra newline at the end.