dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 670 forks source link

Suggestion (or bug?): suggest class field. #4601

Open Maelep opened 3 years ago

Maelep commented 3 years ago

Issue Description

Visual Studio Code doesn't suggest class field like Visual Studio do.

Steps to Reproduce

cf. Screenshots

Expected Behavior

image

Actual Behavior

image

Logs

OmniSharp log

Post the output from Output-->OmniSharp log here

C# log

Post the output from Output-->C# here

Environment information

VSCode version: 1.56.2 C# Extension: 1.23.12

Dotnet Information .NET SDK (reflecting any global.json): Version: 5.0.202 Commit: db7cc87d51 Runtime Environment: OS Name: Windows OS Version: 10.0.19042 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.202\ Host (useful for support): Version: 5.0.5 Commit: 2f740adc14 .NET SDKs installed: 5.0.202 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |auto-using|Fudge|0.7.15| |better-comments|aaron-bond|2.1.0| |bracket-pair-colorizer-2|CoenraadS|0.2.0| |comment-anchors|ExodiusStudios|1.9.5| |csharp|ms-dotnettools|1.23.12| |vscodeintellicode|VisualStudioExptTeam|1.2.14|;
filipw commented 3 years ago

It should definitely work. Note that VS Code would not show this automatically, you need to either press ctrl+space or your should start typing (e.g. press w).

Maelep commented 3 years ago

On VS, the suggestion are instantly showed as soon as I press enter. And in VSC, typing the first letter shows sooo many things not related with my class field. CTRL + Space works in VSC but isn't fluent like juste entering.

filipw commented 3 years ago

I'll let @333fred comment if this can be improved

333fred commented 3 years ago

We could potentially make improvements here, though we'll have to be careful about not regressing behavior for any time you press enter. It will depend on what the Roslyn apis tell us for "should we show completion after this keystroke". If it doesn't work exactly like VS, we'll likely need to investigate the Roslyn side.