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
gopls/internal/golang: SemanticTokens: edits for clarity
This CL applies a number of readability enhancements:
- eliminate unnecessary local variables
- reorder and document struct fields
- strength-reduce cache.Package to metadata.Package
- more conventional variable names. e.g.
items -> tokens
lng -> length
ti -> info
x -> id
y -> obj, ancestor
nd -> parent
def/use -> obj
- rename unexpected() to errorf(), with printf semantics
- remove unreachable cases
(e.g. info == nil; impossible types.Object subtypes)
- use is[T] to eliminate statements
- eta-reduce inspector function
- add doc comments
- add TODOs for further simplification and suspected bugs.
This is a pure refactoring; no behavior changes are intended.
Change-Id: I97a8f0b76008b0f784328f155f41bea8799f8389
Reviewed-on: https://go-review.googlesource.com/c/tools/+/561056
Reviewed-by: Robert Findley <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Alan Donovan <[email protected]>
0 commit comments