-
Notifications
You must be signed in to change notification settings - Fork 646
Autocompletion order is a bit meh #680
Comments
The autocomplete for unimported packages that was introduced a few updates ago have 2 features
Its the first feature above that adds a lot of noise to completion items in a lot of cases (yours included). But the noise continues as in your case. The sorting of completion items is controlled by the extension, but the selected item is controlled by VS Code based on algorithms that work on just the text you type and the text in the completion item. As far as I know, the extension has no way of telling VS Code of ranking for the completion items. Long story short, do you believe the first feature above is actually useful? If not I'd suggest setting |
I understand. It's weird that VSCode doesn't allow an extension to order the matches. Surely VSCode doesn't know what the items mean, so it can't order them appropriately. This issue also affects "Go to Symbol" (@) — imports come before declarations/definitions — although that's evidently because it lists stuff in declaration order. But if start typing stuff to fuzzy match, there's pretty much no reason imports should ever come above definitions. Deserves separate issue, perhaps? |
Forgot to say: Turn off |
Regarding the "Go to Symbol", I always thought it is not of much use to even have the import statements show up in the first place. Not just for Go, but for other languages like typescript as well. I wonder if the autocompleteUnimportedPackagea setting should be set to false by default. If there is more feedback, we might just do tgat |
Yep to both. Imports in "Go to Symbol" do seem pretty useless. |
The update previous to the current update of the Go extension has For the "Go to Symbol" issue, I was thinking of adding a setting |
I recommend reversing it: |
@atombender I think we are talking about different things.
|
I was actually talking about the same thing, ignore the reference to autocompletion. Surely |
That's right, naming needs work. I initially thought of |
The setting is called "go.gotoSymbol.includeImports" and is |
Superb, thank you. |
This feature (ignoring import statements in the Go to Symbol feature) is now available in the latest update (0.6.54) to the Go extension. |
Yay! |
Here's an example where I have to type way more than I expect.
All choices are very bad; I have to type "constr" to match "constraints", when I should only need to type "c" to get it as the first hit.
In short, the autocompletion should emphasize near things (local variables/arguments, nearby functions, and so on), over farther-away things (like imports and snippets). I think character distance is as important a clue as lexical-scope distance.
I've also noticed that the autocompletion is peculiarly picky about case. Notice how "Constraint" (capitalized) is not among any of the hits. It's nice that case is used as a hint, but I really expect "Constraint" to be the second suggestion.
The text was updated successfully, but these errors were encountered: