Skip to content

Bump Roslyn to 5.0 - #1787

Merged
josefpihrt merged 14 commits into
mainfrom
feature/roslyn-5
Aug 16, 2026
Merged

Bump Roslyn to 5.0#1787
josefpihrt merged 14 commits into
mainfrom
feature/roslyn-5

Conversation

@josefpihrt

@josefpihrt josefpihrt commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Breaking release: migrate Roslynator to Roslyn 5.0.0 and retarget IDE extensions for the Roslyn 5 toolchain.

  • Bump default build, CLI, and testing to Roslyn 5.0.0
  • Add roslyn5.0 NuGet package flavor (analyzers/dotnet/roslyn5.0/cs) alongside existing roslyn3.8 and roslyn4.7
  • Replace Roslynator 2022 VSIX with Roslynator 2026 for Visual Studio 2026 ([18.0,19.0))
  • Remove bundled analyzers and RCS analyzer code fixes from Visual Studio and VS Code extensions (use Roslynator.Analyzers NuGet for diagnostics and RCS fixes)
  • IDE extensions ship refactorings and compiler diagnostic code fixes only

Breaking changes

Area Before After
Roslyn toolchain 4.14.0 (default) 5.0.0
VS extension Roslynator 2022, bundled analyzers Roslynator 2026, refactorings + CS fixes only
VS Code extension Bundled analyzers + refactorings + fixes Refactorings + CS fixes; analyzers/RCS fixes via NuGet
VS 2022 VSIX Supported Not supported — pin 4.x or use NuGet

Extension behavior

Visual Studio 2026

  • Analyzers and RCS analyzer code fixes: Roslynator.Analyzers NuGet
  • Refactorings and CS code fixes: extension

VS Code (OmniSharp required; dotnet.server.useOmnisharp: true)

  • Analyzers and RCS analyzer code fixes: NuGet
  • Refactorings + CS code fixes: extension
  • Requires C# extension with OmniSharp 1.39.15+ (Roslyn 5.x)

Technical notes

  • Roslyn 5 API fixes: GetDeclaredLocalSymbol, RegisterWorkspaceFailedHandler, null-safety updates
  • CLI net8.0: Microsoft.Build 17.11.31 minimum for Roslyn 5 Workspaces.MSBuild
  • VSSDK: Microsoft.VisualStudio.SDK 17.14 + Microsoft.VSSDK.BuildTools 18.9
  • RS1038 suppressed on analyzer projects (VB-capable assemblies; tech debt)

Test plan

  • dotnet test on Roslyn 5.0
  • CI: multi-flavor NuGet pack (roslyn3.8, roslyn4.7, roslyn5.0)
  • CI: build_vs_extension (VS 2026 VSIX)
  • CI: full workflow green on latest push
  • Manual: VS 2026 extension — refactorings light-bulb
  • Manual: VS Code + OmniSharp — refactorings light-bulb
  • Publish Roslynator 2026 marketplace listing after merge

@josefpihrt josefpihrt self-assigned this Aug 8, 2026
josefpihrt added a commit that referenced this pull request Aug 8, 2026
Update README, SECURITY, and NuGet readmes for Roslynator 2026.
Keep Visual Studio 2022 config paths for upgrade compatibility.
Remove unused analyzer code-fix refs from VS Code build project.
Ignore .vscode-test download folder from extension tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@josefpihrt
josefpihrt marked this pull request as draft August 8, 2026 18:15

@josefpihrt josefpihrt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Detailed review of the Roslyn 5.0 / Roslynator 2026 migration. The toolchain bump, roslyn5.0 pack flavor, GetDeclaredLocalSymbol helper, RegisterWorkspaceFailedHandler, and dropping bundled analyzers from both IDEs are directionally right. A few product/docs mismatches should be fixed before this leaves draft — especially analyzer “Applies to” docs and NuGet requirements still describing the old VSIX-includes-analyzers world.

Also: this branch last moved on 8 Aug and will need a rebase onto current main (extension-block / SyntaxKind.ExtensionDeclaration work in particular).

Comment thread src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs Outdated
Comment thread src/Analyzers.CodeFixes/docs/NuGetReadme.md Outdated
Comment thread src/VisualStudio/source.extension.vsixmanifest Outdated
Comment thread src/Workspaces.Core/CodeFixes/DiagnosticFixProvider.cs Outdated
Comment thread src/CSharp/CSharp/Extensions/CSharpExtensions.cs
Comment thread src/Directory.Build.props Outdated
Josef Pihrt and others added 2 commits August 16, 2026 15:10
Drop IDE bullets from analyzer Applies-to docs, keep NuGet VS 2022/2026
requirements, remove RCS code-fix MEF from the VSIX, and fix
EquivalenceKey filtering, deconstruction UseExplicitType, and
ROSLYN_5_0_ONLY on the default build.

Co-authored-by: Cursor <cursoragent@cursor.com>
@josefpihrt

Copy link
Copy Markdown
Collaborator Author

Pushed review follow-ups in f83af69:

  1. Analyzer Applies-to docs → NuGet only (no IDE extension bullets)
  2. NuGet requirements → Visual Studio 2022 or 2026
  3. VSIX no longer MEF-exports RCS/formatting code fixes (NuGet-only; matches VS Code)
  4. Null EquivalenceKey treated as non-matching for CLI filter
  5. Deconstruction UseExplicitType refactoring restored via GetTypeSymbol fallback
  6. Default build defines ROSLYN_5_0_ONLY

@josefpihrt
josefpihrt marked this pull request as ready for review August 16, 2026 13:17
Align marketplace and NuGet copy with analyzers-via-NuGet messaging, and
keep Roslynator 2022 linked where Roslynator 2026 is mentioned.

Co-authored-by: Cursor <cursoragent@cursor.com>
@josefpihrt
josefpihrt merged commit ff1befc into main Aug 16, 2026
17 checks passed
@josefpihrt
josefpihrt deleted the feature/roslyn-5 branch August 16, 2026 13:49
josefpihrt pushed a commit that referenced this pull request Aug 16, 2026
The Unreleased #1787 bullet conflicted with the testing-package floor
at 3.8.0. CLI still targets 5.0.0; this repo's suite still runs at 5.0.0.

Co-authored-by: Cursor <cursoragent@cursor.com>
josefpihrt added a commit that referenced this pull request Aug 16, 2026
…mework (#1810)

* feat(testing): let consumers choose the Roslyn version

Lower the Roslyn dependency of the testing packages to 3.8.0 so the
effective Roslyn version is determined by the consumer's own
Microsoft.CodeAnalysis.* reference instead of being forced to a fixed
version.

- Decouple Roslynator.Testing.Common from the Roslynator.Core package by
  duplicating the handful of internal helpers it used.
- Add RoslynatorTestRoslynVersion so this repo's own test suite can run
  against a chosen Roslyn version; add a CI run at 4.7.0.
- Guard version-sensitive tests so the suite builds and passes at 4.7.0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: add PR link for testing framework change in changelog

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: clarify testing-framework Roslyn version CI and 4.4 define

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: address PR 1810 review on testing Roslyn floor

Move the Testing Framework changelog entry to Breaking (including the
Core reference break), centralize ROSLYN_TEST_* defines for all test
projects, and clarify Default vs Latest parse LanguageVersion in the
NuGet readmes. Also pin RoslynatorTestRoslynVersion to 5.0.0 after the
Roslyn 5.0 merge and drop the incompatible 4.7 test matrix cell.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: remove obsolete test_roslyn_versions note from CI

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: stop saying the testing library targets Roslyn 5.0

The Unreleased #1787 bullet conflicted with the testing-package floor
at 3.8.0. CLI still targets 5.0.0; this repo's suite still runs at 5.0.0.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Josef Pihrt <josef.pihrt@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant