Vscode: Proposal for customization autocomplete sort priority

Created on 9 Mar 2018  路  10Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.20.1
  • OS Version: elementary OS 0.4.1 Loki (Built on "Ubuntu 16.04.3 LTS")
  • code --disable-extensions

Autocomplete - it's very useful option of IDE. But vscode do it sometimes not good.
First of all we need to improve autocomplete sort priority by default.

const autocompleteSortPriority = [
    // example
    /* 1 */'possible reserved words' // `for`, `extends` etc, if it won't throw SyntaxError
    /* 2 */'lexical environment', // in current file
    /* 3 */'snipets',
    /* 4 */'global scope', // and auto exports
    /* 5 */'not need at all',
]

Current (wrong) behavior:

image
Wrong order, 'lexical environment' not use at all.

image
Wrong order

image
"2" - not use at all

image
extends_for_test_variable must be after eee_variable.

The could be a lot of examples to add. So, it is possible to improve autocomplete sort priority by this simple ruls?

And much better, if we could customize autocompleteSortPriority in settings of possible ruls list.

*out-of-scope feature-request intellisense-config suggest

Most helpful comment

This is mostly covered with #45039 - which we have shipped a while back

But I think the priority ordering part has not been covered, which I think is the main point here.

All 10 comments

I had a settings.json error which caused bad autocompletion (snippetSuggestions: top).

Maybe check out these settings:

"editor.snippetSuggestions": "bottom",
"editor.suggest.localityBonus": true,
"editor.suggest.filterGraceful": true,
"editor.suggest.snippetsPreventQuickSuggestions": true,

Is this suggestion still being considered? Asking since we recently got a new feature for #45039 (also see #71084) and it's kind of related...

I think this is still needed. Suggestions based on the scope are the most natural thing.

I like having text suggestions around, but they are the least interesting to me, so they should be put at the bottom of the list. There they can be ordered either alphabetically or by the localitybonus.

When get intellisense for properties of an object, they should be on top of the list.

On the other hand, in a string, string suggestions are more useful.

Local scope should definitely get priority by default IMO, in Go's case you get a bunch of import suggestions for packages you're not even using before you get a local variable

For js/ts, we improved the default sorting order with https://github.com/microsoft/TypeScript/issues/15024

@jrieken I feel @randrade23 is correct that this feature request is similar to #45039 and could be handled in core VS Code in some way. Assigning back to you for more feedback

How do I get object properties to the top of the suggestions? I'd rather get properties listed first than unrelated snippets from emmet

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

This is mostly covered with #45039 - which we have shipped a while back

This is mostly covered with #45039 - which we have shipped a while back

But I think the priority ordering part has not been covered, which I think is the main point here.

This is mostly covered with #45039 - which we have shipped a while back

But I think the priority ordering part has not been covered, which I think is the main point here.

I agree! I'm googling to try and figure out how to configure the order. Personally I want all the methods together and all the snippets together etc. and to be able to order methods before snippets etc.

Was this page helpful?
0 / 5 - 0 ratings