qsharp-compiler
qsharp-compiler copied to clipboard
Code completion replaces characters that are not part of identifier name
Describe the bug
When code completion replaces the partial variable/operation name with the autocompleted one, it replaces the characters that cannot be part of the variable name, such as closing brackets, commas or semicolons.
To Reproduce
Steps to reproduce the behavior:
- Autocomplete a partially typed variable name followed by
,or).
Expected behavior
Similar to C# autocomplete behavior, it makes sense to replace only the characters that can be part of the variable/operation name, leaving the closing brackets unchanged.
Screenshots
Using autocomplete in this situation:

produces the following replacement:

while the expected result would be:

System information
This behavior is not new, it's been around for at least half a year. My current setup is:
- QDK extension 0.15.2101.126940
- Windows, .NET Core 5.0.103 (also .NET Core SDK 3.1.406 installed)
- VS 16.8.4
I think this is likely a bug with Visual Studio's LSP client, so it may need to be fixed on Visual Studio's end. @ricardo-espinoza
@samarsha @ricardo-espinoza Any updates on this issue? This behavior makes writing code somewhat frustrating, since on one hand I have to remember not to use the tempting autocomplete, but on the other hand I keep forgetting and using it and having to re-type the incorrectly replaced characters.
I found another odd autocomplete behavior that might be part of the same issue: autocompleting @Entr turns it into EntryPoint, deleting the @ symbol.