You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide settings to disable snippets in completion lists #2625
The issue with registering them inside extension itself by using completion provider removes ability to use Control Snippets extension which gives ability to disable/enable snippets.
My suggestions is to simply remove SnippetCompletionItemProvider class and also registration in extension.ts for flutter and dart snippets and simply add snippets in package.json as mentioned above. This gives ability to easy control snippets and it uses default VS Code mechanism.
Also, it would be cool to separate snippets for dart and flutter into their repos/extension dirs. Keep snippets/dart.json in this repo https://github.com/Dart-Code/Dart-Code and move snippets/flutter.json to this repo https://github.com/Dart-Code/Flutter since they are different tools and it gives ability to easily disable/enable snippets for Dart and Flutter separately.
I hope it makes sense, if needed I could provide a PR. Thanks a lot!
That's how things used to be - however the built-in snippets cannot be dynamically filtered, which means once you have the Flutter extension installed, you would always get Flutter snippets in your (non-Flutter) Dart projects. I did request support from VS Code to handle this (microsoft/vscode#26943) but it was rejected and were told to do it this way.
I don't think it would be a good change to go back to that unless VS code provides some way for us to filter them. Also - FWIW, that extension works by manipulating the package.json file of installed extensions - that's not really an intended extension point and could have unintended side effects, so I'm not sure it makes sense to make changes to support/encourage that.
changed the title [-]Exclude snippets from completion provider and use default VS Code mechanism[/-][+]Provide settings to disable snippets in completion lists[/+]on Jul 11, 2020
Activity
DanTup commentedon Jul 11, 2020
That's how things used to be - however the built-in snippets cannot be dynamically filtered, which means once you have the Flutter extension installed, you would always get Flutter snippets in your (non-Flutter) Dart projects. I did request support from VS Code to handle this (microsoft/vscode#26943) but it was rejected and were told to do it this way.
I don't think it would be a good change to go back to that unless VS code provides some way for us to filter them. Also - FWIW, that extension works by manipulating the package.json file of installed extensions - that's not really an intended extension point and could have unintended side effects, so I'm not sure it makes sense to make changes to support/encourage that.
svipas commentedon Jul 11, 2020
If thats not an option, maybe you could add config which enables/disables these snippets?
DanTup commentedon Jul 11, 2020
Yeah, that seems reasonable enough!
[-]Exclude snippets from completion provider and use default VS Code mechanism[/-][+]Provide settings to disable snippets in completion lists[/+]svipas commentedon Jul 12, 2020
Thanks!