Entering opening brace causes code snippet suggestions to appear
See original GitHub issueDescribe the bug
When typing out a {
, instead of just auto-completing the other }
, it also pops up the dart code snippets so if you just hit enter you’ll insert the first code snippet instead of simply entering a new line to start typing inside your new set of braces.
To Reproduce
- Open any dart file.
- Enter a
{
- Hit enter
Expected behavior It should not show any snippet suggestions.
Screenshots
Versions (please complete the following information):
- VS Code version:
Version: 1.63.0-insider
Commit: 035eaab2cb31798c6ae90a35928c62117cb52fcd
Date: 2021-11-15T05:26:27.466Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin arm64 21.1.0
- Dart extension version:
3.28.0
- Dart/Flutter SDK version:
2.5.3
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Surround code block with curly braces? - visual studio
You can use the "surround with" with a custom snippet. ... Go to the snippet manager (Tools > Code Snippets Manager) ... Alt...
Read more >Braces inside snippet placeholders don't work correctly #90250
The cursor should start outside the closing brace, and backspace should delete the closing brace as well. Does this issue occur when all ......
Read more >Creating Code Snippets in C# - Customize Visual Studio for ...
Code snippets in Visual Studio can make you much more efficient. In this video, we are going to look at how easy it...
Read more >VS Code API | Visual Studio Code Extension API
VS Code API. VS Code API is a set of JavaScript APIs that you can invoke in your Visual Studio Code extension. This...
Read more >Adding PowerShell Snippets to Visual Studio Code
Hit Enter and the snippet is inserted. image. Let's add another snippet. After the closing curly brace for the Quote snippet, type a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think there’s anything Dart-Code can do here. It seems like the
triggerCharacters
set up for Dart’s completion are causing VS Code to also show user snippets. SincetriggerCharacters
don’t have any context, they always fire unconditionally and any context must be handled by the server/completion provider. In this case, that is VS Code’s snippet handler.There’s a similar issue at https://github.com/microsoft/vscode/issues/65200 and the suggestion is to set
"editor.snippetSuggestions": "none"
. I suspect"editor.suggestOnTriggerCharacters": false,
will also work, although both may disable functionality you might want.Looks like there was a VS Code change that caused this - see https://github.com/microsoft/vscode/issues/136611#issuecomment-975769359. It’s planned to be fixed in the next release.