Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8533bdd
Miscellaneous activation improvements
dibarbet Feb 20, 2025
2bfdeec
Use esbuild over webpack
dibarbet Feb 21, 2025
cc6f71f
scope to window
dibarbet Feb 21, 2025
ffb0ffa
Merge remote-tracking branch 'upstream/main' into activation_perf
dibarbet Feb 21, 2025
baae72a
respond to main changes for bundling
dibarbet Feb 21, 2025
ab4ad7a
remove unnecessary uuid import
dibarbet Feb 21, 2025
c405b31
Update main version
dibarbet Feb 22, 2025
a4aa2a3
Copy CPU profiles generated in tests to logs folder for upload
dibarbet Feb 21, 2025
7512cff
update log section in issue template
dibarbet Feb 22, 2025
f0ccfaf
Update main version (#8005)
dibarbet Feb 22, 2025
5de9ab9
update log section in issue template (#8008)
JoeRobich Feb 22, 2025
26d9a55
[automated] Merge branch 'prerelease' => 'main' (#8009)
JoeRobich Feb 22, 2025
ca3ca3b
Localization result of 26d9a55bed777e813f0a8cc6e5a40710d0cd05bf.
dotnet-bot Feb 23, 2025
0a8f225
Localization result based on 26d9a55bed777e813f0a8cc6e5a40710d0cd05bf…
JoeRobich Feb 24, 2025
335c1da
Localization result of 0a8f22553099c18081ddbe00e7e402bc313d4500.
dotnet-bot Feb 24, 2025
1323226
[automated] Merge branch 'prerelease' => 'main' (#8011)
JoeRobich Feb 24, 2025
14ec636
Localization result based on 0a8f22553099c18081ddbe00e7e402bc313d4500…
JoeRobich Feb 24, 2025
772e41b
Activation perf (#8000)
dibarbet Feb 24, 2025
90c6d4d
Cleanup activation to remove dead code and improve readability
dibarbet Feb 24, 2025
eabd8a0
Always set fuse
Feb 25, 2025
5a5d5c7
Add backport bot to vscode-csharp
dibarbet Feb 25, 2025
462bb61
Always set fuse (#8020)
Feb 25, 2025
09ded44
Add backport bot to vscode-csharp (#8021)
dibarbet Feb 25, 2025
fbd088b
Copy CPU profiles generated in tests to logs folder for upload (#8002)
dibarbet Feb 25, 2025
c653042
Cleanup activation code to remove dead code and improve readability (…
dibarbet Feb 25, 2025
e2924a7
[automated] Merge branch 'prerelease' => 'main' (#8024)
dibarbet Feb 26, 2025
d64a301
Bump Razor to 9.0.0-preview.25125.9
davidwengier Feb 27, 2025
420c931
Update changelog
davidwengier Feb 27, 2025
9229324
Only publish cpuprofile logs for integration tests.
JoeRobich Feb 27, 2025
b8c7141
Make integration test logging conditional as well
JoeRobich Feb 27, 2025
5dca2eb
Use parameter
JoeRobich Feb 27, 2025
300295a
yml
JoeRobich Feb 27, 2025
64aab65
Try compile time expression
JoeRobich Feb 27, 2025
8b69c08
Try using the matrix
JoeRobich Feb 27, 2025
b4a00d6
Don't pass a boolean
JoeRobich Feb 27, 2025
46a595c
Use condition
JoeRobich Feb 27, 2025
a4465f0
Use compile time expression
JoeRobich Feb 27, 2025
927c7d8
Use it as a variable
JoeRobich Feb 27, 2025
fe908b8
Add logging
JoeRobich Feb 27, 2025
c180e26
fix typo
JoeRobich Feb 27, 2025
fbcf538
Try again
JoeRobich Feb 27, 2025
d5d85fd
once more
JoeRobich Feb 27, 2025
d14046d
yml
JoeRobich Feb 27, 2025
5009027
Try conditions again but differently
JoeRobich Feb 27, 2025
d0f58a9
Fix new typo
JoeRobich Feb 27, 2025
3bb3993
take 3
JoeRobich Feb 27, 2025
deff1da
take 4
JoeRobich Feb 27, 2025
e35d7b5
Try different name
JoeRobich Feb 27, 2025
3bc238d
Cleanup
JoeRobich Feb 27, 2025
e64bf71
Only publish cpuprofile logs for integration tests. (#8028)
JoeRobich Feb 27, 2025
449b69f
Merge branch 'main' into BumpRazor
JoeRobich Feb 27, 2025
085c84b
Bump Razor to 9.0.0-preview.25125.9 (#8027)
dibarbet Feb 27, 2025
fa63af7
fix profiling yml
dibarbet Feb 28, 2025
8bacdc9
Bump xamltools
anchimna Feb 28, 2025
e73c69a
Update changleog
anchimna Feb 28, 2025
9ed41ff
Bump xamltools (#8032)
dibarbet Feb 28, 2025
63fd896
Fix profiling yml (#8031)
dibarbet Mar 3, 2025
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 .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ module.exports = {
"out/",
"dist/",
"wallaby.js",
"webpack.config.js",
".eslintrc.js",
"esbuild.js",
"**/*.d.ts"
],
};
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ If the `CSharp: Report an issue` command doesn't appear, make sure that you have
VS Code version:
C# Extension version:

## OmniSharp log
## C# logs
C# output window contents:

See [this page](https://github.com/dotnet/vscode-csharp/blob/main/SUPPORT.md#collecting-general-logs) for collecting more detailed logs

## Steps to reproduce

Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Backport PR to branch
on:
issue_comment:
types: [created]
schedule:
# once a day at 13:00 UTC to cleanup old runs
- cron: '0 13 * * *'

permissions:
contents: write
issues: write
pull-requests: write
actions: write

jobs:
backport:
if: ${{ contains(github.event.comment.body, '/backport to') || github.event_name == 'schedule' }}
uses: dotnet/arcade/.github/workflows/backport-base.yml@main
with:
pr_description_template: |
Backport of #%source_pr_number% to %target_branch%

/cc %cc_users%

## Customer Impact

## Regression

- [ ] Yes
- [ ] No

[If yes, specify when the regression was introduced. Provide the PR or commit if known.]

## Testing

[How was the fix verified? How was the issue missed previously? What tests were added?]

## Risk

[High/Medium/Low. Justify the indication by mentioning how risks were measured and addressed.]
14 changes: 7 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js"],
"preLaunchTask": "buildDev"
"preLaunchTask": "packageDev"
},
{
"name": "[Roslyn] Run Current File Integration Tests",
Expand All @@ -35,7 +35,7 @@
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js", "${workspaceRoot}/out/test/**/*.js"],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"preLaunchTask": "buildDev",
"preLaunchTask": "packageDev",
"internalConsoleOptions": "openOnSessionStart"
},
{
Expand All @@ -62,7 +62,7 @@
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js", "${workspaceRoot}/out/test/**/*.js"],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"preLaunchTask": "buildDev",
"preLaunchTask": "packageDev",
"internalConsoleOptions": "openOnSessionStart"
},
{
Expand All @@ -89,7 +89,7 @@
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js", "${workspaceRoot}/out/test/**/*.js"],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"preLaunchTask": "buildTest",
"preLaunchTask": "packageDev",
"internalConsoleOptions": "openOnSessionStart"
},
{
Expand All @@ -115,7 +115,7 @@
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js", "${workspaceRoot}/out/test/**/*.js"],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"preLaunchTask": "buildTest"
"preLaunchTask": "packageDev"
},
{
"name": "[O# LSP] Run Current File Integration Tests",
Expand All @@ -140,7 +140,7 @@
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js", "${workspaceRoot}/out/test/**/*.js"],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"preLaunchTask": "buildTest"
"preLaunchTask": "packageDev"
},
{
"type": "node",
Expand Down Expand Up @@ -195,7 +195,7 @@
"name": "Razor integration tests",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"args": ["test:razorintegration"],
"args": ["test:integration:razor"],
"cwd": "${workspaceFolder}"
}
],
Expand Down
14 changes: 12 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,20 @@
}
},
{
"label": "buildTest",
"label": "package",
"command": "npm",
"type": "shell",
"args": ["run", "compileTest"],
"args": ["run", "package"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "packageDev",
"command": "npm",
"type": "shell",
"args": ["run", "packageDev"],
"group": {
"kind": "build",
"isDefault": true
Expand Down
4 changes: 2 additions & 2 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
!.razoromnisharp/**
.rpt2_cache/**
.config/**
.devcontainer/**
.github/**
.vscode/**
.vscode-test/**
Expand Down Expand Up @@ -51,8 +52,7 @@ package.json
tsconfig.json
version.json
wallaby.js
webpack.config.js

esbuild.js
!src/razor/language-configuration.json
!src/razor/syntaxes/*

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
- 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.68.x
* Update Razor to 9.0.0-preview.25125.9 (PR: [#8027](https://github.com/dotnet/vscode-csharp/pull/8027))
* Don't send invalid ranges for diagnostics if they do not map (#11555) (PR: [#11555](https://github.com/dotnet/razor/pull/11555))
* Fix file path service, and integration tests (#11556) (PR: [#11556](https://github.com/dotnet/razor/pull/11556))
* Add ParserOptions and CodeGenerationOptions properties to RazorCodeDocument and rationalize options configuration (#11526) (PR: [#11526](https://github.com/dotnet/razor/pull/11526))
* Fix parsing of quotes in attribute names (#11543) (PR: [#11543](https://github.com/dotnet/razor/pull/11543))
* Bump xamlTools to 17.14.35828.13 (PR: [#8032](https://github.com/dotnet/vscode-csharp/pull/8032))

# 2.67.x
* Bump xamlTools to 17.14.35821.62 (PR: [#8001](https://github.com/dotnet/vscode-csharp/pull/8001))
* Update Roslyn to 4.14.0-2.25120.5 (PR: [#7984](https://github.com/dotnet/vscode-csharp/pull/7984))
Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Follow these steps to build, run, and test the repository:
#### Building

1. Run `npm install -g vsts-npm-auth`, then run `vsts-npm-auth -config .npmrc` - This command will configure your credentials for the next command.
a. If you have already authenticated before, but the token expired, you may need to run `vsts-npm-auth -config .npmrc -f` instead.
2. Run `npm i` - This command installs the project dependencies.
3. Run `npm i -g gulp` - This command installs Gulp globally.
4. Run `gulp installDependencies` - This command downloads the various dependencies as specified by the version in the [package.json](package.json) file.
Expand All @@ -51,7 +52,8 @@ After completing the build steps:

#### Testing

To run all tests, execute `npm run test`.
To run all unit tests, execute `npm run test:unit`.
To run all integration tests execute `npm run test:integration`

To debug unit tests locally, press <kbd>F5</kbd> in VS Code with the "Launch Tests" debug configuration selected.

Expand Down
3 changes: 0 additions & 3 deletions azure-pipelines/prereqs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,3 @@ steps:
npm ci
npm i -g gulp
displayName: 'Install dependencies'

- script: npm run compile
displayName: 'Compile'
3 changes: 2 additions & 1 deletion azure-pipelines/profiling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ extends:
parameters:
dotnetVersion: $(defaultDotnetVersion)
npmCommand: profiling
testVSCodeVersion: stable
testVSCodeVersion: stable
isIntegration: true
17 changes: 13 additions & 4 deletions azure-pipelines/test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,26 @@ jobs:
- job:
strategy:
matrix:
CSharpTests:
npmCommand: test:withoutDevKit
UnitTests:
npmCommand: test:unit
isIntegration: false
CSharpIntegrationTests:
npmCommand: test:integration:csharp
isIntegration: true
DevKitTests:
npmCommand: test:integration:devkit
isIntegration: true
RazorTests:
npmCommand: test:integration:razor
isIntegration: true
pool: ${{ parameters.pool }}
${{ if parameters.containerName }}:
container: ${{ parameters.containerName }}
steps:
- template: /azure-pipelines/test.yml@self
parameters:
dotnetVersion: ${{ parameters.dotnetVersion }}
installAdditionalLinuxDependencies: true
installAdditionalLinuxDependencies: ${{ parameters.installAdditionalLinuxDependencies }}
npmCommand: $(npmCommand)
testVSCodeVersion: ${{ parameters.testVSCodeVersion }}
testVSCodeVersion: ${{ parameters.testVSCodeVersion }}
isIntegration: $(isIntegration)
3 changes: 0 additions & 3 deletions azure-pipelines/test-prereqs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
steps:

- script: npm run vscode:prepublish
displayName: 'Prepublish VSIXs'

# 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'
Expand Down
18 changes: 16 additions & 2 deletions azure-pipelines/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ parameters:
type: string
- name: testVSCodeVersion
type: string
- name: isIntegration
type: string

steps:
- checkout: self
Expand Down Expand Up @@ -44,16 +46,28 @@ steps:
mergeTestResults: true
testRunTitle: $(System.StageDisplayName) $(Agent.JobName) (Attempt $(System.JobAttempt))

- powershell: |
Write-Host "##vso[task.setvariable variable=isIntegrationVar;]${{ parameters.isIntegration }}"
displayName: 'Set IsIntegration Variable'
condition: succeededOrFailed()

- powershell: |
$tempPath = [System.IO.Path]::GetTempPath()
echo "Temp Path: $tempPath"
Get-ChildItem -Path $tempPath -Filter *.cpuprofile | Copy-Item -Destination "$(Build.SourcesDirectory)/out/logs"
displayName: 'Copy .cpuprofile files to out/logs'
condition: eq(variables.isIntegrationVar, true)

- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- task: 1ES.PublishPipelineArtifact@1
condition: failed()
condition: eq(variables.isIntegrationVar, true)
displayName: 'Upload integration test logs'
inputs:
path: '$(Build.SourcesDirectory)/out/logs'
artifact: 'Test Logs ($(System.StageDisplayName)-$(Agent.JobName)-$(System.JobAttempt))'
- ${{ else }}:
- task: PublishPipelineArtifact@1
condition: failed()
condition: eq(variables.isIntegrationVar, true)
displayName: 'Upload integration test logs'
inputs:
targetPath: '$(Build.SourcesDirectory)/out/logs'
Expand Down
76 changes: 76 additions & 0 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
const esbuild = require("esbuild");
const fs = require('fs/promises');

const production = process.argv.includes('--production');
const watch = process.argv.includes('--watch');

/**
* @type {import('esbuild').Plugin}
*/
const esbuildProblemMatcherPlugin = {
name: 'esbuild-problem-matcher',

setup(build) {
build.onStart(() => {
console.log('[watch] build started');
});
build.onEnd((result) => {
result.errors.forEach(({ text, location }) => {
console.error(`✘ [ERROR] ${text}`);
console.error(` ${location.file}:${location.line}:${location.column}:`);
});
console.log('[watch] build finished');
});
},
};

/**
* Some VSCode libraries include UMD versions that are not esbuild compatible, and also have broken ESM packages.
* This plugin replaces the UMD imports with the ESM imports.
* See https://github.com/microsoft/vscode/issues/192144
*/
const umdEsmLoaderPlugin = {
name: 'umdEsmLoaderPlugin',

setup(build) {
build.onLoad({ filter: /(vscode-html-languageservice|jsonc-parser).*lib[\/\\]umd/ }, async (moduleArgs) => {
// replace the umd path with the esm path from the package.
const newPath = moduleArgs.path.replace(/(.*)lib([\/\\])umd(.*)/, '$1lib$2esm$3');
const contents = await fs.readFile(newPath, 'utf8');
return { contents: contents };
});
},
};

async function main() {
const ctx = await esbuild.context({
entryPoints: [
'src/main.ts'
],
bundle: true,
format: 'cjs',
minify: production,
sourcemap: !production,
sourcesContent: false,
platform: 'node',
outfile: 'dist/extension.js',
external: ['vscode', 'applicationinsights-native-metrics', '@opentelemetry/tracing'],
logLevel: 'info',
plugins: [
umdEsmLoaderPlugin,
/* add to the end of plugins array */
esbuildProblemMatcherPlugin,
],
});
if (watch) {
await ctx.watch();
} else {
await ctx.rebuild();
await ctx.dispose();
}
}

main().catch(e => {
console.error(e);
process.exit(1);
});
6 changes: 3 additions & 3 deletions l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"How to setup Remote Debugging": "How to setup Remote Debugging",
"The C# extension for Visual Studio Code is incompatible on {0} {1} with the VS Code Remote Extensions. To see avaliable workarounds, click on '{2}'.": "The C# extension for Visual Studio Code is incompatible on {0} {1} with the VS Code Remote Extensions. To see avaliable workarounds, click on '{2}'.",
"The C# extension for Visual Studio Code is incompatible on {0} {1}.": "The C# extension for Visual Studio Code is incompatible on {0} {1}.",
"Update and reload": "Update and reload",
"The {0} extension requires at least {1} of the .NET Install Tool ({2}) extension. Please update to continue": "The {0} extension requires at least {1} of the .NET Install Tool ({2}) extension. Please update to continue",
"Version {0} of the .NET Install Tool ({1}) was not found, {2} will not activate.": "Version {0} of the .NET Install Tool ({1}) was not found, {2} will not activate.",
".NET Test Log": ".NET Test Log",
".NET NuGet Restore": ".NET NuGet Restore",
"How to setup Remote Debugging": "How to setup Remote Debugging",
"The C# extension for Visual Studio Code is incompatible on {0} {1} with the VS Code Remote Extensions. To see avaliable workarounds, click on '{2}'.": "The C# extension for Visual Studio Code is incompatible on {0} {1} with the VS Code Remote Extensions. To see avaliable workarounds, click on '{2}'.",
"The C# extension for Visual Studio Code is incompatible on {0} {1}.": "The C# extension for Visual Studio Code is incompatible on {0} {1}.",
"Cannot create .NET debug configurations. No workspace folder was selected.": "Cannot create .NET debug configurations. No workspace folder was selected.",
"Cannot create .NET debug configurations. The server is still initializing or has exited unexpectedly.": "Cannot create .NET debug configurations. The server is still initializing or has exited unexpectedly.",
"Cannot create .NET debug configurations. The active C# project is not within folder '{0}'.": "Cannot create .NET debug configurations. The active C# project is not within folder '{0}'.",
Expand Down
Loading
Loading