Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@
]
}
},
"postCreateCommand": "npm ci && npx gulp installDependencies && npm i -g gulp"
"postCreateCommand": "npm ci"
}
6 changes: 3 additions & 3 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
- **Build**: `npm run compile` (or use VS Code build task)
- **Test**: `npm test` (runs Jest tests)
- **Package**: `npm run package` (creates VSIX)
- **Dependencies**: Use `gulp installDependencies` to fetch .NET/LS components
- **Dependencies**: Use `npm run installDependencies` to fetch .NET/LS components
- **Debugging**: See `docs/debugger/` for advanced .NET debugging, including runtime and external library debugging.
- **Roslyn Copilot Language Server**: To update/test, see instructions in `CONTRIBUTING.md` (triggers pipeline, checks logs for install, etc.)

## Infrastructure Tasks
- **Tasks Directory**: Build automation is in `tasks/` using Gulp. Key modules:
- **Tasks Directory**: Build automation is in `tasks/` with one script per task under task-area folders such as `tasks/packaging/`, `tasks/tests/`, etc. Key modules:
- `testTasks.ts`: Test orchestration for unit/integration tests across components
- `offlinePackagingTasks.ts`: VSIX packaging for different platforms (`vsix:release:package:*`)
- `componentUpdateTasks.ts`: Automated updates for Roslyn Copilot components
- `snapTasks.ts`: Version bumping and changelog management for releases
- `gitTasks.ts`: Git operations for automated PR creation and branch management
- **Adding New Tasks**: Create `.ts` file in `tasks/`, define `gulp.task()` functions, require in `gulpfile.ts`
- **Adding New Tasks**: Create a dedicated `.ts` entry script under the matching area in `tasks/` and matching scripts entry in the `package.json`
- **Task Patterns**: Use `projectPaths.ts` for consistent path references, follow existing naming conventions (`test:integration:*`, `vsix:*`, etc.)

## Project Conventions & Patterns
Expand Down
14 changes: 7 additions & 7 deletions .github/skills/update-roslyn-version/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ Update the `defaults.roslyn` field in `package.json`:
}
```

### Step 3: Run gulp updateRoslynVersion
### Step 3: Run updateRoslynVersion

This step acquires the new Roslyn packages and ensures they are in the proper feeds:

```powershell
gulp updateRoslynVersion
npm run updateRoslynVersion
```

This task:
Expand All @@ -62,7 +62,7 @@ This task:

### Step 4: Get the Previous Roslyn Commit SHA

The commit SHAs are stored in the `.nuspec` files inside the downloaded NuGet packages. After running `gulp updateRoslynVersion`, the new version's package will be cached locally, but you need to explicitly download the old version to get its commit SHA.
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 version's commit SHA:**

Expand All @@ -82,7 +82,7 @@ The commit SHAs are stored in the `.nuspec` files inside the downloaded NuGet pa

### Step 5: Get the New Roslyn Commit SHA

After running `gulp updateRoslynVersion`, the new version's package is already cached. Extract the commit SHA:
After running `npm run updateRoslynVersion`, the new version's package is already cached. Extract the commit SHA:

```powershell
Get-Content "C:\Users\<username>\source\repos\vscode-csharp\out\.nuget\roslyn-language-server.osx-arm64\<new-version>\roslyn-language-server.osx-arm64.nuspec" | Select-String -Pattern "commit"
Expand Down Expand Up @@ -183,7 +183,7 @@ For updating from `5.4.0-2.26077.7` to `5.5.0-2.26080.10`:
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 `gulp updateRoslynVersion`
7. Run `npm run updateRoslynVersion`
8. Create PR titled "Update roslyn to 5.5.0-2.26080.10"
9. Update changelog with PR number

Expand All @@ -198,7 +198,7 @@ See [PR #8941](https://github.com/dotnet/vscode-csharp/pull/8941) as an example

## Troubleshooting

### Authentication Issues with gulp updateRoslynVersion
### Authentication Issues with updateRoslynVersion

If you encounter authentication errors:
1. Install Azure Artifacts Credential Provider
Expand All @@ -216,7 +216,7 @@ Ensure:

The commit SHAs are embedded in the nuspec files inside the downloaded NuGet packages:

1. After running `gulp updateRoslynVersion`, packages are cached in `out/.nuget/`
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=<old-version> --interactive
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/branch-snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
- name: Update version.json
run: |
if [ "${{ github.event.inputs.releaseCandidate }}" = "true" ]; then
npx gulp incrementVersion --releaseCandidate=true
npm run incrementVersion -- --releaseCandidate=true
else
npx gulp incrementVersion
npm run incrementVersion
fi
- name: Create version update PR
uses: peter-evans/create-pull-request@v4
Expand All @@ -63,7 +63,7 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Update version.json for release
run: npx gulp updateVersionForStableRelease
run: npm run updateVersionForStableRelease
- name: Commit and push version update
run: |
git config user.name "github-actions[bot]"
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ jobs:
- name: Install dependencies
run: npm ci

# Install gulp globally (required for build tasks)
- name: Install gulp
run: npm install -g gulp

# Install vsce (needed for packaging tasks)
- name: Install vsce
run: npm install -g vsce

# Install server dependencies (needed for integration tests and running)
- name: Install dependencies
run: gulp installDependencies


2 changes: 1 addition & 1 deletion .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Update CHANGELOG
run: npx gulp updateChangelog
run: npm run updateChangelog
- name: Create update PR
uses: peter-evans/create-pull-request@v4
with:
Expand Down
26 changes: 13 additions & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,19 @@
{
"type": "node",
"request": "launch",
"name": "Debug gulp task",
"name": "Debug task",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"args": ["${input:gulpTaskName}"],
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/${input:taskScript}"],
"cwd": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Update OmniSharp package dependencies",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"args": ["updatePackageDependencies"],
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/debugger/updatePackageDependencies.ts"],
"env": {
"NEW_DEPS_ID": "OmniSharp",
"NEW_DEPS_URLS": "https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-x64.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-x86.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-arm64.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-osx.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-win-x64.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-win-arm64.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-musl-x64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-musl-arm64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-x64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-arm64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-osx-x64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-osx-arm64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-win-x64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-win-arm64-net6.0.zip",
Expand All @@ -203,8 +203,8 @@
"request": "launch",
"name": "Update razor telemetry package dependencies",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"args": ["updatePackageDependencies"],
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/debugger/updatePackageDependencies.ts"],
"env": {
"NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/704e369c5905f9ece819ebce77fb78d8/devkittelemetry-linux-arm64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/4049a66147717a53860bbc969bf32faa/devkittelemetry-linux-musl-arm64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/c75e84ff813be5c9833d96dc2066a364/devkittelemetry-linux-musl-x64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/f58cf629939f0df77d142be881f9e233/devkittelemetry-linux-x64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/1c912419ea45c8d95cfa28a8a04640dc/devkittelemetry-osx-arm64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/36545ba0998f1fc380e877e38b2f35f1/devkittelemetry-osx-x64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/0a32698e8ba1ab93489d79f34f8ae8d0/devkittelemetry-platformagnostic-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/4f16ff826fedd33ad80d265c5409588b/devkittelemetry-win-arm64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/5a98d8f4e481dbb7ae3cdb3695b75c46/devkittelemetry-win-x64-7.0.0-preview.24178.4.zip",
"NEW_DEPS_VERSION": "7.0.0-preview.24178.4",
Expand All @@ -217,17 +217,17 @@
"request": "launch",
"name": "Generate debugger options schema",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"args": ["generateOptionsSchema"],
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/debugger/generateOptionsSchema.ts"],
"cwd": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Razor Cohost integration tests",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"args": ["test:integration:razor:cohost"],
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/tests/testIntegrationRazorCohost.ts"],
"cwd": "${workspaceFolder}"
}
],
Expand All @@ -239,8 +239,8 @@
"options": ["singleCsproj", "RazorApp", "slnWithCsproj", "slnFilterWithCsproj", "slnWithGenerator"]
},
{
"id": "gulpTaskName",
"description": "The name of the gulp task to debug",
"id": "taskScript",
"description": "The task script path under tasks (ex. `tests/testUnit.ts`)",
"type": "promptString"
}
]
Expand Down
8 changes: 3 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ Follow these steps to build, run, and test the repository:

If you have the ability to run powershell, you can invoke "init.ps1" from the root of the repo. If not, the following steps will get build going for you as well:

1. Run `npm i` - This command installs the project dependencies.
2. Run `npm i -g gulp` - This command installs Gulp globally.
3. Run `gulp installDependencies` - This command downloads the various dependencies as specified by the version in the [package.json](package.json) file.
1. Run `npm ci` - This command installs the project dependencies.

**Note**: Authentication with `ado-npm-auth` is only required when adding new packages to the feeds. For regular development with existing dependencies, authentication is not necessary. See the [Updating NPM packages](#updating-npm-packages) section for details.

Expand Down Expand Up @@ -164,7 +162,7 @@ To add new packages, you must authenticate by running:

## Creating VSIX Packages for the Extension

To package this extension, we need to create VSIX Packages. The VSIX packages can be created using the gulp command `gulp vsix:release:package`. This will create all the platform specific VSIXs that you can then install manually in VSCode.
To package this extension, we need to create VSIX Packages. The VSIX packages can be created using the command `npm run vsix:release:package`. This will create all the platform specific VSIXs that you can then install manually in VSCode.

## Updating the `Roslyn` Language Server Version

Expand All @@ -174,7 +172,7 @@ To update the version of the roslyn server used by the extension do the followin
1. Find the the Roslyn signed build you want from [here](https://dnceng.visualstudio.com/internal/_build?definitionId=327&_a=summary). Typically the latest successful build of main is fine.
2. In the official build stage, look for the `Publish Assets` step. In there you will see it publishing the `Microsoft.CodeAnalysis.LanguageServer.neutral` package with some version, e.g. `4.6.0-3.23158.4`. Take note of that version number.
3. In the [package.json](package.json) inside the `defaults` section update the `roslyn` key to point to the version number you found above in step 2.
4. Ensure that version of the package is in the proper feeds by running `gulp updateRoslynVersion`. Note: you may need to install the [Azure Artifacts NuGet Credential Provider](https://github.com/microsoft/artifacts-credprovider#installation-on-windows) to run interactive authentication.
4. Ensure that version of the package is in the proper feeds by running `npm run updateRoslynVersion`. Note: you may need to install the [Azure Artifacts NuGet Credential Provider](https://github.com/microsoft/artifacts-credprovider#installation-on-windows) to run interactive authentication.
5. Build and test the change. If everything looks good, submit a PR.

## Updating the `Roslyn` Copilot Language Server version
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines/build-vsix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,17 @@ stages:
- pwsh: |
Write-Host "Building VSIXs for channel $(channel)"
if ("$(channel)" -eq "Release") {
gulp vsix:release:package
npm run vsix:release:package
} else {
gulp vsix:release:package --prerelease
npm run vsix:release:package -- --prerelease
}
displayName: 'Build VSIXs'
env:
SignType: $(signType)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)

- ${{ if eq(parameters.isOfficial, true) }}:
- script: gulp signVsix
- script: npm run signVsix
condition: succeeded()
displayName: 'Sign VSIXs'
env:
Expand All @@ -181,7 +181,7 @@ stages:
TargetFolder: '$(Build.SourcesDirectory)/Packages/VSIX_$(channel)'

- ${{ if eq(parameters.isOfficial, true) }}:
- script: gulp verifyVsix
- script: npm run verifyVsix
condition: and( succeeded(), eq('$(SignType)', 'Real'))
displayName: 🔑 Verify VSIX Signature Files
workingDirectory: '$(Build.SourcesDirectory)/Packages/VSIX_$(channel)'
Expand Down
3 changes: 1 addition & 2 deletions azure-pipelines/loc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ extends:
fetchDepth: 0
- pwsh: |
npm install
npm install -g gulp --globalconfig $(Build.SourcesDirectory)/.npmrc
displayName: 'Install tools'
- pwsh: npm run compile
displayName: 'Compile'
Expand All @@ -87,7 +86,7 @@ extends:
LclPackageId: 'LCL-JUNO-PROD-VSCODECS'
- pwsh: npm run l10nDevImportXlf
displayName: 'Import xlf to json.'
- pwsh: gulp 'publish localization content' --userName dotnet-bot --email dotnet-bot@dotnetfoundation.org --commitSha $(Build.SourceVersion) --targetRemoteRepo vscode-csharp --baseBranch 'main'
- pwsh: npm run publishLocalizationContent -- --userName dotnet-bot --email dotnet-bot@dotnetfoundation.org --commitSha $(Build.SourceVersion) --targetRemoteRepo vscode-csharp --baseBranch 'main'
displayName: 'Create PR in GitHub.'
env:
GitHubPAT: $(BotAccount-dotnet-bot-repo-PAT)
3 changes: 1 addition & 2 deletions azure-pipelines/prereqs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ steps:
inputs:
useGlobalJson: true
workingDirectory: $(Build.SourcesDirectory)/msbuild


- script: dotnet --info
displayName: Display dotnet info
Expand All @@ -40,5 +40,4 @@ steps:

- script: |
npm ci
npm i -g gulp
displayName: 'Install dependencies'
5 changes: 2 additions & 3 deletions azure-pipelines/publish-roslyn-copilot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,11 @@ extends:
storage: "$(AzStorage)"
ContainerName: "$(AzContainerName)"

- pwsh: |
- pwsh: |
npm install
npm install -g gulp
displayName: 'Install tools'

- pwsh: gulp 'publish roslyn copilot' --userName dotnet-maestro-bot --email dotnet-maestro-bot@microsoft.com --stagingDirectory '$(Build.ArtifactStagingDirectory)/staging'
- pwsh: npm run publishRoslynCopilot -- --userName dotnet-maestro-bot --email dotnet-maestro-bot@microsoft.com --stagingDirectory '$(Build.ArtifactStagingDirectory)/staging'
displayName: 'Create component update PR'
env:
GitHubPAT: $(BotAccount-dotnet-maestro-bot-PAT)
6 changes: 2 additions & 4 deletions azure-pipelines/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ extends:
- pwsh: |
$artifactVersion = '$(resources.pipeline.officialBuildCI.runName)'
$artifactBranchName = '$(resources.pipeline.officialBuildCI.sourceBranch)' -replace 'refs/heads/',''

# Set the BuildNumber in the form `# Publish prerelease v2.69.22 #` to improve readability in AzDO
$buildNumberName = "Publish $artifactBranchName $artifactVersion"
if ('${{ parameters.test }}' -eq 'true') {
Expand Down Expand Up @@ -164,12 +164,10 @@ extends:
- pwsh: |
npm ci
npm install
npm install -g gulp
gulp installDependencies
displayName: 'Install dependencies.'
- pwsh: |
# build number is generated by nerdbank git versioning and set to AzureDev
gulp createTags --releaseVersion $(resources.pipeline.officialBuildCI.runName) --releaseCommit $(resources.pipeline.officialBuildCI.sourceCommit) --dryRun ${{ parameters.test }} --prerelease $(isPrerelease)
npm run createTags -- --releaseVersion $(resources.pipeline.officialBuildCI.runName) --releaseCommit $(resources.pipeline.officialBuildCI.sourceCommit) --dryRun ${{ parameters.test }} --prerelease $(isPrerelease)
env:
GitHubPAT: $(BotAccount-dotnet-bot-content-rw-grained-pat)
displayName: 'Create release tags'
4 changes: 0 additions & 4 deletions azure-pipelines/test-prereqs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
steps:

# We need to download the roslyn language server for the current platform to run integration tests against it.
- script: gulp installDependencies
displayName: 'Install Roslyn Language Server'

- script: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
displayName: 'Activate screen emulation'
condition: eq(variables['Agent.OS'], 'Linux')
Loading
Loading