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
Code completion for zero-argument functions should position the text cursor after the completion #3873
In VS Code, type: var s = 'HELLO WORLD'.toL. Completion suggests the .toLowerCase() method.
Press Tab.
Result:
VS Code completes .toLowerCase() but positions the text cursor between the parentheses.
Expected behavior
Since the completed method is known to take zero arguments, positioning the text cursor between the parentheses seems pointless. I instead expected the text cursor to be after.toLowerCase(). After completion, I quickly typed ; and the Enter key before realizing what happened, and undoing the damage took additional effort.
I'm not sure if this is something that the Dart extension can do something about or if it's how code completion works in VS Code in general.
Versions (please complete the following information):
Activity
DanTup commentedon Mar 22, 2022
Yep, this comes from the LSP server. I've got a fix at https://dart-review.googlesource.com/c/sdk/+/238088/.
Since it's in the LSP Server, it'll show up in an SDK update rather than a VS Code extension update.
I'll close this once the change lands. Thanks!
[analysis_server] Don't include tabstops in parens for LSP completion…
DanTup commentedon Mar 23, 2022
Fixed by dart-lang/sdk@13593b9.