Skip to content

Commit cdbe9f8

Browse files
authored
Merge prerelease to release (#8773)
2 parents db95556 + b1e174e commit cdbe9f8

File tree

83 files changed

+6532
-309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+6532
-309
lines changed

.github/copilot-instructions.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Copilot Coding Agent Instructions for `vscode-csharp`
2+
3+
## Project Overview
4+
- This is the official C# extension for Visual Studio Code, supporting C# development via OmniSharp and Roslyn-based language servers.
5+
- The codebase is TypeScript/JavaScript, with some JSON and configuration files. It integrates with .NET components and external language servers.
6+
7+
## Architecture & Key Components
8+
- **src/**: Main extension source. Key subfolders:
9+
- `lsptoolshost/`: Hosts LSP (Language Server Protocol) logic, including Copilot integration (`copilot/`), Roslyn, and Razor support.
10+
- `omnisharp/`: Protocols and logic for OmniSharp-based language server.
11+
- `razor/`: Razor language support and configuration.
12+
- **Copilot Integration**:
13+
- `src/lsptoolshost/copilot/contextProviders.ts` and `relatedFilesProvider.ts` register C# context and related files providers for GitHub Copilot and Copilot Chat extensions.
14+
- The Roslyn Copilot language server is managed as a downloadable component (see `package.json` and `CONTRIBUTING.md`).
15+
16+
## Developer Workflows
17+
- **Build**: `npm run compile` (or use VS Code build task)
18+
- **Test**: `npm test` (runs Jest tests)
19+
- **Package**: `npm run package` (creates VSIX)
20+
- **Dependencies**: Use `gulp installDependencies` to fetch .NET/LS components
21+
- **Debugging**: See `docs/debugger/` for advanced .NET debugging, including runtime and external library debugging.
22+
- **Roslyn Copilot Language Server**: To update/test, see instructions in `CONTRIBUTING.md` (triggers pipeline, checks logs for install, etc.)
23+
24+
## Infrastructure Tasks
25+
- **Tasks Directory**: Build automation is in `tasks/` using Gulp. Key modules:
26+
- `testTasks.ts`: Test orchestration for unit/integration tests across components
27+
- `offlinePackagingTasks.ts`: VSIX packaging for different platforms (`vsix:release:package:*`)
28+
- `componentUpdateTasks.ts`: Automated updates for Roslyn Copilot components
29+
- `snapTasks.ts`: Version bumping and changelog management for releases
30+
- `gitTasks.ts`: Git operations for automated PR creation and branch management
31+
- **Adding New Tasks**: Create `.ts` file in `tasks/`, define `gulp.task()` functions, require in `gulpfile.ts`
32+
- **Task Patterns**: Use `projectPaths.ts` for consistent path references, follow existing naming conventions (`test:integration:*`, `vsix:*`, etc.)
33+
34+
## Project Conventions & Patterns
35+
- **TypeScript**: Follows strict linting (`.eslintrc.js`), including header/license blocks and camelCase filenames (except for interfaces and special files).
36+
- **Component Downloads**: Language servers and debuggers are downloaded at runtime; see `package.json` for URLs and install logic.
37+
- **Copilot Providers**: Use `registerCopilotContextProviders` and `registerCopilotRelatedFilesProvider` to extend Copilot context for C#.
38+
- **Testing**: Prefer integration tests over unit tests for features. Structure follows:
39+
- `test/lsptoolshost/integrationTests/` for Roslyn/LSP features
40+
- `test/omnisharp/omnisharpIntegrationTests/` for OmniSharp features
41+
- `test/razor/razorIntegrationTests/` for Razor features
42+
- Use `test/*/integrationTests/integrationHelpers.ts` for test setup utilities
43+
- Tests use Jest with VS Code test environment and require workspace test assets
44+
- Run with `npm run test:integration:*` commands (e.g., `npm run test:integration:csharp`)
45+
46+
## Integration Points
47+
- **GitHub Copilot**: Extension registers C# context and related files providers if Copilot/Copilot Chat extensions are present.
48+
- **Roslyn Language Server**: Managed as a downloadable component, versioned in `package.json` and updated via pipeline.
49+
- **OmniSharp**: Legacy support, also downloaded as a component.
50+
51+
## Examples
52+
- To add a new Copilot context provider: see `src/lsptoolshost/copilot/contextProviders.ts`.
53+
- To update Roslyn Copilot server: follow `CONTRIBUTING.md` > "Updating the Roslyn Copilot Language Server version".
54+
55+
## References
56+
- [README.md](../README.md): User-facing overview and features
57+
- [CONTRIBUTING.md](../CONTRIBUTING.md): Dev setup, packaging, and advanced workflows
58+
- [package.json](../package.json): Component download logic, scripts
59+
- [src/lsptoolshost/copilot/](../src/lsptoolshost/copilot/): Copilot integration logic
60+
61+
---
62+
For any unclear or incomplete sections, please provide feedback to improve these instructions.

.github/workflows/branch-snap.yml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Branch snap
22
on:
3-
workflow_dispatch
3+
workflow_dispatch:
4+
inputs:
5+
releaseCandidate:
6+
description: 'Is this a release candidate snap from main? (Will increment main version to be higher than next stable release)'
7+
required: false
8+
default: 'false'
9+
type: boolean
410

511
permissions:
612
contents: write
@@ -12,24 +18,56 @@ jobs:
1218
with:
1319
configuration_file_path: '.config/snap-flow.json'
1420

15-
create-pull-request:
21+
bump-main-version:
22+
needs: check-script
1623
if: github.ref == 'refs/heads/main'
1724
runs-on: ubuntu-latest
1825
steps:
1926
- name: Check out
20-
uses: actions/checkout@v2
27+
uses: actions/checkout@v4
2128
- name: Install NodeJS
2229
uses: actions/setup-node@v4
2330
with:
2431
node-version: '18.x'
2532
- name: Install dependencies
2633
run: npm ci
2734
- name: Update version.json
28-
run: npx gulp incrementVersion
35+
run: |
36+
if [ "${{ github.event.inputs.releaseCandidate }}" = "true" ]; then
37+
npx gulp incrementVersion --releaseCandidate=true
38+
else
39+
npx gulp incrementVersion
40+
fi
2941
- name: Create version update PR
3042
uses: peter-evans/create-pull-request@v4
3143
with:
3244
token: ${{ secrets.GITHUB_TOKEN }}
3345
commit-message: Update main version
3446
title: '[automated] Update main version'
3547
branch: merge/update-main-version
48+
49+
update-release-version:
50+
needs: check-script
51+
if: github.ref == 'refs/heads/prerelease'
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Check out merge branch
55+
uses: actions/checkout@v4
56+
with:
57+
ref: merge/prerelease-to-release
58+
fetch-depth: 0
59+
- name: Install NodeJS
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: '18.x'
63+
- name: Install dependencies
64+
run: npm ci
65+
- name: Update version.json for release
66+
run: npx gulp updateVersionForStableRelease
67+
- name: Create PR with version update
68+
uses: peter-evans/create-pull-request@v4
69+
with:
70+
token: ${{ secrets.GITHUB_TOKEN }}
71+
commit-message: Update version for stable release
72+
branch: merge/prerelease-to-release
73+
base: release
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# GitHub Copilot setup steps for the C# VS Code extension
2+
# This file configures the environment for the GitHub Copilot coding agent
3+
4+
name: "Copilot Setup Steps"
5+
6+
# Automatically run the setup steps when they are changed to allow for easy validation, and
7+
# allow manual testing through the repository's "Actions" tab
8+
on:
9+
workflow_dispatch:
10+
push:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
pull_request:
14+
paths:
15+
- .github/workflows/copilot-setup-steps.yml
16+
17+
jobs:
18+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
19+
copilot-setup-steps:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read # Read access to the repository contents (required for checkout)
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v5
27+
28+
# Install Node.js (required for TypeScript compilation and npm packages)
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: '20'
32+
cache: 'npm'
33+
34+
# Install .NET SDK (required for some build components and MSBuild tasks)
35+
- uses: actions/setup-dotnet@v4
36+
with:
37+
dotnet-version: '8.0.x'
38+
39+
# Install npm dependencies
40+
- name: Install dependencies
41+
run: npm ci
42+
43+
# Install gulp globally (required for build tasks)
44+
- name: Install gulp
45+
run: npm install -g gulp
46+
47+
# Install vsce (needed for packaging tasks)
48+
- name: Install vsce
49+
run: npm install -g vsce
50+
51+
# Install server dependencies (needed for integration tests and running)
52+
- name: Install dependencies
53+
run: gulp installDependencies
54+
55+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Update CHANGELOG
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
# Runs every Tuesday at 9 PM Pacific Time (5 AM UTC Wednesday)
6+
- cron: '0 5 * * 3'
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
update-changelog:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out
17+
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
- name: Install roslyn-tools
21+
run: dotnet tool install -g Microsoft.RoslynTools --prerelease --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json
22+
- name: Install NodeJS
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20.x'
26+
- name: Install dependencies
27+
run: npm ci
28+
- name: Update CHANGELOG
29+
run: npx gulp updateChangelog
30+
- name: Create update PR
31+
uses: peter-evans/create-pull-request@v4
32+
with:
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
commit-message: Update ${{ github.ref_name }} CHANGELOG
35+
title: '[automated] Update ${{ github.ref_name }} CHANGELOG'
36+
branch: merge/update-${{ github.ref_name }}-changelog

.vscodeignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
!.razorDevKit/**
99
!.razoromnisharp/**
1010
!.razorExtension/**
11-
.rpt2_cache/**
11+
.azuredevops/**
1212
.config/**
1313
.devcontainer/**
1414
.github/**
@@ -22,8 +22,7 @@ src/**
2222
tasks/**
2323
test/**
2424
__mocks__/**
25-
jest.config.ts
26-
baseJestConfig.ts
25+
**/*.ts
2726
.prettierignore
2827
typings/**
2928
vsix/**
@@ -40,17 +39,13 @@ CODEOWNERS
4039
Directory.Build.props
4140
global.json
4241
NuGet.config
43-
gulpfile.ts
4442
!install.Lock
45-
ISSUE_TEMPLATE
4643
!README.md
4744
!CHANGELOG.md
4845
*.md
49-
CONTRIBUTING.md
5046
*.vscodeignore
5147
*.yml
5248
package-lock.json
53-
package.json
5449
tsconfig.json
5550
version.json
5651
wallaby.js

CHANGELOG.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@
105105

106106
# 2.93.x
107107
* Bump Roslyn to 5.0.0-2.25472.11 (PR: [#8646](https://github.com/dotnet/vscode-csharp/pull/8646))
108-
* Fix handling edits in types nested in reloadable types(PR: [#80360](https://github.com/dotnet/roslyn/pull/80360))
109-
* Remove CS1998 warning entirely and remove dependent C# code fix providers(PR: [#80144](https://github.com/dotnet/roslyn/pull/80144))
110-
* Only restore based on assets file changes if the actual content changed(PR: [#80341](https://github.com/dotnet/roslyn/pull/80341))
108+
* Fix handling edits in types nested in reloadable types (PR: [#80360](https://github.com/dotnet/roslyn/pull/80360))
109+
* Remove CS1998 warning entirely and remove dependent C# code fix providers (PR: [#80144](https://github.com/dotnet/roslyn/pull/80144))
110+
* Only restore based on assets file changes if the actual content changed (PR: [#80341](https://github.com/dotnet/roslyn/pull/80341))
111111
* Fix issue where build artifacts were added in source tree (PR: [#80324](https://github.com/dotnet/roslyn/pull/80324))
112-
* Allow clients to send range ending at the line after the last line in the document(PR: [#80310](https://github.com/dotnet/roslyn/pull/80310))
113-
* Don't show Razor diagnostics in Full Solution Analysis(PR: [#80296](https://github.com/dotnet/roslyn/pull/80296))
114-
* Log project context in which document was found(PR: [#80202](https://github.com/dotnet/roslyn/pull/80202))
112+
* Allow clients to send range ending at the line after the last line in the document (PR: [#80310](https://github.com/dotnet/roslyn/pull/80310))
113+
* Don't show Razor diagnostics in Full Solution Analysis (PR: [#80296](https://github.com/dotnet/roslyn/pull/80296))
114+
* Log project context in which document was found (PR: [#80202](https://github.com/dotnet/roslyn/pull/80202))
115115
* Bump Razor to 10.0.0-preview.25472.6 (PR: [#8639](https://github.com/dotnet/vscode-csharp/pull/8639))
116116
* Support view components in Go To Def (PR: [#12222](https://github.com/dotnet/razor/pull/12222))
117117
* Redirect the older named assembly too (PR: [#12239](https://github.com/dotnet/razor/pull/12239))
@@ -126,10 +126,10 @@
126126

127127
# 2.91.x
128128
* Bump Roslyn to 5.0.0-2.25458.10 (PR: [#8588](https://github.com/dotnet/vscode-csharp/pull/8588))
129-
* Move brace adjustment on enter to on auto insert in LSP(PR: [#80075](https://github.com/dotnet/roslyn/pull/80075))
130-
* Avoid throwing when obsolete overload of GetUpdatesAsync is invoked with empty array(PR: [#80161](https://github.com/dotnet/roslyn/pull/80161))
131-
* Bump patch version of MSBuild packages(PR: [#80156](https://github.com/dotnet/roslyn/pull/80156))
132-
* Include category in Hot Reload log messages(PR: [#80160](https://github.com/dotnet/roslyn/pull/80160))
129+
* Move brace adjustment on enter to on auto insert in LSP (PR: [#80075](https://github.com/dotnet/roslyn/pull/80075))
130+
* Avoid throwing when obsolete overload of GetUpdatesAsync is invoked with empty array (PR: [#80161](https://github.com/dotnet/roslyn/pull/80161))
131+
* Bump patch version of MSBuild packages (PR: [#80156](https://github.com/dotnet/roslyn/pull/80156))
132+
* Include category in Hot Reload log messages (PR: [#80160](https://github.com/dotnet/roslyn/pull/80160))
133133
* Store client's version for open docs (PR: [#80064](https://github.com/dotnet/roslyn/pull/80064))
134134
* Pass global properties and the binary log path via RPC to BuildHost (PR: [#80094](https://github.com/dotnet/roslyn/pull/80094))
135135
* Don't switch runtime / design time solutions if cohosting is on (PR: [#80065](https://github.com/dotnet/roslyn/pull/80065))

CONTRIBUTING.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ To debug unit tests locally, press <kbd>F5</kbd> in VS Code with the "Launch Tes
6464
To debug integration tests
6565
1. Import the `csharp-test-profile.code-profile` in VSCode to setup a clean profile in which to run integration tests. This must be imported at least once to use the launch configurations (ensure the extensions are updated in the profile).
6666
2. Open any integration test file and <kbd>F5</kbd> launch with the correct launch configuration selected.
67-
- For integration tests inside `test/lsptoolshost`, use either `Launch Current File slnWithCsproj Integration Tests` or `[DevKit] Launch Current File slnWithCsproj Integration Tests` (to run tests using C# + C# Dev Kit)
67+
- For integration tests inside `test/lsptoolshost`, use either `[Roslyn] Run Current File Integration Test` or `[DevKit] Launch Current File Integration Tests` (to run tests using C# + C# Dev Kit)
6868
- For integration tests inside `test/razor`, use `[Razor] Run Current File Integration Test`
69-
- For integration tests inside `test/omnisharp`, use one of the `Omnisharp:` current file profiles
69+
- For integration tests inside `test/omnisharp`, use one of the `[O#] Run Current File Integration Test` current file profiles
7070

7171
These will allow you to actually debug the test, but the 'Razor integration tests' configuration does not.
7272

@@ -196,15 +196,25 @@ More details for this are [here] (https://devdiv.visualstudio.com/DevDiv/_git/Vi
196196
## Snapping for releases
197197
Extension releases on the marketplace are done from the prerelease and release branches (corresponding to the prerelease or release version of the extension). Code flows from main -> prerelease -> release. Every week we snap main -> prerelease. Monthly, we snap prerelease -> release.
198198

199+
### Versioning Scheme
200+
The extension follows a specific versioning scheme for releases:
201+
- **Prerelease versions**: Use standard minor version increments (e.g., 2.74, 2.75, 2.76...)
202+
- **Stable release versions**: Use the next tens version (e.g., 2.74 prerelease becomes 2.80 stable)
203+
- **Main branch after RC snap**: Jumps to one above the next stable version (e.g., if snapping 2.74 as RC, main becomes 2.81)
204+
199205
### Snap main -> prerelease
200206
The snap is done via the "Branch snap" github action. To run the snap from main -> prerelease, run the action via "Run workflow" and choose main as the base branch.
201207
![branch snap action](./docs/images/main_snap.png)
202208

209+
When running the snap action, you can optionally check the "Is this a release candidate snap" checkbox. If checked:
210+
- The prerelease branch will receive the snapped code with the current version (e.g., 2.74)
211+
- The main branch version will be updated to be higher than the next stable release (e.g., 2.81, since the next stable would be 2.80)
212+
203213
This will generate two PRs that must be merged. One merging the main branch into prerelease, and the other bumps the version in main.
204214
![generated prs](./docs/images/generated_prs.png)
205215

206216
### Snap prerelease -> release
207-
To snap from prerelease to release, run the same action but use **prerelease** as the workflow branch. This will generate a single PR merging from prerelease to release.
217+
To snap from prerelease to release, run the same action but use **prerelease** as the workflow branch. This will generate a PR merging from prerelease to release, and automatically update the version to the next stable release version (e.g., 2.74 -> 2.80) on the merge branch before the PR is merged.
208218

209219
### Marketplace release
210220
The marketplace release is managed by an internal AzDo pipeline. On the pipeline page, hit run pipeline. This will bring up the pipeline parameters to fill out:

SUPPORT.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ If you encounter issues with document classification (e.g., incorrect syntax hig
107107
For issues with diagnostics, please provide values of the background analysis scope options, `dotnet.backgroundAnalysis.analyzerDiagnosticsScope` and `dotnet.backgroundAnalysis.compilerDiagnosticsScope`
108108
![background analysis settings](./docs/images/background_analysis.png)
109109

110-
#### Language server crashing
110+
### Language server crashing
111111

112112
If the language server crashes, general logs are often helpful for diagnosing the issue. However, in some cases, logs alone may not provide enough information and we may need a crash dump. Follow these steps to collect a crash dump:
113113
- Set the `dotnet.server.crashDumpPath` setting in VSCode to a user-writable folder where crash dumps can be saved.
@@ -117,7 +117,7 @@ If the language server crashes, general logs are often helpful for diagnosing th
117117
> [!WARNING]
118118
> The dump can contain detailed information on the project - generally we will provide an email so that it can be shared privately
119119
120-
#### Recording a language server trace
120+
### Recording a language server trace
121121

122122
When investigating performance issues, we may request a performance trace of the language server to diagnose what is causing the problem. These are typically taken via [dotnet-trace](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace) (a cross platform tool to collect performance traces of .NET processes)
123123

@@ -132,6 +132,16 @@ The C# extension has a built in command, `csharp.recordLanguageServerTrace` to h
132132
![alt text](docs/images/recordTraceTerminal.png)
133133
5. Share the trace. Note that the trace may contain PII, so generally we will provide an email or other confidential way to share the trace with us.
134134

135+
### Sharing information privately
136+
Detailed logs, dumps, traces, and other information can sometimes contain private information that you do not wish to share publicly. Instead, you can utilize the Developer Community page to share these privately to Microsoft.
137+
138+
1. Go to https://developercommunity.visualstudio.com/dotnet/report
139+
2. Fill in the issue title, reference the GitHub issue in the description, and upload the attachments
140+
![developer community feedback page](docs/images/developer_community_feedback.png)
141+
3. Once created, a comment on the GitHub issue a link to the new Developer Community ticket.
142+
143+
144+
135145
## Microsoft Support Policy
136146

137147
Support for this project is limited to the resources listed above.

0 commit comments

Comments
 (0)