From 9f55489e979c08ba1c629c47a5073b62af0415a7 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 27 Apr 2026 16:55:17 -0700 Subject: [PATCH 1/4] Release notes for version 2.140.x Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CHANGELOG.md | 152 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06234dd53..a53398c68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,158 @@ - Diagnostics related feature requests and improvements [#5951](https://github.com/dotnet/vscode-csharp/issues/5951) - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) +# 2.140.x + +This update brings new language features like Type Hierarchy and Call Hierarchy, major file-based apps improvements, significant performance gains, extensive Razor formatting and editing enhancements, Blazor WebAssembly debugging, and MAUI tooling improvements. + +## C# Language Support + +### Type Hierarchy and Call Hierarchy + +Two powerful navigation features are now available for C# in VS Code: + +- **Type Hierarchy** lets you explore the full inheritance chain of any class, interface, or struct — navigate through base types and derived types without leaving the editor. ([vscode-csharp#9188](https://github.com/dotnet/vscode-csharp/pull/9188)) +- **Call Hierarchy** lets you trace incoming and outgoing calls for any method, making it easy to understand how your code connects. Interface implementation categories for overrides are correctly shown, so you get an accurate picture of the full call chain. ([vscode-csharp#9096](https://github.com/dotnet/vscode-csharp/pull/9096), [vscode-csharp#9188](https://github.com/dotnet/vscode-csharp/pull/9188)) + +### File-based apps: automatic discovery and improved editing + +File-based C# apps (standalone `.cs` files that run without a project file) now have a significantly improved experience. A new `dotnet.fileBasedApps.enableAutomaticDiscovery` setting enables the language server to automatically detect standalone C# files and provide full language support — completions, diagnostics, and navigation — without requiring a `.csproj`. + +Beyond discovery, the editing experience for file-based apps has been refined: + +- **Transitive `#:` directives** are now handled correctly, so transitive dependencies resolve properly. +- **`#:` directives are preserved during formatting**, preventing the formatter from mangling file-based app metadata. +- **Completions for `#:include` directives** help you discover available directives as you type. +- **Improved colorization** of file-based app directives makes them visually distinct from regular C# code. + +([vscode-csharp#9096](https://github.com/dotnet/vscode-csharp/pull/9096)) + +### Import completion commit behavior + +A new option controls the commit behavior when accepting import completions. This gives you more flexibility over how auto-imports are inserted — for example, whether accepting a completion should also add the import or just insert the symbol name. ([vscode-csharp#9188](https://github.com/dotnet/vscode-csharp/pull/9188)) + +### Bug fixes + +- **Property pattern completion** no longer filters out the member you are currently editing. ([vscode-csharp#9096](https://github.com/dotnet/vscode-csharp/pull/9096)) +- **`#!` shebang directives** now correctly report an error when they appear anywhere other than the very start of a file, instead of showing a misleading message. ([vscode-csharp#9188](https://github.com/dotnet/vscode-csharp/pull/9188)) +- **Rename in source-generated documents** no longer fails when some edits can't be mapped back to the original source. ([vscode-csharp#9188](https://github.com/dotnet/vscode-csharp/pull/9188)) +- **IDE0059** ("unnecessary assignment") no longer incorrectly flags writes to by-ref parameters or ref locals as redundant. ([vscode-csharp#9068](https://github.com/dotnet/vscode-csharp/pull/9068)) +- **Signature help** no longer crashes when invoked through an extension property. ([vscode-csharp#9034](https://github.com/dotnet/vscode-csharp/pull/9034)) +- **Split-if refactoring** no longer throws an exception for top-level statements. ([vscode-csharp#9096](https://github.com/dotnet/vscode-csharp/pull/9096)) +- **Non-standard URIs** no longer crash the language server — the server now gracefully handles URIs that `System.Uri` cannot parse. ([vscode-csharp#9096](https://github.com/dotnet/vscode-csharp/pull/9096), [vscode-csharp#9155](https://github.com/dotnet/vscode-csharp/pull/9155)) +- **Collection expression formatting** now correctly indents `with`-elements that span multiple lines. ([vscode-csharp#9096](https://github.com/dotnet/vscode-csharp/pull/9096)) +- **Top-level code formatting** no longer incorrectly treats plain blocks as member declaration blocks. ([vscode-csharp#9096](https://github.com/dotnet/vscode-csharp/pull/9096)) + +## Performance + +### Faster solution loading with parallel analyzer initialization + +Solution-level analyzers now load in parallel during project initialization. In solutions with many analyzers (which is common when using .NET Analyzers, StyleCop, or other code analysis packages), this can meaningfully reduce the time between opening a solution and seeing your first diagnostics. ([vscode-csharp#9034](https://github.com/dotnet/vscode-csharp/pull/9034)) + +### Reduced memory allocations across the language server + +A broad sweep of allocation reductions has been made across many hot paths in the language server: + +- **Syntax trivia handling** — modified search and walk methods now check green nodes first, avoiding unnecessary allocations. ([vscode-csharp#9096](https://github.com/dotnet/vscode-csharp/pull/9096)) +- **Text diffing and source text operations** — internal text line data structures now pack data more efficiently, reducing per-line overhead. ([vscode-csharp#9155](https://github.com/dotnet/vscode-csharp/pull/9155), [vscode-csharp#9057](https://github.com/dotnet/vscode-csharp/pull/9057)) +- **Navigate To indexing** — elfie search index operations and metadata name escaping now allocate less. ([vscode-csharp#9068](https://github.com/dotnet/vscode-csharp/pull/9068)) +- **Completion** — repeated `int.ToString` calls during completion item generation are now avoided. ([vscode-csharp#9093](https://github.com/dotnet/vscode-csharp/pull/9093)) +- **Document analysis and code fix service** — result creation and predicate evaluation now reuse objects instead of allocating. ([vscode-csharp#9068](https://github.com/dotnet/vscode-csharp/pull/9068), [vscode-csharp#9034](https://github.com/dotnet/vscode-csharp/pull/9034)) + +These improvements contribute to lower GC pressure and smoother editing, especially in large codebases. + +### Smarter Navigate To filtering + +Navigate To now avoids scanning documents unnecessarily, making workspace-wide symbol search faster. This is especially noticeable in large solutions where many projects can be skipped entirely. ([vscode-csharp#9034](https://github.com/dotnet/vscode-csharp/pull/9034)) + +## Razor + +### Unused directives: fade, remove, and sort + +Unused `@using` directives in Razor files now appear **faded**, just like unused `using` statements in C# files. A new **"Remove unnecessary usings"** code action lets you clean them up in one click. + +Additionally, two new commands are available for Razor files: + +- **Remove and Sort Usings** — removes unused directives and sorts the remainder. +- **Sort and Consolidate Usings** — sorts and consolidates `@using` directives without removing any. + +These features bring Razor's `@using` management in line with the C# editing experience. ([vscode-csharp#9040](https://github.com/dotnet/vscode-csharp/pull/9040)) + +### Generate Method code action + +The **Generate Method** code action now works in Razor files. When you call a method that doesn't exist yet, you can generate a stub directly from the Razor editor — no need to switch to a `.cs` file first. This also works from the C# editor for methods referenced in Razor documents. ([vscode-csharp#9162](https://github.com/dotnet/vscode-csharp/pull/9162)) + +### Rename in Razor source-generated documents + +Rename operations now work correctly in Razor source-generated documents, enabling more seamless refactoring across Razor and C# boundaries. Previously, renames could fail when the source-generated document couldn't be mapped back. ([vscode-csharp#9155](https://github.com/dotnet/vscode-csharp/pull/9155)) + +### Formatting fixes + +A large number of Razor formatting issues have been resolved in this release: + +- **Multiline `@if` statements** are now formatted correctly. ([vscode-csharp#9040](https://github.com/dotnet/vscode-csharp/pull/9040)) +- **Ternary expressions** inside Razor blocks no longer break formatting. ([vscode-csharp#9040](https://github.com/dotnet/vscode-csharp/pull/9040)) +- **Wrapped CSS** in Razor files is now indented properly. ([vscode-csharp#9040](https://github.com/dotnet/vscode-csharp/pull/9040)) +- **`
` tags** are now treated like `