dotnet / vscode-csharp

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

Not all refactoring options available until C# Dev Kit disabled #7267

Closed douglaswaugh closed 2 months ago

douglaswaugh commented 3 months ago

Type: Bug

  1. Open a C# project
  2. Install C# Dev Kit
  3. Check which refactorings are available by moving the cursor around and clicking on the lightbulb. For me, many refactorings are missing such as Extract Method and Move Type to Class
  4. Disable C# Dev Kit extension
  5. Check which refactorings are available in the same way. For me, missing refactorings returned.

Extension version: 2.34.12 VS Code version: Code 1.90.2 (5437499feb04f7a586f677b155b039bc2b3669eb, 2024-06-18T22:54:35.075Z) OS version: Darwin arm64 23.5.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M2 Pro (12 x 2400)| |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
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|1, 2, 2| |Memory (System)|32.00GB (2.99GB free)| |Process Argv|. --crash-reporter-id 33831890-34c3-482c-825f-6134ecd01b09| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 jchc7451:31067544 chatpanelc:31048052 dsvsc021:30996838 9c06g630:31013171 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 legacy_priority:31077528 ```

With the C# Dev Kit installed:

image

After disabling the C# Dev Kit:

image
dibarbet commented 3 months ago

@douglaswaugh seems like there was an issue loading the project with devkit enabled. Does the solution explorer have all of your projects (in the left pane) image

If yes, could you also attach the contents of the 'Project' output window and 'C#' output window (with dotnet.server.trace set to Trace in vscode settings)?

Thanks!

dibarbet commented 2 months ago

Closing - no info. Additionally the 2.39.28 prerelease version uploaded last week has a couple stability fixes for an issue where language features would lose the project context. Please try that version out if you're still having problems on 2.34.12.