Skip to content

Commit 0d17194

Browse files
adonovangopherbot
authored andcommitted
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]>
1 parent 2bd7949 commit 0d17194

File tree

1 file changed

+296
-322
lines changed

1 file changed

+296
-322
lines changed

0 commit comments

Comments
 (0)