I'm not sure what the name of this feature is, but it is driving me nuts. I have only written a little bit of Dart in Visual Studio Code, so I don't know if this happens in other language modes.
Given the following code:
class FriendlychatApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: "Friendlychat",
home: new ChatScreen(),
);
}
}
VSCode will show:
class FriendlychatApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: "Friendlychat",
home: new ChatScreen(),
); // MaterialApp
}
}
This happens if the closing bracket is a paren ()
) or square bracket (]
).
Note that // MaterialApp
is not actually written to the file, it is only rendered on screen.
This gets noisy rather quickly, and is quite redundant as VSCode displays indent lines already.
Is there a setting to disable this?
As in, when you press "tab" key near a closing bracket, the cursor will jump over it instead of adding a new tab.
📝 Usage. Once installed, remove comments in your code by opening the command palette ( Ctrl + Shift + P ), entering "Remove all comments" and pressing enter. Voilà, all the comments are gone 🎉 !
Type “Indentation” into the search field then head to the “Editor: Tab Size” section. Replace the default space number with your preferred one: Your setting will be applied and reflected immediately. If this doesn't happen (it's a little lag sometimes), just reload or restart your VS Code.
You can disable them by adding
"dart.closingLabels": false
in your vscode settings file. Once you save the settings file it will ask you to Reload the Project.
Source: Disable vscode comments - Flutter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With