Skip to content

Configuration

The preferred configuration section is csls. The compatible csharp section is also accepted. When both sections define a setting, csls takes precedence. The configuration reference is generated from the server contract and records the current defaults.

{
"csls": {
"enableAnalyzers": true,
"formatOnSave": false,
"inlayHints": {
"enableInlayHintsForParameters": false,
"enableInlayHintsForTypes": false
},
"diagnostics": {
"reportInformationAsHint": true
},
"configuration": "Debug",
"logLevel": "Information"
}
}

enableAnalyzers defaults to true. Disable it to return compiler diagnostics without running analyzers referenced by the loaded project.

formatOnSave defaults to false. Set it to true when the client should request server formatting edits before saving C#, Razor, or cshtml files.

Parameter-name and inferred-type hints default to off. The same settings can be supplied as dotnet.inlayHints.enableInlayHintsForParameters and csharp.inlayHints.enableInlayHintsForTypes, matching the C# extension settings.

Informational diagnostics default to editor hints. Set dotnet.diagnostics.reportInformationAsHint or the matching csls setting to false when informational squiggles should remain visible.

configuration defaults to Debug. Changing it reloads each MSBuild workspace with the selected configuration while preserving open document text and versions.

logLevel defaults to Information and accepts the Microsoft logging levels from Trace through Critical, plus None. Changes apply to both standard error and the session log exposed to the dashboard, CLI, and MCP server.

Clients that advertise workspace.configuration are queried after initialization and whenever they send workspace/didChangeConfiguration. Other clients can push the same settings in that notification. Configuration changes reload or invalidate only the state affected by the new values before later requests run.

csls accepts multiple folders during initialization and advertises workspace folder change notifications. Added folders are loaded through the same solution, project, and loose-file discovery used at startup. Removed folders are unloaded. Unsaved documents in folders that remain loaded keep their current text and version.