1
0
mirror of https://github.com/golang/go synced 2024-10-01 04:18:33 -06:00
go/internal/lsp/source
Suzy Mueller 71f556f074 internal/lsp: use the explicit import spec name as ident
When there is an explicit name for an import spec, treat it as its own
identifier, separate from the import path.

Example:
	import h "hello"

The name h is defined in that import spec, not in the package hello
it contains its own references. If asked about a position within the
import path, continue treating that as referencing the imported package.
If the position is within the name, use the identifier there that is
local to that file.

This change allows for go to definition of the explicit name to point to
itself, find all references from the import spec, and rename the
explicit name from the import spec.

Change-Id: Ia1d927a26e73f2dc450d256d71909c006bdf4c37
Reviewed-on: https://go-review.googlesource.com/c/tools/+/191164
Run-TryBot: Suzy Mueller <suzmue@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-08-22 17:46:33 +00:00
..
analysis.go internal/lsp: unlabel context, log errors when canceled 2019-08-20 20:39:21 +00:00
completion_format.go internal/lsp: use protocol.Range in completion items 2019-08-20 20:57:17 +00:00
completion_snippet.go internal/lsp: provide deep completion candidates 2019-06-27 18:58:03 +00:00
completion.go internal/lsp: use protocol.Range in completion items 2019-08-20 20:57:17 +00:00
deep_completion.go internal/lsp: speed up deep completion search 2019-08-20 18:51:39 +00:00
diagnostics_test.go internal/span: change URI.Filename so it just returns the filename 2019-06-10 21:39:43 +00:00
diagnostics.go internal/lsp: abstract the diff library so it can be substituted 2019-08-20 03:37:07 +00:00
enums.go internal/lsp: switch completion item tests to using the enum strings 2019-04-17 17:57:43 +00:00
format.go internal/lsp: use protocol.Range in completion items 2019-08-20 20:57:17 +00:00
highlight.go internal/lsp: split the telemetry library out 2019-08-15 21:28:02 +00:00
hover.go internal/lsp: split the telemetry library out 2019-08-15 21:28:02 +00:00
identifier.go internal/lsp: use the explicit import spec name as ident 2019-08-22 17:46:33 +00:00
imports_test.go internal/lsp: abstract the diff library so it can be substituted 2019-08-20 03:37:07 +00:00
imports.go internal/lsp: abstract the diff library so it can be substituted 2019-08-20 03:37:07 +00:00
references.go internal/lsp: split the telemetry library out 2019-08-15 21:28:02 +00:00
rename_check.go internal/lsp: use memoize package to cache source.Packages 2019-08-13 21:41:43 +00:00
rename.go internal/lsp: return error when renaming within an import spec 2019-08-22 00:03:11 +00:00
signature_help.go internal/lsp: split the telemetry library out 2019-08-15 21:28:02 +00:00
source_test.go internal/lsp: use protocol.Range in completion items 2019-08-20 20:57:17 +00:00
suggested_fix.go internal/lsp: abstract the diff library so it can be substituted 2019-08-20 03:37:07 +00:00
symbols.go internal/lsp: split the telemetry library out 2019-08-15 21:28:02 +00:00
util.go internal/lsp: use protocol.Range in completion items 2019-08-20 20:57:17 +00:00
view.go internal/lsp: abstract the diff library so it can be substituted 2019-08-20 03:37:07 +00:00