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

Blind snippet insertion #62236

Closed
safield opened this issue Oct 31, 2018 · 4 comments
Closed

Blind snippet insertion #62236

safield opened this issue Oct 31, 2018 · 4 comments
Assignees
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code snippets

Comments

@safield
Copy link

safield commented Oct 31, 2018

I have a workflow problem with snippets and completions.

I have concluded snippets and suggestions are different, and they should be treated separately. At the least, there should be a setting blindSnippetCompletion.

My issue is as follows.

  1. I know my user snippets off by heart. I use them often, and deliberately. I don't need to a list to present my snippets to me. I don't need to shop around in a grocery list of snippets (and other suggestions) to find the right one. I just type the string and hit tab.

  2. I like my snippets to work reliably 100% of the time. So when I type "msg1" followed by the tab key, I want my message write snippet to be placed 100% of the time. I don't want completion suggestions injected by language support extensions unpredictably interrupting my snippet insertion muscle memory.

  3. I don't want any snippets cluttering up my quick suggestions list. Like I mentioned previously, I already know all my snippets, and in some cases I have to cycle through a couple snippets to get to the desired suggestion. I want the suggestions list exclusively for variable, method, and type completions.....not snippets.

With the current settings available in vscode...

"editor.snippetSuggestions": "bottom" Solves issue 3. but exacerbates issue 2.
"editor.snippetSuggestions": "top" Solves issue 2. but exacerbates issue 3.
"editor.snippetSuggestions": "inline" is worst of both worlds.

Enter blindSnippetCompletion.

With this setting enabled, pressing tab (insert snippet), will always prioritise snippet insertion over quick suggestion or intellisense completion. But snippets will never show up in completion suggestions lists.

@jrieken
Copy link
Member

jrieken commented Oct 31, 2018

We can offer these settings: "editor.tabCompletion": "onlySnippets", "editor.snippetSuggestions": "none", "editor.quickSuggestions": false, With them no snippets will ever show in the suggestion list, suggestions won't show as type (the prefix of a snippet), and pressing Tab after a snippet prefix will expand it.

@jrieken jrieken added the info-needed Issue requires more information from poster label Oct 31, 2018
@safield
Copy link
Author

safield commented Oct 31, 2018

I can try those out, but "editor.tabCompletion" : "onlySnippets" sounds like it would disable word suggestions tab completion. This would not be desirable. It is just a matter of priority. To simpliify further...

  1. Snippets should take priority during tab completion.
  2. Snippets should not show up in suggestions list..

I could see how this could lead to confusing behaviour though. For example if I am unaware that my current typed string is a snippet, and then a snippet pops in unexpectedly, when I wanted to completion suggestion.

Alternative Solution...

A new command called editor.hardExecuteSnippet. This command, when run, looks at the immediately typed word at the caret , and inserts the snippet match, regardless of the state of the completion suggestion list.

This way, tab completion behaviours are left completely unmolested, but instead there is this one special command that a user could map to hard insert snippets.

@jrieken jrieken added feature-request Request for new features or functionality snippets and removed info-needed Issue requires more information from poster labels May 24, 2019
@jrieken jrieken added the *out-of-scope Posted issue is not in scope of VS Code label Oct 7, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 7, 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 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code snippets
Projects
None yet
Development

No branches or pull requests

2 participants