Skip to content

Code Action to Sync Namespace not working when C# Dev Kit is disabled #8091

@Sofistico

Description

@Sofistico

Issue Description

The code action shows for with C# Extension using Roslyn and C# Dev Kit installed and enabled but doesn't show with C# Dev kit disabled

This file structure is as follows ./src/MagiRogue/theFileInQuestion.cs

When c# dev kit is enabled this is the steps to trigger the happy path:

  1. Enable and install both C# and C# Dev Kit.
  2. Change the namespace of a c# file so that the diagnostic IDE0130 appears.
  3. Trigger the quick fix list and select the Sync Namespace code action.

Some images with examples:

C# Roslyn with C# Dev Kit
Image

C# Roslyn without C# Dev Kit
Image

C# Omnisharp without C# Dev kit
Image

Steps to Reproduce

  1. Install both C# and C# Dev Kit.
  2. Disable c# Dev Kit.
  3. Change the namespace of a c# file so that the diagnostic IDE0130 appears
  4. Trigger the quick fix list and see that the Sync Namespace code action doesn't appears.

Expected Behavior

The code action doesn't depend on anything in C# Dev kit, so should be inside the standalone C# extension

Actual Behavior

When c# dev kit is disabled, this code action doesn't show on the quick fix list

Logs

exthost.zip

C# LSP Trace Logs

[Trace - 10:16:28 PM] Sending request 'textDocument/codeAction - (185)'.
Params: {
"textDocument": {
"uri": "file:///c:/Users/joaorodrigues/source/repos/MagiRogue/src/MagiRogue/GameLoop.cs"
},
"range": {
"start": {
"line": 12,
"character": 10
},
"end": {
"line": 12,
"character": 18
}
},
"context": {
"diagnostics": [
{
"range": {
"start": {
"line": 12,
"character": 10
},
"end": {
"line": 12,
"character": 18
}
},
"message": "Namespace "MagiRogu" does not match folder structure, expected "MagiRogue"",
"code": "IDE0130",
"codeDescription": {
"href": "https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0130"
},
"severity": 4
}
],
"only": [
"quickfix"
],
"triggerKind": 1
}
}

Environment information

VSCode version: 1.98.2
C# Extension: 2.63.32
Using OmniSharp: false

Dotnet Information .NET SDK: Version: 9.0.200 Commit: 90e8b202f2 Workload version: 9.0.200-manifests.69179adf MSBuild version: 17.13.8+cbc39bea8

Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.200\

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
Version: 9.0.2
Architecture: x64
Commit: 80aa709f5d

.NET SDKs installed:
3.1.426 [C:\Program Files\dotnet\sdk]
5.0.408 [C:\Program Files\dotnet\sdk]
6.0.428 [C:\Program Files\dotnet\sdk]
7.0.410 [C:\Program Files\dotnet\sdk]
8.0.406 [C:\Program Files\dotnet\sdk]
9.0.200 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Visual Studio Code Extensions
Extension Author Version Folder Name
catppuccin-vsc Catppuccin 3.16.1 catppuccin.catppuccin-vsc-3.16.1
csharp ms-dotnettools 2.63.32 ms-dotnettools.csharp-2.63.32-win32-x64
vscode-dotnet-runtime ms-dotnettools 2.2.8 ms-dotnettools.vscode-dotnet-runtime-2.2.8

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions