You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Significantly rewrite the logic involved in textDocument/hover requests,
eliminate dependence on type checking, and remove the source.Identifier
abstraction.
The existing logichad become very hard to follow, and while I spent
many hours trying to make sure I understood it, some logic seemed
inaccurate and other remained opaque. Notably, it appears much of the
old code was effectively dead, due to impossible combinations of
Node/Object in various execution paths.
Rewrite the essential bits of logic from scratch, preserving only that
which was necessary for hover (the last user of source.Identifier).
After doing this, the intermediate HoverContext and IdentifierInfo data
types became unnecessary.
Along the way, a pair of decisions impacted gopls observable behavior:
- Hovering over a rune was made consistent with other hovering (by way
of HoverJSON), which had the side effect of introducing newlines to
hover content.
- Support for hovering over variables with constant initializers was
removed (golang/go#58220). This feature will be revisited in a
follow-up CL.
This eliminates both posToMappedRange and findFileInDeps helpers, which
were two of the remaining places where we could incidentally type-check.
After this change, the only uses of TypecheckWorkspace are in renaming.
For golang/go#57987
Change-Id: I3e0d673b914f6277c3713f74450134ceeb181319
Reviewed-on: https://go-review.googlesource.com/c/tools/+/464415
Run-TryBot: Robert Findley <[email protected]>
gopls-CI: kokoro <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Alan Donovan <[email protected]>
0 commit comments