I'm using VSCode for coding with Flutter.
Also, I'm using generators for building Json classes automatically with json_serializable
library.
But when I'm typing _$ sign to make autocomplete
It replaces to
when I hit Enter or Tab
How to fix this?
The suggestion list of Automatic completion appears as soon as you start typing a new identifier. The suggestion list of Basic completion appears when you press the default Visual Studio IntelliSense shortcut Ctrl+Space . If necessary, you can always return to the Visual Studio's native's IntelliSense.
Place cursor in front of the word (or in middle, ex. when I want to change only last part.) Start typing until I got autocomplete I want to use. Press TAB or ENTER. On TAB - Old word is completely replaced by new word. This is especially useful when I update some names, in which beginning of word is the same, but ending is different.
Nothing left to delete, everything is replaced. On ENTER - New word is replaced from the start of old word, but right part from the cursor stays on screen. By default VSCode supports only "ENTER" use case. Does it support "TAB" use case?
Open multiple files from Quick Open. ... .vscode folder. Workspace specific files are in a .vscode folder at the root. ... You can select blocks of text by holding Shift+Alt (Shift+Option on macOS) while you drag your mouse. A separate cursor will be added to the end of each selected line.
Open the Welcome page to get started with the basics of VS Code. Help > Welcome. In the bottom right of the Welcome page, there is a link to the Interactive playground where you can interactively try out VS Code's features.
I tried to replicate the problem and I concluded this could be an issue related to the current VS Code Intellisense.
I tried calling some functions with an underscore _
or a dollar $
in the name. The Intellisense always suggest the complete function name, but when I confirm, it truncate the name at the $
sign.
I did replicate in the following way:
class Test {
Test(this.name, this.email);
String name;
String email;
String test$function() =>'test';
}
Trying to call test$function()
with autocomplete result in a test()
.
The problem does not occur in Android Studio.
It doesn't seems to be related or caused by json_serializable
.
The underscore doesn't seems to be related to the problem.
I can't provide a fix for this but I did open an issue in VS Code Github here.
EDIT:
It was actually a bug from the Dart sdk. It will be fixed in Dart v2.14
You can read here
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