mirror of
https://github.com/golang/go
synced 2024-11-18 18:04:46 -07:00
2ef0387721
When completing members on a type checked, unimported package, you get fully typed members. That means you get deep completions. Because we downrank the initial unimported package members so much, any deep completions were dominating the rankings. For example context.Back<> yielded "context.Background().Err" ranked above "context.Background". Fix by scoring context.Background in this example as stdScore+tinyRelevanceScore instead of just tinyRelevanceScore. I also changed untyped candidate scores in the same way so they stay competitive when you have both imported and unimported candidates. The other option was to propagate the score penalty into deep candidates, but that wasn't easy. In general I think you are better off avoiding big score penalties because they complicate the interplay between different kinds of candidates. Scoring needs an overhaul, but at least we are building up our test suite in the meantime. Change-Id: Ia5d32c057b04174229686cec6ac0542c30e186e2 Reviewed-on: https://go-review.googlesource.com/c/tools/+/218378 Run-TryBot: Muir Manders <muir@mnd.rs> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> |
||
---|---|---|
.. | ||
comment_test.go | ||
comment.go | ||
completion_builtin.go | ||
completion_format.go | ||
completion_keywords.go | ||
completion_labels.go | ||
completion_literal.go | ||
completion_snippet.go | ||
completion.go | ||
deep_completion.go | ||
diagnostics.go | ||
errors.go | ||
folding_range.go | ||
format_test.go | ||
format.go | ||
highlight.go | ||
hover.go | ||
identifier.go | ||
implementation.go | ||
options.go | ||
references.go | ||
rename_check.go | ||
rename.go | ||
signature_help.go | ||
source_test.go | ||
symbols.go | ||
util.go | ||
view.go | ||
workspace_symbol.go |