- Notifications
You must be signed in to change notification settings - Fork12.9k
Change snippet in class member completions#46593
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Looks good—have you tested in VS Code to make sure it works like we expect? Related:#46588 |
Yes, I tested it locally. To test this in VSCode, I had to change the code in |
Use Insiders 😉 |
I guess we can wait until after the 4.5 RC and discuss this and other alternatives in the editor meeting? |
gabritto commentedOct 29, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
It seems we won't need this anymore:#46588 |
Partiallyfixes#46568.
Whenever completions offer a method snippet, the parameter names and types, and the return type are snippet placeholders, as described in#46370. And, if the method has a body, there is a tabstop in the empty body.
We are assuming that, in most cases, the person using the method snippet won't want to change the method signature, and will instead just want to fill in the body with the implementation of the method.
For that reason, the tabstop in the body is thefirst one, so when the method snippet is inserted, the cursor is in the body, like so:
This PR adds a second tabstop, namely
$0
, right next to the first tabstop, in the body of the method.$0
is special, in that it is the last tabstop. This means that the following flow is possible:after pressing tab a few times, navigating through the method signature:
after pressing tab one last time, after going through (and possibly editing) the parameters and return type: