Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/gopls: bad ranking for global variables in completion #39207
In this case, the completion item I wanted was defined "near" the code I was writing, and it had a matching type. It seems to me that a global variable of a matching type defined in my file should be ranked about completions from other packages and variables that have to be dereferenced.
I presume the string you want is an untyped constant string? I think there are two things causing this:
The scoring logic needs a retrofit. Mainly I want to consolidate scoring to a single place since it is not maintainable to have random score tweaks happening all over the place. We could add a bitmask (or boolean flags) for each candidate attribute/fact (e.g.