x/tools/gopls: downrank slice as second "append()" param #40535
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Currently in the above example gopls prefers "bar" at "<>", but it's rare that you append a slice to itself. I think we should adjust scoring so that the literal candidate "foo{}" is ranked above "bar".
We could add a special case to downrank the first append param as the second append param, but I'm not sure the best way to do it. If we just check types.Object equality, we will incorrectly dowrank in the following case:
At "<>" we would downrank "b.i" in addition to "a.i". To avoid this we would need to use objectpath or AST/text equality check.
The text was updated successfully, but these errors were encountered: