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

Put snippets at the bottom of suggestions until typing #66621

Closed
johnknoop opened this issue Jan 16, 2019 · 8 comments
Closed

Put snippets at the bottom of suggestions until typing #66621

johnknoop opened this issue Jan 16, 2019 · 8 comments
Assignees
Labels
*out-of-scope Posted issue is not in scope of VS Code suggest IntelliSense, Auto Complete under-discussion Issue is under discussion for relevance, priority, approach

Comments

@johnknoop
Copy link

johnknoop commented Jan 16, 2019

Today I can choose to have snippets either at the top or at the bottom of the suggestions list. In order to have them quickly accessible, you need to have the editor.snippetSuggestions setting to top. Here is an example using the if snippet. Image if I didn't have the setting value top, then the if-snippet wouldn't be the highlighted item, resulting in a very slow workflow:

image

However, when I hit ctrl+space to see suggestions for what I am allowed to do in a given context, then it's just annoying that the snippets are shown first in the list. In this example, the suggested items with blue icons are what I'm after:

snippets

Feature request: hide the snippets from the list of suggestions unless you've started typing. Or at least add a new option to the editor.snippetSuggestions called topWhenPrefixMatches or something.

This issue addresses the problem, but proposes a different solution that I don't really agree with:
#62236

@vscodebot
Copy link

vscodebot bot commented Jan 16, 2019

@jrieken jrieken added the under-discussion Issue is under discussion for relevance, priority, approach label Jan 16, 2019
@jrieken
Copy link
Member

jrieken commented Jan 16, 2019

So, the default is to re-sort items based on how well they match as soon as you start typing. That's why the default is 'inline'. With that, the prefix if will sort the snippet if atop because it matches best, but it would not sort snippets atop or to the bottom without prefixes

@jrieken jrieken added the suggest IntelliSense, Auto Complete label Jan 16, 2019
@johnknoop
Copy link
Author

johnknoop commented Jan 22, 2019

@jrieken No, it will not put the if-snippet on top unless you've selected to always show snippets at the top. With the setting "inline", it looks like this:

image

Which is useless for situations where you're looking to execute a snippet.

That's why I've chosen the "top" option, because when I type "if", I always want the snippet, not that other thing that also matches "if". So the problem is that now I always get snippets on top, even in situations where I haven't typed anything. Get the problem?

@jrieken
Copy link
Member

jrieken commented Jan 22, 2019

Which is useless for situations where you're looking to execute a snippet.

Well, I'd say that true for all duplicated suggestions. Sometimes there are duplicates and tbh you best wait for #45039 which is about filtering certain types of suggestions, e.g. keywords, e.g. if. Saying "No snippets in suggestions unless typing selects one" is rather special and won't help in the already complicated IntelliSense world. If you want that one snippet, you can always F1>Insert Snippet, enable tab completion, or bind a keybinding to that one snippet.

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

vscodebot bot commented Jan 22, 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 Jan 22, 2019
@johnknoop
Copy link
Author

#45039 wont solve my problem at all. I'm looking for a far simpler solution:

There are two events that can trigger the suggestions list to show:

a: typing something
b: pressing ctrl+space

For scenario a, it works fine right now. For scenario b, the user is clearly not looking for a snippet, so dont show them until she has typed in a letter.

I speak for at least ten other guys at our office who use VS Code when I say that this would be a huge improvement.

@usernamehw
Copy link
Contributor

If you're desperate you can try to temporarily set config before invoking the suggest.

You'll need 2 extensions for that: one to set settings and another to run multiple commands. And when context !suggestWidgetVisible.

Macro would be:

  1. Set editor.snippetSuggestions to bottom
  2. Invoke suggest (only when !suggestWidgetVisible)
  3. Set editor.snippetSuggestions to whatever it was before

@dbsxdbsx
Copy link

dbsxdbsx commented Feb 5, 2021

Currently with version 1.53. When setting editor.snippetSuggestions to top, snippet is still showing on th bottom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*out-of-scope Posted issue is not in scope of VS Code suggest IntelliSense, Auto Complete under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

4 participants