Releases: dotnet/vscode-csharp
v2.135.19-prerelease
2.135.x
- Bump lodash from 4.17.23 to 4.18.1 (PR: #9152)
- Adding changes to support use monovsdbg to debug wasm apps. (PR: #7220)
- Update Roslyn to 5.7.0-1.26213.1 (PR: #9188)
- Fix devkit hot reload (PR: #83157)
- Fix Call Hierarchy missing interface implementation category for overrides (PR: #83132)
- Skip unmappable source-generated document edits in rename (PR: #83080)
- Fix misleading error when
#!appears anywhere other than the start of the file (PR: #83112) - Fix mishandling of multiple output path changes in a single batch (PR: #83121)
- Add option for import completion commit behavior (PR: #82916)
- Fixers: Fix to add bounds checks and strip all boundary \r/\n chars (PR: #83098)
- Add LSP TypeHierarchy Support (PR: #83011)
- Update Razor to 10.0.0-preview.26208.5 (PR: #9162)
- Support Generate Method code action in Razor and C# editors (PR: #12960)
v2.134.7-prerelease
2.134.x
- Add setting
dotnet.fileBasedApps.enableAutomaticDiscovery(PR: #9096) - Update Roslyn to 5.7.0-1.26203.6 (PR: #9096)
- File-based apps automatic discovery (PR: #82863)
- Fix evaluations inside ref-returning methods (PR: #83037)
- Fix with-element indentation in collection expressions on multiple lines (PR: #83030)
- Do not crash if URI not parseable and no default handler exists (PR: #83024)
- Allow generate method to run on Razor documents (PR: #83028)
- Preserve #: file-based app directives during formatting (PR: #82996)
- Move inheritance margin logic to a features service (PR: #83001)
- Don't format plain blocks as member declaration blocks in top level code (PR: #82976)
- Add LSP CallHierarchy support (PR: #82865)
- Move CallHierarchy logic to the Features layer (PR: #82864)
- Handle misc project having an AdditionalDocument and not a Document (PR: #82956)
- Fix structure guideline anchor for initializer expressions with multi-line argument lists (PR: #82946)
- Navigate to position instead of span for Go to Implementation (PR: #82906)
- Only cache diagnostics for legacy projects (PR: #82643)
- Improve classification of file-based app directives (PR: #82627)
- Add support for skipping analyzing banned API analysis in generated files (PR: #82713)
- Add regex search support to NavigateTo (PR: #82706)
- Add completion provider for
#:includedirectives (PR: #82625) - Modify SyntaxNode trivia search/walk methods to utilize green node checks (PR: #82893)
- Fix handling of added import trivia (PR: #82788)
- DeterministicKeyBuilder: deduplicate ParseOptions across SyntaxTrees (PR: #82895)
- Fix InvalidCastException in split-if refactoring for top-level statements (PR: #82807)
v2.133.5-prerelease
2.133.x
v2.131.79-prerelease
2.131.x
- Update Roslyn to 5.6.0-2.26163.11 (PR: #9068)
- Reduce allocations in normal elfie usage (PR: #82743)
- Reduce allocations in GetEscapedMetadataName (PR: #82716)
- Cache diagnostics for method body compilation. (PR: #82667)
- Unsafe evolution: handle
new()constraint (PR: #82647) - Unsafe evolution: add LangVersion error for updated memory safety rules (PR: #82687)
- Fix/76886 await nullable value type (PR: #82146)
- ImplementSynthesizedBackingFieldSymbolBase.TryGetFirstLocation (PR: #82679)
- Fix visiting unreachable
whenclauses in NullableWalker (PR: #82563) - Reduce allocations in DocumentAnalysisExecutor ctor (PR: #82669)
- Fix IDE0059 to not flag writes to by-ref parameters or ref locals as redundant (PR: #82664)
- Use a sequence point for custom awaiters with runtime async (PR: #82605)
- Improve trivia handling in 'use as expression'. (PR: #82577)
- Update Razor to 10.0.0-preview.26155.3 (PR: #9056)
- Don't offer to remove directives when not on a single line directive (PR: #12862)
- Update Roslyn to 5.6.0-2.26159.3 (PR: #9057)
- Reduce allocations during source text diffing (PR: #82462)
- Don't log named pipe connection failures as errors in BuildServerConnection (PR: #82609)
- Ensure that lambdas are not cached in runtime async (PR: #82559)
- Ensure that a double-dispose of CPSProject doesn't throw (PR: #82557)
- Add support for nullable with runtime async (PR: #82516)
- Fix invalid
csharp_space_around_declaration_statementsoption value (PR: #80996) - Avoid eliding nested pointer-to-ref conversions (PR: #82263)
- Update Razor to 10.0.0-preview.26152.1 (PR: #9040)
- Fade unused directives, add "Remove unnecessary" code action and support Remove and Sort commands (PR: #12831)
- Add Remove and Sort Usings command handling (PR: #12834)
- Create "Sort and Consolidate Usings" code action (PR: #12824)
- Fix formatting of wrapped CSS (PR: #12823)
- Format (or don't!) pre tags like textarea tags (PR: #12813)
- Fix formatting of ternary expressions (and others?) (PR: #12808)
- Fix formatting of multiline
@ifstatements (PR: #12814)
- Update Roslyn to 5.6.0-2.26127.2 (PR: #9034)
- Fix signature help crash when invoked through extension property (PR: #82537)
- Fix ReflectionTypeLoadException in CodeStyleHostLanguageServices MEF composition (PR: #82442)
- Parallelize loading solution-level analyzers (PR: #82447)
- Reduce allocations under CodeFixService.GetShouldIncludeDiagnosticPredicate (PR: #82492)
- Extensions: fix crash with targeted attribute on extension block (PR: #82463)
- Improve navigate-to filtering to avoid scanning documents unnecessarily. (PR: #82431)
- Remove
IQueueItemabstraction and standardize CLSP queue pipeline onQueueItem(PR: #82410) - Remove error reporting out of clasp and rely on host to report errors (PR: #82435)
- Report unnecessary imports diagnostics in Razor generated files (PR: #82419)
- Update Razor to 10.0.0-preview.26121.1 (PR: #9025)
v2.130.5
2.130.x
This update brings significant improvements to reliability, diagnostics tooling, language server performance, and Razor editing.
Reliability
Improved error reporting when the language server encounters an error
The experience when the language server crashes has been significantly improved. Previously, crashes could go unnoticed (only visible in logs) or spam users with multiple meaningless notifications that had no actionable items.
Now, when the language server encounters an unrecoverable error:
- A single, consolidated notification is shown instead of 3+ duplicate error toasts.
- Error notifications include a "Report Issue" button that opens the issue reporter with logs pre-filled.
- Server crashes can trigger a restart of the extension, so you can get back to work quickly.
Under the hood, the extension now uses the built-in VS Code LSP client support for named pipe connections, delegating process lifecycle management to VS Code itself. This means better handling of process crashes, cleaner shutdown behavior, and fewer lingering processes. (vscode-csharp#8982, roslyn#82376)
Language server now shuts down when VS Code exits
The language server now accepts the extension host process ID on startup. If the parent VS Code process terminates unexpectedly, the language server will automatically shut itself down, preventing orphaned server processes from lingering in the background. (vscode-csharp#8976, roslyn#82346)
Performance
Balanced source generator execution (default)
Source generator execution now defaults to Balanced mode. In this mode, source generators only run on explicit actions like file save, build task execution, or the C#: Rerun Source Generators command. This is a significant change from the previous default (Automatic), which ran source generators on every keystroke.
Benchmarks show measurable improvements in both CPU and memory usage:
| Typing Iterations | Mode | Mean Time | Allocated Memory |
|---|---|---|---|
| 1000 | Automatic | 4,345 ms | 216 MB |
| 1000 | Balanced | 3,897 ms | 186 MB |
If you need real-time source generator updates while typing, you can switch back via the dotnet.server.sourceGeneratorExecution setting (requires restart). (vscode-csharp#8970, roslyn#82330)
Reduced memory and CPU usage in the language server
Several internal optimizations reduce allocations during analysis result creation, pattern matching operations, and file system watching:
- Improved pattern matching elimination β redundant evaluations during pattern matching are now eliminated more aggressively. (roslyn#82142)
- Reduced file system watchers β
FileSystemWatcherinstances are now limited to one per drive root, reducing overhead on large solutions. (roslyn#82211) - Lower allocations during analysis β analysis result creation now allocates less memory. (roslyn#82139)
Diagnostics Tooling
New "Capture Logs" command
A new C#: Capture Logs command lets you quickly record C# and C# LSP log activity for troubleshooting. When you run the command, it:
- Sets the log level to Trace
- Captures all log output until you cancel
- Packages the logs (including your current C# settings) into a downloadable
.zipfile
This makes it much easier to provide detailed diagnostic information when reporting issues. (vscode-csharp#8942)
Logs included when recording a server trace
The existing C#: Record Language Server Trace command now also captures log output alongside the trace data, and optionally lets you collect memory or GC dumps before and after the trace. All data is bundled into a single archive for easy sharing. (vscode-csharp#8951)
New "Collect Dump" command
A new C#: Collect Dump command allows you to collect either a Memory dump or a GC dump of the language server process on demand. The generated archive additionally includes logs and settings, making it invaluable for diagnosing performance or memory issues. (vscode-csharp#8966)
Razor logs now included in diagnostics
The Capture Logs, Collect Dump, and Record Trace commands now also collect Razor language server logs, so you get a complete picture of all language services activity in a single archive. (vscode-csharp#8988)
All settings now captured when collecting logs
Log captures now include the complete set of C# extension settings (including server-only settings defined in package.json), not just the subset used by the extension code. This ensures that when you share a diagnostics archive, the full configuration context is available. (vscode-csharp#8954)
Settings
New dotnet.server.environmentVariables setting
You can now pass custom environment variables to the language server process via the dotnet.server.environmentVariables setting. This is useful for advanced scenarios like overriding the .NET garbage collector:
{
"dotnet.server.environmentVariables": {
"DOTNET_GCName": "libclrgc.dylib",
"DOTNET_gcServer": "0"
}
}Changes to this setting prompt a window reload. (vscode-csharp#8967)
dotnet.server.crashDumpPath now triggers a restart prompt
Changing the dotnet.server.crashDumpPath setting now properly prompts you to restart the extension for the change to take effect. Previously, the setting would silently have no effect until a manual restart.
Additionally, all settings that require an extension restart now use a consistent (Requires extension restart) label in their descriptions. (vscode-csharp#8973)
C# Language Service
IntelliSense and completions
- Property and extension method items with the same name are now both shown in the completion list, instead of one hiding the other. (roslyn#82315)
thisis no longer recommended insidenameofin an attribute, reducing noise in completion suggestions. (roslyn#82299)- The
enableFileBasedProgramssetting change is now properly handled in the editor without requiring a restart. (roslyn#82214)
Bug fixes
- Fixed workspace search always returning no results for the first query after opening a solution. (roslyn#82276)
- Fixed
GetDeconstructionInforeturning incorrect results on converted deconstruction assignments. (roslyn#82324) - Fixed a crash in the "Simplify LINQ expression" code fix. (roslyn#82392)
- The "Use with-element" suggestion is no longer offered in projects targeting C# versions prior to 15. (roslyn#82389)
- Fixed an issue where
isReferenceAssemblywas incorrectly set totrueeven when the implementation assembly was found. (roslyn#82242)
Razor
Formatting fixes
- Fixed formatting when there are two markup elements on the same line inside a C# block, and prevented a crash caused by block-bodied lambdas in attributes. (razor#12786)
- Fixed indentation after complete tags that regressed due to an incorrect regex group. (razor#12784)
- Improved handling of VS Code newline behavior β the formatter now correctly handles blank line insertion between elements and newline rearrangement in long HTML tags. (razor#12773)
- Fixed indentation following a self-closing tag with a lambda attribute. (razor#12727)
Debugging
- Fixed breakpoint placement for
@codeblocks in the middle of Razor documents. Previously, breakpoints could be placed on incorrect lines when code blocks appeared after markup content. (razor#12741)
Other improvements
- The
html.autoClosingTagssetting is now properly honored in VS Code. (razor#12735)
v2.123.34-prerelease
This release also includes the unreleased changes from 2.122.x.
2.123.x
-
Improve error reporting UX when server encounters an error (PR: #8982)
-
Update Roslyn to 5.5.0-2.26117.2 (PR: #8982)
- Improve error handling when the server hits an unrecoverable error (PR: #82376)
- Remove deprecated IntelliCode starred-completion support from Roslyn Language Server (PR: #82411)
- Fix
GetDeconstructionInfoon converted deconstruction assignment (PR: #82324) - Fix crash in simplify linq expression (PR: #82392)
- Do not suggest using with-element in pre-C# 15 (PR: #82389)
-
Collect Razor logs (PR: #8988)
-
Update Razor to 10.0.0-preview.26115.1 (PR: #9007)
- Fix one formatting bug, and prevent another from crashing the formatter (PR: #12786)
- Fix indentation after complete tags (PR: #12784)
- Handle VS Code newline behaviour (PR: #12773)
- Fix indentation following self closing tag with lambda attribute (PR: #12727)
- Fix breakpoint placement for code blocks in the middle of documents (PR: #12741)
- Fix: Honor html.autoClosingTags setting in VS Code Cohosting (PR: #12735)
2.122.x
-
Use the package.json to gather all defined settings (PR: #8954)
-
Consolidate duplicate log collection sections in SUPPORT.md (PR: #8974)
-
Add crashDumpPath to settings that trigger restart prompt and standardize restart descriptions (PR: #8973)
-
Add command to collect memory and GC dumps (PR: #8966)
-
Add dotnet.server.environmentVariables setting for custom language server env vars (PR: #8967)
-
Pass the extension host process id to the Roslyn LSP on startup (PR: #8976)
-
Enable and switch to
Balancedsource generator execution (PR: #8970)Balancedmode improves language server performance by only running source generators on explicit actions like file save, build task execution, or thecsharp.rerunSourceGeneratorscommand. This is in contrast to the previous default,Automatic, which ran source generators on every keystroke.- The
dotnet.server.sourceGeneratorExecutionoption allows you to switch betweenBalancedandAutomaticsource generator execution (requires restart).
-
Update Roslyn to 5.5.0-2.26109.18 (PR: #8976)
- Adds
--clientProcessIdoption so server can shutdown when the parent does (PR: #82346) - Show both property and extension method items with identical name (PR: #82315)
- Add LSP server support for balanced source generator execution with refresh (PR: #82330)
- Handle change in enableFileBasedPrograms setting in the editor (PR: #82214)
- No longer recommend 'this' inside nameof in an attribute (PR: #82299)
- Fix workspace search always returning no results for first query (PR: #82276)
- Improve elimination of redundant evaluations during pattern matching operation (PR: #82142)
- Limit the FileSystemWatchers to one per drive root for DefaultFileChangeWatcher (PR: #82211)
- Reduce allocations during analysis result creation. (PR: #82139)
- Set isReferenceAssembly to false if we found the implementation assembly (PR: #82242)
- Remove console title change from language server Program.cs (PR: #82229)
- Adds
v2.121.32-prerelease
2.121.x
v2.120.3
2.120.x
- Update Roslyn to 5.5.0-2.26080.10 (PR: #8941)
- LSP: Tolerate non-mutating requests where we are unable to determine the language (PR: #81660)
- Update SQLitePCLRaw to 2.1.6 and remove NETSDK1206 suppressions (PR: #82156)
- Only report work done progress if the client supports it (PR: #82184)
- Convert language server project into .NET tool (PR: #82154)
- Add more details to stale project update warning (PR: #82053)
- Cleanup server capabilities providers and delete unused LSP providers (PR: #82116)
- Reduce allocations in LSP completion handling. (PR: #82133)
- Update xamlTools to 18.4.11427.62 (PR: #8929)
- Implicit XML namespaces for MAUI feature (PR: AzDO#698019)
- Fix MAUI TAP initialization issue and improve logging (PR: AzDO#702593)
v2.114.6-prerelease
2.114.x
- Adjust Select Project Context editor menu item location (PR: #8907)
- Replace vsts-npm-auth with ado-npm-auth in documentation and scripts (PR: #8906)
- Clarify vsts-npm-auth only required when adding new packages (PR: #8850)
- Update Razor to 10.0.0-preview.26075.11 (PR: #8914)
- Update Roslyn to 5.4.0-2.26076.6 (PR: #8921)
- [EnC] Use default encoding stored in the PDB for creating committed document SourceText (PR: #81912)
- Fix setting checksum algorithm when mapping projects (PR: #82051)
- Fix race in AbstractFormatEngine.GetChainedFormattingRules (PR: #82079)
- Fix crash when seeing if code can be converted to collection expressions (PR: #82104)
- feat: foreach completion (PR: #81850)
- Use document structure in breadcrumbs, sticky scroll, and outline in VSCode (PR: #81993)
- Keep comments when converting coalesce expressions (PR: #82062)
- Adds an analyzer/fixer to inform the user when the compiler silently inserts a fallible explicit cast. (PR: #82039)
- Don't offer "Use coalesce expression" when if-statement contains directives (PR: #82041)
- Fix detection of embedded c# code (PR: #82033)
- Fix issue with 'remove unnecessary suppression' and field/property initializers (PR: #81899)
- Extensions: RemovedUnusedMembers should analyze symbol usages within extension blocks too (PR: #81996)
- Don't offer 'use ??' when pointers are involved (PR: #81988)
- Add 'find references' support for collection-expression-builder methods. (PR: #81770)
- Support inference in collection expressions (PR: #77534)