vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

A single _ (underscore/discard) gets auto-completed to something else

Open detzt opened this issue 1 year ago • 2 comments

Type: Bug

When I want to use a discard in a C# project, I type _ usually followed by a space or comma, which triggers the auto-completion. For other words this is fine, but a single underscore is not part of the autocompletion list, so it gets completed to some public class name that contains an underscore. Can you add the discard character to that autocompletion list?

Extension version: 2.45.25 VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info
Item Value
CPUs AMD Ryzen 5 5600X 6-Core Processor (12 x 3693)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.95GB (15.39GB free)
Process Argv
Screen Reader no
VM 0%

detzt avatar Oct 03 '24 01:10 detzt

+1 annoying issue, trying to set up a discard like:

_ = ReturnIntMethod();

After typing _ and pressing space it ends up in a random thing containing _. For example:

SHA3_256 = ReturnIntMethod();

ARKye03 avatar Oct 08 '24 14:10 ARKye03

Not 100% sure yet, but potentially related to https://github.com/microsoft/language-server-protocol/issues/1791 We're getting an 'invoked' trigger kind which may be causing us to hard select the item (including space as a commit char). Still investigating

dibarbet avatar Oct 09 '24 00:10 dibarbet

Thank you! It works perfectly and never got in the way since the update 👍🏼

detzt avatar Nov 29 '24 12:11 detzt