From 25b2da09477b1092dfc8e738f497e6c2875878b0 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 6 May 2026 07:51:05 +1000 Subject: [PATCH 1/4] Remove "razorExtension" package --- package.json | 6 ------ .../extensions/builtInComponents.ts | 5 ----- .../server/roslynLanguageServer.ts | 6 +----- tasks/packaging/offlinePackagingTasks.ts | 7 ------- tasks/packaging/updateRazorVersion.ts | 21 ------------------- tasks/projectPaths.ts | 1 - tasks/tags/createTags.ts | 20 ------------------ 7 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 tasks/packaging/updateRazorVersion.ts diff --git a/package.json b/package.json index 7fb731d04a..e86efa1cb3 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,6 @@ "defaults": { "roslyn": "5.8.0-1.26252.1", "omniSharp": "1.39.14", - "razor": "10.4.0-preview.26252.1", "razorOmnisharp": "7.0.0-preview.23363.1", "xamlTools": "18.7.11727.258" }, @@ -98,7 +97,6 @@ "test:unit": "npm run compileDev && npx ts-node tasks/tests/testUnit.ts", "updateChangelog": "npx ts-node tasks/snap/updateChangelog.ts", "updatePackageDependencies": "npx ts-node tasks/debugger/updatePackageDependencies.ts", - "updateRazorVersion": "npx ts-node tasks/packaging/updateRazorVersion.ts", "updateRoslynVersion": "npx ts-node tasks/packaging/updateRoslynVersion.ts", "updateVersionForStableRelease": "npx ts-node tasks/snap/updateVersionForStableRelease.ts", "verifyVsix": "npx ts-node tasks/signing/verifyVsix.ts", @@ -1480,10 +1478,6 @@ "roslynCopilot": { "description": "%configuration.dotnet.server.componentPaths.roslynCopilot%", "type": "string" - }, - "razorExtension": { - "description": "%configuration.dotnet.server.componentPaths.razorExtension%", - "type": "string" } }, "default": {} diff --git a/src/lsptoolshost/extensions/builtInComponents.ts b/src/lsptoolshost/extensions/builtInComponents.ts index 017512a10c..29ec6508c2 100644 --- a/src/lsptoolshost/extensions/builtInComponents.ts +++ b/src/lsptoolshost/extensions/builtInComponents.ts @@ -29,11 +29,6 @@ export const componentInfo: { [key: string]: ComponentInfo } = { 'Microsoft.VisualStudio.DesignTools.CodeAnalysis.Diagnostics.dll', ], }, - razorExtension: { - defaultFolderName: '.razorExtension', - optionName: 'razorExtension', - componentDllPaths: ['Microsoft.VisualStudioCode.RazorExtension.dll'], - }, roslynCopilot: { defaultFolderName: '.roslynCopilot', optionName: 'roslynCopilot', diff --git a/src/lsptoolshost/server/roslynLanguageServer.ts b/src/lsptoolshost/server/roslynLanguageServer.ts index 6d0974e298..ab5310522e 100644 --- a/src/lsptoolshost/server/roslynLanguageServer.ts +++ b/src/lsptoolshost/server/roslynLanguageServer.ts @@ -671,11 +671,7 @@ export class RoslynLanguageServer { args.push('--sourceGeneratorExecutionPreference', sourceGeneratorExecution); } - let razorComponentPath = ''; - getComponentPaths('razorExtension', languageServerOptions, channel).forEach((extPath) => { - additionalExtensionPaths.push(extPath); - razorComponentPath = path.dirname(extPath); - }); + const razorComponentPath = path.dirname(serverPath); args.push('--razorSourceGenerator', path.join(razorComponentPath, 'Microsoft.CodeAnalysis.Razor.Compiler.dll')); diff --git a/tasks/packaging/offlinePackagingTasks.ts b/tasks/packaging/offlinePackagingTasks.ts index 8d23e692b1..b74b66964e 100644 --- a/tasks/packaging/offlinePackagingTasks.ts +++ b/tasks/packaging/offlinePackagingTasks.ts @@ -23,7 +23,6 @@ import { rootPath, devKitDependenciesDirectory, xamlToolsDirectory, - razorExtensionDirectory, } from '../projectPaths'; import { getPackageJSON } from '../packageJson'; import { createPackageAsync, generateVsixManifest } from './vsceTasks'; @@ -92,12 +91,6 @@ export const allNugetPackages: { [key: string]: NugetPackageInfo } = { getPackageContentPath: (_platformInfo) => 'content', vsixOutputPath: xamlToolsDirectory, }, - razorExtension: { - getPackageName: (_platformInfo) => 'Microsoft.VisualStudioCode.RazorExtension', - packageJsonName: 'razor', - getPackageContentPath: (_platformInfo) => 'content', - vsixOutputPath: razorExtensionDirectory, - }, }; interface PlatformEntry { diff --git a/tasks/packaging/updateRazorVersion.ts b/tasks/packaging/updateRazorVersion.ts deleted file mode 100644 index 63374461ce..0000000000 --- a/tasks/packaging/updateRazorVersion.ts +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { acquireNugetPackage, allNugetPackages, installDependencies } from './offlinePackagingTasks'; -import { getPackageJSON } from '../packageJson'; -import { runTask } from '../runTask'; - -runTask(updateRazorVersion); - -// Defines a special task to acquire all the platform specific Razor packages. -// All packages need to be saved to the consumption AzDo artifacts feed, for non-platform -// specific packages this only requires running the installDependencies tasks. However for Razor packages -// we need to acquire the nuget packages once for each platform to ensure they get saved to the feed. -async function updateRazorVersion(): Promise { - // Pull in the .razorExtension code that gets loaded in the roslyn language server - await acquireNugetPackage(allNugetPackages.razorExtension, undefined, getPackageJSON(), true); - - await installDependencies(/* clean */ true); -} diff --git a/tasks/projectPaths.ts b/tasks/projectPaths.ts index bc45ebc36c..a2362f9b02 100644 --- a/tasks/projectPaths.ts +++ b/tasks/projectPaths.ts @@ -18,7 +18,6 @@ export const nugetTempPath = path.join(rootPath, 'out', '.nuget'); export const languageServerDirectory = path.join(rootPath, '.roslyn'); export const devKitDependenciesDirectory = path.join(rootPath, componentInfo.roslynDevKit.defaultFolderName); export const xamlToolsDirectory = path.join(rootPath, componentInfo.xamlTools.defaultFolderName); -export const razorExtensionDirectory = path.join(rootPath, componentInfo.razorExtension.defaultFolderName); export const codeExtensionPath = commandLineOptions.codeExtensionPath || rootPath; diff --git a/tasks/tags/createTags.ts b/tasks/tags/createTags.ts index 8ef1f5c4d4..9a561209bd 100644 --- a/tasks/tags/createTags.ts +++ b/tasks/tags/createTags.ts @@ -24,7 +24,6 @@ interface CreateTagsOptions { async function createTags(): Promise { await createTagsRoslyn(); - await createTagsRazor(); await createTagsVSCodeCSharp(); } @@ -47,25 +46,6 @@ async function createTagsRoslyn(): Promise { ); } -async function createTagsRazor(): Promise { - const options = minimist(process.argv.slice(2)); - - return createTagsAsync( - options, - 'dotnet', - 'razor', - async (releaseCommit: string, githubPAT: string) => - getCommitFromNugetAsync(allNugetPackages.razorExtension, releaseCommit, githubPAT), - (releaseVersion: string, isPrerelease: boolean): [string, string] => { - const prereleaseText = isPrerelease ? '-prerelease' : ''; - return [ - `VSCode-CSharp-${releaseVersion}${prereleaseText}`, - `${releaseVersion} VSCode C# extension ${prereleaseText}`, - ]; - } - ); -} - async function createTagsVSCodeCSharp(): Promise { const options = minimist(process.argv.slice(2)); From 7f784f67318158dd6c237fabbd89315fa8192472 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 6 May 2026 07:56:24 +1000 Subject: [PATCH 2/4] Remove --razorSourceGenerator option. It wasn't used anyway --- src/lsptoolshost/server/roslynLanguageServer.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lsptoolshost/server/roslynLanguageServer.ts b/src/lsptoolshost/server/roslynLanguageServer.ts index ab5310522e..5df9bfb126 100644 --- a/src/lsptoolshost/server/roslynLanguageServer.ts +++ b/src/lsptoolshost/server/roslynLanguageServer.ts @@ -673,8 +673,6 @@ export class RoslynLanguageServer { const razorComponentPath = path.dirname(serverPath); - args.push('--razorSourceGenerator', path.join(razorComponentPath, 'Microsoft.CodeAnalysis.Razor.Compiler.dll')); - args.push( '--razorDesignTimePath', path.join(razorComponentPath, 'Targets', 'Microsoft.NET.Sdk.Razor.DesignTime.targets') From 0fbcea8a387f8bc5cbddfb286a8b7d209befb9f6 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 6 May 2026 07:57:54 +1000 Subject: [PATCH 3/4] Remove --razorDesignTimePath option --- src/lsptoolshost/server/roslynLanguageServer.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lsptoolshost/server/roslynLanguageServer.ts b/src/lsptoolshost/server/roslynLanguageServer.ts index 5df9bfb126..746f79399c 100644 --- a/src/lsptoolshost/server/roslynLanguageServer.ts +++ b/src/lsptoolshost/server/roslynLanguageServer.ts @@ -671,13 +671,6 @@ export class RoslynLanguageServer { args.push('--sourceGeneratorExecutionPreference', sourceGeneratorExecution); } - const razorComponentPath = path.dirname(serverPath); - - args.push( - '--razorDesignTimePath', - path.join(razorComponentPath, 'Targets', 'Microsoft.NET.Sdk.Razor.DesignTime.targets') - ); - // Get the brokered service pipe name from C# Dev Kit (if installed). if (csharpDevKitExtensionExports) { _wasActivatedWithCSharpDevkit = true; @@ -706,6 +699,7 @@ export class RoslynLanguageServer { // Razor has code in Microsoft.CSharp.DesignTime.targets to handle non-Razor-SDK projects, but that doesn't get imported outside // of DevKit so we polyfill with a mini-version that Razor provides for that scenario. + const razorComponentPath = path.dirname(serverPath); args.push( '--csharpDesignTimePath', path.join(razorComponentPath, 'Targets', 'Microsoft.CSharpExtension.DesignTime.targets') From e14fd77d95fc44613b2e19555e3ea7b7a2d25611 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 6 May 2026 09:42:23 +1000 Subject: [PATCH 4/4] Revert changes to the skill, so its back to updating roslyn only --- .github/skills/update-roslyn-version/SKILL.md | 240 ++++++------------ 1 file changed, 80 insertions(+), 160 deletions(-) diff --git a/.github/skills/update-roslyn-version/SKILL.md b/.github/skills/update-roslyn-version/SKILL.md index b6c20fabae..d39193957f 100644 --- a/.github/skills/update-roslyn-version/SKILL.md +++ b/.github/skills/update-roslyn-version/SKILL.md @@ -1,13 +1,11 @@ --- name: update-roslyn-version -description: Guide for updating the Roslyn language server version and paired Razor extension version in the vscode-csharp repository. Use this when asked to update Roslyn, bump the Roslyn version, or upgrade the language server version. +description: Guide for updating the Roslyn language server version in the vscode-csharp repository. Use this when asked to update Roslyn, bump the Roslyn version, or upgrade the language server version. --- # Update Roslyn Version -This skill describes how to update the Roslyn language server version and paired Razor extension version in the vscode-csharp repository. - -The Roslyn official build used by this workflow also produces the Razor extension package consumed by this repo, so this process updates **both** `defaults.roslyn` and `defaults.razor` in the same PR. The paired packages share the same commit range, so `pr-finder` only needs to run once; split that one result set into separate Roslyn and Razor changelog entries. +This skill describes how to update the Roslyn language server version in the vscode-csharp repository. ## Prerequisites @@ -27,14 +25,11 @@ The Roslyn official build used by this workflow also produces the Razor extensio ## Input Required -- **New Roslyn Version** (optional): The new Roslyn version to update to (for example, `5.5.0-2.26080.10`). If not provided, the version will be auto-discovered from the latest passing `dotnet-roslyn-official` pipeline build on main. See [Version Auto-Discovery](#version-auto-discovery) below. -- **New Razor Version** (optional): The paired Razor version from the same Roslyn build. If not provided, it should be auto-discovered from that same build. - -These versions should normally come from the same Roslyn build. If the user does not provide both versions, auto-discover both from the same build rather than mixing versions from different sources. +- **New Roslyn Version** (optional): The new version to update to (e.g., `5.5.0-2.26080.10`). If not provided, the version will be auto-discovered from the latest passing `dotnet-roslyn-official` pipeline build on main. See [Version Auto-Discovery](#version-auto-discovery) below. ## Version Auto-Discovery -If the user does not provide both versions, follow these steps to discover the latest versions from the official Roslyn build pipeline. +If the user does not provide a specific Roslyn version, follow these steps to discover the latest version from the official Roslyn build pipeline. ### Prerequisites @@ -66,180 +61,128 @@ If the user does not provide both versions, follow these steps to discover the l | jq -r '.records[] | select(.name == "Publish Assets" and .type == "Task") | .log.url') ``` -4. **Fetch the log and extract the NuGet package versions:** +4. **Fetch the log and extract the NuGet package version:** ```shell - ROSLYN_VERSION=$(curl -s -H "Authorization: Bearer $TOKEN" "$LOG_URL" \ + VERSION=$(curl -s -H "Authorization: Bearer $TOKEN" "$LOG_URL" \ | grep -oP 'Microsoft\.CodeAnalysis\.\K\d+\.\d+\.\d+-[\w.]+(?=\.nupkg)' \ | head -1) - RAZOR_VERSION=$(curl -s -H "Authorization: Bearer $TOKEN" "$LOG_URL" \ - | grep -oP 'Microsoft\.VisualStudioCode\.RazorExtension\.\K\d+\.\d+\.\d+-[\w.]+(?=\.nupkg)' \ - | head -1) - echo "Discovered Roslyn version: $ROSLYN_VERSION" - echo "Discovered Razor version: $RAZOR_VERSION" + echo "Discovered version: $VERSION" ``` -The extracted versions are the values to use as the new Roslyn and Razor versions for the rest of the process. - -**Important**: -- The build number (for example, `20260426.5`) is **not** the package version. -- If `RAZOR_VERSION` is empty, the selected build predates the combined Roslyn/Razor build. Do not guess a Razor version; fall back to the separate Razor workflow instead. +The extracted version (e.g., `5.6.0-2.26173.1`) is the value to use as the new Roslyn version for the rest of the process. ## Process -### Step 1: Determine the New Versions - -If the user provided both versions, use them. Otherwise, use the [Version Auto-Discovery](#version-auto-discovery) flow above to discover both from the same Roslyn build. - -### Step 2: Sync to the Canonical Base Branch - -Always anchor the update branch to the latest `main` from whichever remote points at `github.com/dotnet/vscode-csharp` before making any changes. Do **not** create the update branch from the current checkout, since the current branch may already be stale or may contain a previous failed attempt at the same update. +### Step 1: Create a New Branch +Create a new git branch for the update: ```powershell -# Find the canonical vscode-csharp remote (for example, origin or upstream) -$canonicalRemote = git remote -v | - Select-String 'github\.com[:/]dotnet/vscode-csharp(\.git)?\s+\(fetch\)$' | - ForEach-Object { ($_ -split '\s+')[0] } | - Select-Object -First 1 - -if (-not $canonicalRemote) { - git remote add upstream https://github.com/dotnet/vscode-csharp.git - $canonicalRemote = 'upstream' -} - -git fetch $canonicalRemote -git checkout -B update/roslyn- "$canonicalRemote/main" +git checkout -B update/roslyn- ``` +Replace `` with the new Roslyn version, using dashes instead of dots for the branch name. -Replace `` with the new Roslyn version, using dashes instead of dots for the branch name. - -**Important**: -- Capture the old Roslyn version and old Razor version from the canonical remote's `main` `package.json` before editing `package.json` -- Update the changelog section that exists on the latest canonical remote `main`, not one from an older local branch -- If a remote branch with the same name already exists from a previous attempt, inspect it before force-pushing. Do not blindly overwrite unexpected remote commits +### Step 2: Update package.json -### Step 3: Update package.json - -Update the `defaults.roslyn` and `defaults.razor` fields in `package.json`: +Update the `defaults.roslyn` field in `package.json`: ```json "defaults": { - "roslyn": "", - "razor": "", + "roslyn": "", ... } ``` -### Step 4: Run updateRoslynVersion and updateRazorVersion +### Step 3: Run updateRoslynVersion -This step acquires all of the updated Roslyn and Razor packages and ensures they are in the proper feeds: +This step acquires the new Roslyn packages and ensures they are in the proper feeds: ```powershell npm run updateRoslynVersion -npm run updateRazorVersion ``` -This pair of tasks: -- Downloads all platform-specific Roslyn language server NuGet packages -- Downloads the Roslyn Dev Kit NuGet package -- Downloads the `Microsoft.VisualStudioCode.RazorExtension` NuGet package +This task: +- Downloads all platform-specific Roslyn nuget packages +- Ensures packages are saved to the consumption AzDo artifacts feed - Runs `installDependencies` to update local dependencies -**Important**: Run both commands. `updateRoslynVersion` explicitly acquires the Roslyn packages, and `updateRazorVersion` explicitly acquires the Razor extension package before each command refreshes dependencies. - **Note**: You may need to install the [Azure Artifacts NuGet Credential Provider](https://github.com/microsoft/artifacts-credprovider#installation-on-windows) for interactive authentication. -### Step 5: Get the Previous Shared Commit SHA +### Step 4: Get the Previous Roslyn Commit SHA -The commit SHAs are stored in the `.nuspec` files inside the downloaded NuGet packages. Because the Roslyn and Razor packages come from the same combined build, they should point at the same old and new commits. Use the Roslyn package as the source of truth for the shared commit range. +The commit SHAs are stored in the `.nuspec` files inside the downloaded NuGet packages. After running `npm run updateRoslynVersion`, the new version's package will be cached locally, but you need to explicitly download the old version to get its commit SHA. -**To get the old shared commit SHA:** +**To get the old version's commit SHA:** -1. First, find the old Roslyn version from the canonical remote's `main` `package.json` (before your edit) - look at the `defaults.roslyn` value +1. First, find the old version number from the current `package.json` (before your edit) - look at the `defaults.roslyn` value 2. Download the old version's package to the local cache: ```powershell - dotnet restore "C:\Users\\source\repos\vscode-csharp\msbuild\server" /p:PackageName=roslyn-language-server.win-x64 /p:PackageVersion= --interactive + dotnet restore "C:\Users\\source\repos\vscode-csharp\msbuild\server" /p:PackageName=roslyn-language-server.osx-arm64 /p:PackageVersion= --interactive ``` 3. Extract the commit SHA from the nuspec file: ```powershell - Get-Content "C:\Users\\source\repos\vscode-csharp\out\.nuget\roslyn-language-server.win-x64\\roslyn-language-server.win-x64.nuspec" | Select-String -Pattern "commit" + Get-Content "C:\Users\\source\repos\vscode-csharp\out\.nuget\roslyn-language-server.osx-arm64\\roslyn-language-server.osx-arm64.nuspec" | Select-String -Pattern "commit" ``` This will show output like: ``` ``` -**Note**: -- Any platform-specific `roslyn-language-server` package should contain the same repository metadata; the examples use `win-x64` -- NuGet package names are lower case in the `.nuget` folder, so use `roslyn-language-server.win-x64` in the path -- If you want a sanity check, inspect the matching Razor package nuspec and confirm it points at the same commit, but you do not need a separate commit range for Razor - -### Step 6: Get the New Shared Commit SHA +### Step 5: Get the New Roslyn Commit SHA After running `npm run updateRoslynVersion`, the new version's package is already cached. Extract the commit SHA: ```powershell -Get-Content "C:\Users\\source\repos\vscode-csharp\out\.nuget\roslyn-language-server.win-x64\\roslyn-language-server.win-x64.nuspec" | Select-String -Pattern "commit" +Get-Content "C:\Users\\source\repos\vscode-csharp\out\.nuget\roslyn-language-server.osx-arm64\\roslyn-language-server.osx-arm64.nuspec" | Select-String -Pattern "commit" ``` -If desired, you can inspect the matching `Microsoft.VisualStudioCode.RazorExtension` nuspec as a sanity check and confirm it points at the same commit. - **Note**: The Azure DevOps artifacts feed web pages require authentication and may not load properly in automated scenarios. Always use the nuspec files from the local package cache. -### Step 7: Generate Changelog Data Using PR Finder +### Step 6: Generate Changelog Entries Using PR Finder First, locate the local `dotnet/roslyn` repository. Common locations include: - `C:\Users\\source\repos\roslyn` - `C:\repos\roslyn` -- Next to the vscode-csharp repo directory, e.g. `\..\roslyn` -Navigate to the Roslyn repository, fetch the latest, and run `pr-finder` once for the shared commit range. +Navigate to the roslyn repository, fetch the latest, and run the pr-finder tool: ```powershell cd git fetch origin -roslyn-tools pr-finder --start --end --format "o#" +roslyn-tools pr-finder --start --end --format "o#" ``` -**Important**: -- The tool is invoked as `roslyn-tools` (a global tool), NOT `dotnet roslyn-tools` -- Save the full raw output from this one command before filtering so it can be used in the PR description later +**Important**: The tool is invoked as `roslyn-tools` (a global tool), NOT `dotnet roslyn-tools`. This will output a list of PRs in the format needed for the changelog: - -```text +``` * (PR: [#](https://github.com/dotnet/roslyn/pull/)) ``` -### Step 8: Update CHANGELOG.md +### Step 7: Update CHANGELOG.md -Add **two** entries to `CHANGELOG.md` under the current version section from the latest canonical remote `main` (for example, `# 2.141.x`): one Roslyn entry and one Razor entry. Start from the single `pr-finder` output and split it into the Roslyn and Razor sections. +Add an entry to `CHANGELOG.md` under the current version section (e.g., `# 2.121.x`): +Copy the results from the previous step (should already be formatted correctly). ```markdown -* Update Roslyn to (PR: [#](https://github.com/dotnet/vscode-csharp/pull/)) - * (PR: [#](https://github.com/dotnet/roslyn/pull/)) - * (PR: [#](https://github.com/dotnet/roslyn/pull/)) - ... -* Update Razor to (PR: [#](https://github.com/dotnet/vscode-csharp/pull/)) - * (PR: [#](https://github.com/dotnet/roslyn/pull/)) - * (PR: [#](https://github.com/dotnet/roslyn/pull/)) +* Update Roslyn to (PR: [#](https://github.com/dotnet/vscode-csharp/pull/)) + * (PR: [#](https://github.com/dotnet/roslyn/pull/)) + * (PR: [#](https://github.com/dotnet/roslyn/pull/)) ... ``` Note: Leave the PR number blank initially (just `[#]`) - it will be updated after the PR is created. -### Step 9: Filter and Split Changelog Entries +### Step 8: Filter Changelog Entries -Review the single `pr-finder` output and split it into Roslyn and Razor changelog entries **independently**. Do not copy the raw output into both sections unchanged. +Review the changelog entries and remove any PRs that obviously don't affect VS Code. Remove entries that are: -Remove entries that are: - **Infrastructure/Build changes**: CI/CD pipelines, build scripts, Azure DevOps configurations - **Visual Studio-only changes**: Features or fixes specific to Visual Studio IDE (not VS Code) -- **Test-only changes**: Test infrastructure, test fixes that do not affect production code -- **Internal tooling**: Changes to internal tools not used by the language servers or extension +- **Test-only changes**: Test infrastructure, test fixes that don't affect production code +- **Internal tooling**: Changes to internal tools not used by the language server - **Documentation-only**: README updates, internal docs (unless they document user-facing features) -- **Razor compiler-only changes**: Compiler changes that do not affect the shipped language server or Razor extension behavior in VS Code -Keep Roslyn entries that are: +Keep entries that are: - Language server protocol (LSP) changes - Code analysis/diagnostics improvements - Completion, navigation, refactoring features @@ -247,55 +190,29 @@ Keep Roslyn entries that are: - Bug fixes that affect language server behavior - API changes that could affect VS Code extension -Keep Razor entries that are: -- Razor formatting, completion, navigation, or refactoring changes -- Razor diagnostics and code analysis improvements -- Cohost and Razor document synchronization changes -- Performance improvements -- Bug fixes that affect Razor language server or VS Code Razor behavior -- API changes that affect the Razor extension loaded by vscode-csharp - -If a PR makes sense to appear in both entries, err on the side of including it in Razor only. - -### Step 10: Commit and Push +### Step 9: Commit and Push ```powershell git add package.json CHANGELOG.md -git commit -m "Bump Roslyn to and Razor to " -git push -u origin update/roslyn- +git commit -m "Update Roslyn to " +git push -u origin update/roslyn- ``` -If you are retrying an existing PR branch, prefer `git push --force-with-lease` after you have inspected the remote branch and confirmed it is safe to replace. - -### Step 11: Create Pull Request +### Step 10: Create Pull Request Create a pull request on GitHub: -- Title: `Bump Roslyn to and Razor to ` +- Title: `Update roslyn to ` - Base: `main` -### Step 12: Update PR Description - -After creating the PR, update its description with the **full raw output** from the one `roslyn-tools pr-finder` command (the unfiltered version, before splitting it into Roslyn and Razor changelog entries). This gives reviewers a complete view of the changes included in the version bump. - -```powershell -$prBody = @" -## Combined Roslyn/Razor pr-finder output - -"@ -gh pr edit --repo dotnet/vscode-csharp --body $prBody -``` - -The body should include the `[View Complete Diff of Changes]` link and all PR entries exactly as output by `pr-finder`. +### Step 11: Update Changelog with PR Number -### Step 13: Update Changelog with PR Number +After the PR is created, note the PR number (e.g., `#8941`), then: -After the PR is created, note the PR number (for example, `#9240`), then: - -1. Update the `CHANGELOG.md` entries to include the actual PR number: +1. Update the CHANGELOG.md entry to include the actual PR number: ```markdown - * Update Roslyn to (PR: [#9240](https://github.com/dotnet/vscode-csharp/pull/9240)) - * Update Razor to (PR: [#9240](https://github.com/dotnet/vscode-csharp/pull/9240)) + * Update Roslyn to (PR: [#8941](https://github.com/dotnet/vscode-csharp/pull/8941)) ``` + 2. Commit and push the update: ```powershell git add CHANGELOG.md @@ -305,32 +222,30 @@ After the PR is created, note the PR number (for example, `#9240`), then: ## Example -For updating from `5.7.0-1.26220.12` and `10.0.0-preview.26217.1` to paired Roslyn and Razor versions from the same Roslyn build: +For updating from `5.4.0-2.26077.7` to `5.5.0-2.26080.10`: -1. Discover the latest Roslyn and Razor versions from the official Roslyn build (or use both user-provided versions) -2. Branch: `update/roslyn-` -3. package.json changes: `"roslyn": ""` and `"razor": ""` -4. Run `npm run updateRoslynVersion` -5. Run `npm run updateRazorVersion` -6. Find the shared old and new commits from `roslyn-language-server.win-x64` -7. Run `pr-finder` once in the Roslyn repo -8. Split that single output into Roslyn and Razor changelog entries -9. Create a PR titled `Bump Roslyn to and Razor to ` -10. Update the PR description with the raw `pr-finder` output -11. Update both changelog entries with the PR number +1. Branch: `update/roslyn-5-5-0-2-26080-10` +2. package.json change: `"roslyn": "5.5.0-2.26080.10"` +3. Find old commit from package metadata for version `5.4.0-2.26077.7` +4. Find new commit from package metadata for version `5.5.0-2.26080.10` +5. Run pr-finder in roslyn repo +6. Update CHANGELOG.md with the output +7. Run `npm run updateRoslynVersion` +8. Create PR titled "Update roslyn to 5.5.0-2.26080.10" +9. Update changelog with PR number -## Reference PRs +## Reference PR -See [PR #8941](https://github.com/dotnet/vscode-csharp/pull/8941) for the Roslyn-only flow and [PR #8914](https://github.com/dotnet/vscode-csharp/pull/8914) for the Razor-only flow. The combined workflow in this skill merges those two patterns into one PR. +See [PR #8941](https://github.com/dotnet/vscode-csharp/pull/8941) as an example of a Roslyn version update. ## Files Modified -- `package.json` - Update `defaults.roslyn` and `defaults.razor` -- `CHANGELOG.md` - Add separate changelog entries for Roslyn and Razor +- `package.json` - Update `defaults.roslyn` version +- `CHANGELOG.md` - Add changelog entry with Roslyn PR list ## Troubleshooting -### Authentication Issues with updateRoslynVersion or updateRazorVersion +### Authentication Issues with updateRoslynVersion If you encounter authentication errors: 1. Install Azure Artifacts Credential Provider @@ -339,8 +254,8 @@ If you encounter authentication errors: ### pr-finder Returns Empty Results Ensure: -1. You have fetched the latest from origin in the Roslyn repo: `git fetch origin` -2. Both shared commit SHAs exist in your local repo +1. You have fetched the latest from origin in the roslyn repo: `git fetch origin` +2. Both commit SHAs exist in your local repo 3. You have authenticated with `roslyn-tools authenticate` 4. You are invoking the tool correctly as `roslyn-tools pr-finder` (not `dotnet roslyn-tools`) @@ -348,9 +263,14 @@ Ensure: The commit SHAs are embedded in the nuspec files inside the downloaded NuGet packages: -1. After running `npm run updateRoslynVersion` and `npm run updateRazorVersion`, packages are cached in `out\.nuget\` -2. To get the shared old commit, explicitly download the old `roslyn-language-server.win-x64` package first -3. Then read the corresponding `.nuspec` file and inspect the `commit` attribute -4. If you want a sanity check, inspect the matching `Microsoft.VisualStudioCode.RazorExtension` nuspec and confirm it points at the same commit +1. After running `npm run updateRoslynVersion`, packages are cached in `out/.nuget/` +2. To get the old version's commit, you may need to explicitly download it first: + ```powershell + dotnet restore "msbuild\server" /p:PackageName=roslyn-language-server.osx-arm64 /p:PackageVersion= --interactive + ``` +3. Then read the nuspec file: + ```powershell + Get-Content "out\.nuget\roslyn-language-server.osx-arm64\\roslyn-language-server.osx-arm64.nuspec" | Select-String -Pattern "commit" + ``` **Note**: The Azure DevOps artifacts feed web pages require authentication and often fail to load in automated scenarios. Always use the local nuspec files instead.