Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for customization autocomplete sort priority #45385

Closed
artalar opened this issue Mar 9, 2018 · 15 comments
Closed

Proposal for customization autocomplete sort priority #45385

artalar opened this issue Mar 9, 2018 · 15 comments
Assignees
Labels
feature-request Request for new features or functionality intellisense-config Intellisense configuration issues *out-of-scope Posted issue is not in scope of VS Code suggest IntelliSense, Auto Complete

Comments

@artalar
Copy link

artalar commented Mar 9, 2018

  • 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.

@kieferrm kieferrm added the intellisense-config Intellisense configuration issues label Mar 9, 2018
@jrieken jrieken added typescript Typescript support issues suggest IntelliSense, Auto Complete labels Jul 27, 2018
@jrieken jrieken removed their assignment Jul 27, 2018
@mjbvz mjbvz added the feature-request Request for new features or functionality label Sep 11, 2018
@grant
Copy link

grant commented Jan 28, 2019

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,

@randrade23
Copy link

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...

@htho
Copy link

htho commented Apr 11, 2019

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.

@tj
Copy link

tj commented Apr 26, 2019

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

@mjbvz
Copy link
Contributor

mjbvz commented Aug 15, 2019

For js/ts, we improved the default sorting order with microsoft/TypeScript#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

@jrieken jrieken removed the typescript Typescript support issues label Aug 15, 2019
@simkessy
Copy link

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

@jrieken jrieken added the *out-of-scope Posted issue is not in scope of VS Code label Oct 2, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 2, 2019

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!

@vscodebot vscodebot bot closed this as completed Oct 2, 2019
@jrieken
Copy link
Member

jrieken commented Oct 2, 2019

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

@gmaggio
Copy link

gmaggio commented Mar 29, 2020

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.

@nocker01
Copy link

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.

@KrestenHelstrup
Copy link

+1. As an embedded developer I would love to prioritize methods over defines.

@bohdan-kravchuk
Copy link

As for me, it would be great to be able to customize the order of import suggestions. Don't understand why this feature hasn't implemented yet

@earsnot
Copy link

earsnot commented Apr 16, 2021

I too would love to see some way of prioritizing methods over defines.

@dustinlacewell
Copy link

@TrojanJ I opened a request here: https://github.com/microsoft/vscode/issues/122281

@smolgumball
Copy link

Sorting order based on suggestion type (locals before word-based suggestions, etc.) is still needed and not covered by the feature introduced with #45039

@microsoft microsoft locked as resolved and limited conversation to collaborators Jan 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality intellisense-config Intellisense configuration issues *out-of-scope Posted issue is not in scope of VS Code suggest IntelliSense, Auto Complete
Projects
None yet
Development

No branches or pull requests