qsharp-compiler icon indicating copy to clipboard operation
qsharp-compiler copied to clipboard

Code completion replaces characters that are not part of identifier name

Open tcNickolas opened this issue 4 years ago • 2 comments
trafficstars

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:

  1. 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: image

produces the following replacement: image

while the expected result would be: image

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

tcNickolas avatar Feb 11 '21 22:02 tcNickolas

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

bamarsha avatar Feb 12 '21 22:02 bamarsha

@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.

tcNickolas avatar Apr 13 '21 01:04 tcNickolas