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
Autocomplete for symbols from package:charcode ends up with duplicated dollar ($) characters #3943
Describe the bug
When I attempt to autocomplete the generated symbols from package:charcode that start with a $ character, the autocompleted symbol ends up with $$.
To Reproduce
Add import 'package:charcode/charcode.dart'; to some .dart file.
Start typing $ba. The autocomplete list appears, listing $backquote, $backslash, ...
Press Tab.
$ba gets autocompleted to $$backquote.
Expected behavior $ba should have been autocompleted to $backquote.
Other notes
Strangely, if I define my own variable (e.g. var $foo = 'bar';), then that seems to autocomplete fine. I'm not sure why the symbols from package:charcode are autocompleting differently.
Versions
Operating System and version: Ubuntu 20.04.4 LTS (x64)
Strangely, if I define my own variable (e.g. var $foo = 'bar';), then that seems to autocomplete fine. I'm not sure why the symbols from package:charcode are autocompleting differently.
It looks like for "external" items, we don't provide the textEdit up-front (computing it lazily instead):
This is not valid, so I'm not sure how we ended up doing this. What's happening here is that VS Code is guessing which range to replace (since the lazy-computed one from the server is too late), and it doesn't know that $ is a valid part of identifier.
Fixing this by adding the edits to every completion item bloats the payload quite significantly, so I'm going to bump fixing this until next month, when LSP 3.17 should have been released and we can use CompletionList.itemDefaults to set the range.
Activity
DanTup commentedon Apr 27, 2022
It looks like for "external" items, we don't provide the
textEditup-front (computing it lazily instead):This is not valid, so I'm not sure how we ended up doing this. What's happening here is that VS Code is guessing which range to replace (since the lazy-computed one from the server is too late), and it doesn't know that
$is a valid part of identifier.DanTup commentedon Apr 27, 2022
Fixing this by adding the edits to every completion item bloats the payload quite significantly, so I'm going to bump fixing this until next month, when LSP 3.17 should have been released and we can use
CompletionList.itemDefaultsto set the range.[analysis_server] Always provide textEdit for LSP completions
DanTup commentedon Jun 20, 2022
Fixed by dart-lang/sdk@40e25eb.