Skip to content

Commit 773457a

Browse files
authored
Merge branch 'main' into merge/release-to-main
2 parents 6868c3c + c1ae63c commit 773457a

File tree

456 files changed

+4585
-1616
lines changed

Some content is hidden

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

456 files changed

+4585
-1616
lines changed

.config/guardian/.gdnbaselines

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
{
2+
"hydrated": true,
23
"properties": {
3-
"helpUri": "https://eng.ms/docs/microsoft-security/security/azure-security/cloudai-security-fundamentals-engineering/security-integration/guardian-wiki/microsoft-guardian/general/baselines"
4+
"helpUri": "https://eng.ms/docs/microsoft-security/security/azure-security/cloudai-security-fundamentals-engineering/security-integration/guardian-wiki/microsoft-guardian/general/baselines",
5+
"hydrationStatus": "This file contains identifying data. It is **NOT** safe to check into your repo. To dehydrate this file, run `guardian dehydrate --help` and follow the guidance."
46
},
57
"version": "1.0.0",
68
"baselines": {
79
"default": {
810
"name": "default",
9-
"createdDate": "2024-03-18 18:32:58Z",
10-
"lastUpdatedDate": "2024-03-18 18:32:58Z"
11+
"createdDate": "2024-09-09 19:35:36Z",
12+
"lastUpdatedDate": "2024-09-09 19:35:36Z"
1113
}
1214
},
1315
"results": {
14-
"d6ffb0614846153cf3cc5936d0444ed9eda6fe6854febb4c8ea59243c120b223": {
15-
"signature": "d6ffb0614846153cf3cc5936d0444ed9eda6fe6854febb4c8ea59243c120b223",
16+
"26445e3e484940d2d58c2ffc32ab3895fca4b1589d66e2f2dee2fa01f2c479fb": {
17+
"signature": "26445e3e484940d2d58c2ffc32ab3895fca4b1589d66e2f2dee2fa01f2c479fb",
1618
"alternativeSignatures": [],
17-
"target": "omnisharptest/omnisharpUnitTests/testAssets/private.pem",
19+
"target": "test/omnisharp/omnisharpUnitTests/testAssets/private.pem",
1820
"line": 1,
1921
"memberOf": [
2022
"default"
2123
],
2224
"tool": "credscan",
2325
"ruleId": "CSCAN-GENERAL0020",
24-
"createdDate": "2024-06-27 21:30:23Z",
25-
"expirationDate": "2024-12-14 21:44:58Z",
26-
"justification": "This error is baselined with an expiration date of 180 days from 2024-06-27 21:44:58Z"
26+
"createdDate": "2024-09-09 19:35:36Z"
2727
}
2828
}
29-
}
29+
}

.devcontainer/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/dotnet/.devcontainer/base.Dockerfile
2+
3+
FROM mcr.microsoft.com/dotnet/sdk:8.0
4+
5+
# Set up machine requirements to build the repo
6+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
7+
&& apt-get -y install --no-install-recommends curl git gnupg \
8+
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
9+
&& apt-get install -y nodejs

.devcontainer/devcontainer.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/dotnetcore
3+
{
4+
"name": "vscode-csharp",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
// Set the context to the workspace folder to allow us to copy files from it.
8+
"context": ".."
9+
},
10+
"customizations": {
11+
"vscode": {
12+
"settings": {
13+
"files.associations": {
14+
"*.csproj": "msbuild",
15+
"*.fsproj": "msbuild",
16+
"*.globalconfig": "ini",
17+
"*.manifest": "xml",
18+
"*.nuspec": "xml",
19+
"*.pkgdef": "ini",
20+
"*.projitems": "msbuild",
21+
"*.props": "msbuild",
22+
"*.resx": "xml",
23+
"*.rsp": "Powershell",
24+
"*.ruleset": "xml",
25+
"*.settings": "xml",
26+
"*.shproj": "msbuild",
27+
"*.slnf": "json",
28+
"*.targets": "msbuild",
29+
"*.vbproj": "msbuild",
30+
"*.vsixmanifest": "xml",
31+
"*.vstemplate": "xml",
32+
"*.xlf": "xml",
33+
"*.yml": "azure-pipelines"
34+
},
35+
// ms-vscode.powershell settings
36+
"powershell.promptToUpdatePowerShell": false,
37+
"powershell.integratedConsole.showOnStartup": false,
38+
"powershell.startAutomatically": false,
39+
// ms-azure-devops.azure-pipelines settings
40+
"azure-pipelines.customSchemaFile": ".vscode/dnceng-schema.json"
41+
},
42+
"extensions": [
43+
"ms-dotnettools.csharp",
44+
"ms-dotnettools.csdevkit",
45+
"EditorConfig.EditorConfig",
46+
"ms-vscode.powershell",
47+
"tintoy.msbuild-project-tools",
48+
"ms-azure-devops.azure-pipelines",
49+
"dbaeumer.vscode-eslint",
50+
"esbenp.prettier-vscode",
51+
"orta.vscode-jest"
52+
]
53+
}
54+
},
55+
"postCreateCommand": "npm ci && npx gulp installDependencies"
56+
}

.devcontainer/devinit.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"run": [
3+
{
4+
"tool": "require-dotnetcoresdk"
5+
}
6+
]
7+
}

.vscode/dneng-schema.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

.vscode/launch.json

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
"request": "launch",
1818
"runtimeExecutable": "${execPath}",
1919
"args": [
20-
// Create a temp profile that has no extensions / user settings.
21-
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
22-
"--profile-temp",
23-
"${workspaceRoot}/test/integrationTests/testAssets/slnWithCsproj/.vscode/lsp_tools_host_slnWithCsproj.code-workspace",
20+
// Launch VSCode using a specific profile to ensure that user settings are not used.
21+
// This profile must be imported into vscode before running this launch configuration.
22+
// The profile can be found under /test/csharp-standalone-profile.
23+
"--profile",
24+
"csharp-standalone-profile",
25+
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/lsp_tools_host_slnWithCsproj.code-workspace",
2426
"--extensionDevelopmentPath=${workspaceRoot}",
25-
"--extensionTestsPath=${workspaceRoot}/out/test/integrationTests"
27+
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests"
2628
],
2729
"env": {
2830
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
@@ -40,12 +42,14 @@
4042
"request": "launch",
4143
"runtimeExecutable": "${execPath}",
4244
"args": [
43-
// Create a temp profile that has no extensions / user settings.
44-
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
45-
"--profile-temp",
46-
"${workspaceRoot}/test/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/lsp_tools_host_BasicRazorApp2_1.code-workspace",
45+
// Launch VSCode using a specific profile to ensure that user settings are not used.
46+
// This profile must be imported into vscode before running this launch configuration.
47+
// The profile can be found under /test/csharp-standalone-profile.
48+
"--profile",
49+
"csharp-standalone-profile",
50+
"${workspaceRoot}/test/razor/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/lsp_tools_host_BasicRazorApp2_1.code-workspace",
4751
"--extensionDevelopmentPath=${workspaceRoot}",
48-
"--extensionTestsPath=${workspaceRoot}/out/test/razorIntegrationTests"
52+
"--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests"
4953
],
5054
"env": {
5155
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
@@ -63,12 +67,14 @@
6367
"request": "launch",
6468
"runtimeExecutable": "${execPath}",
6569
"args": [
66-
// Create a temp profile that has no extensions / user settings.
67-
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
68-
"--profile-temp",
69-
"${workspaceRoot}/omnisharptest/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_${input:omnisharpAssetName}.code-workspace",
70+
// Launch VSCode using a specific profile to ensure that user settings are not used.
71+
// This profile must be imported into vscode before running this launch configuration.
72+
// The profile can be found under /test/csharp-standalone-profile.
73+
"--profile",
74+
"csharp-standalone-profile",
75+
"${workspaceRoot}/test/omnisharp/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_${input:omnisharpAssetName}.code-workspace",
7076
"--extensionDevelopmentPath=${workspaceRoot}",
71-
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests"
77+
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests"
7278
],
7379
"env": {
7480
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
@@ -86,12 +92,14 @@
8692
"request": "launch",
8793
"runtimeExecutable": "${execPath}",
8894
"args": [
89-
// Create a temp profile that has no extensions / user settings.
90-
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
91-
"--profile-temp",
92-
"${workspaceRoot}/omnisharptest/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_lsp_${input:omnisharpAssetName}.code-workspace",
95+
// Launch VSCode using a specific profile to ensure that user settings are not used.
96+
// This profile must be imported into vscode before running this launch configuration.
97+
// The profile can be found under /test/csharp-standalone-profile.
98+
"--profile",
99+
"csharp-standalone-profile",
100+
"${workspaceRoot}/test/omnisharp/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_lsp_${input:omnisharpAssetName}.code-workspace",
93101
"--extensionDevelopmentPath=${workspaceRoot}",
94-
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests"
102+
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests"
95103
],
96104
"env": {
97105
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",

.vscodeignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ server/**
1818
src/**
1919
tasks/**
2020
test/**
21-
omnisharptest/**
2221
__mocks__/**
2322
jest.config.ts
2423
baseJestConfig.ts

CHANGELOG.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,41 @@
44
- Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876)
55

66
# Latest
7+
* Bump xamltools to 17.12.35311.18 (PR: [#7549](https://github.com/dotnet/vscode-csharp/pull/7549))
8+
* XAML color swatches
9+
10+
# 2.47.x
11+
* Update Roslyn to 4.12.0-3.24456.2 (PR: [#7525](https://github.com/dotnet/vscode-csharp/pull/7525))
12+
* Avoid BuildHost crash in Mono due to missing types (PR: [#74994](https://github.com/dotnet/roslyn/pull/74994))
13+
* Turn off word suggestions in XAML completions (PR: [#7516](https://github.com/dotnet/vscode-csharp/pull/7516))
14+
* Bump xamltools to 17.12.35305.252 (PR: [#7521](https://github.com/dotnet/vscode-csharp/pull/7521))
15+
* XAML editor enabled various lightbulbs related to x:DataType, BindingContext and Bindings.
16+
17+
# 2.46.x
18+
* Update Roslyn to 4.12.0-3.24430.2 (PR: [#7496](https://github.com/dotnet/vscode-csharp/pull/7496))
19+
* Bump Razor to 9.0.0-preview.24427.2 (PR: [#7471](https://github.com/dotnet/vscode-csharp/pull/7471))
20+
* Suppress unique ids (#10791) (PR: [#10791](https://github.com/dotnet/razor/pull/10791))
21+
* Self-versioned documents (#10747) (PR: [#10747](https://github.com/dotnet/razor/pull/10747))
22+
* Remove ItemCollection from CodeRenderingContext (#10764) (PR: [#10764](https://github.com/dotnet/razor/pull/10764))
23+
* Moving formatting service to common layer (#10761) (PR: [#10761](https://github.com/dotnet/razor/pull/10761))
24+
* Allow LSP and cohosting to provide specialized methods to get a syntax tree (#10765) (PR: [#10765](https://github.com/dotnet/razor/pull/10765))
25+
* Update NOTICE.txt (#10768) (PR: [#10768](https://github.com/dotnet/razor/pull/10768))
26+
* Allow @@ as a fallback (#10752) (PR: [#10752](https://github.com/dotnet/razor/pull/10752))
27+
* Support component rename from an end tag (#10762) (PR: [#10762](https://github.com/dotnet/razor/pull/10762))
28+
* Bump xamltools to 17.12.35230.10 (PR: [#7493](https://github.com/dotnet/vscode-csharp/pull/7493))
29+
30+
# 2.45.25
731
* Bump Roslyn to 4.12.0-2.24461.7 (PR: [#7544](https://github.com/dotnet/vscode-csharp/pull/7544))
832
* Fix crash when closing source link documents (PR: [#75047](https://github.com/dotnet/roslyn/pull/75047))
933
* Add option to disable source link (PR: [#75047](https://github.com/dotnet/roslyn/pull/75047))
1034
* Fix issue navigating from source link documents (PR: [#75033](https://github.com/dotnet/roslyn/pull/75033))
1135
* Fix exception applying fix all code action (PR: [#7537](https://github.com/dotnet/vscode-csharp/pull/7537))
1236

13-
# 2.45.20
37+
# 2.45.17
1438
* Fix check for rzls being present (PR: [#7462](https://github.com/dotnet/vscode-csharp/pull/7462))
1539
* Bump Razor to 9.0.0-preview.24418.1 (PR: [#7456](https://github.com/dotnet/vscode-csharp/pull/7456))
1640
* Don't add already known documents to the misc files project (#10753) (PR: [#10753](https://github.com/dotnet/razor/pull/10753))
1741
* Remove ItemCollection from TagHelperDescriptorProviderContext (#10720) (PR: [#10720](https://github.com/dotnet/razor/pull/10720))
18-
* Cohost inlay hint support (#10672) (PR: [#10672](https://github.com/dotnet/razor/pull/10672))
1942
* Fix excerpt service to allow for multi line verbatim strings (#10675) (PR: [#10675](https://github.com/dotnet/razor/pull/10675))
2043
* Fix attribute parsing recovery (#10620) (PR: [#10620](https://github.com/dotnet/razor/pull/10620))
2144
* Turn off trailing whitespace triming in strings (#10646) (PR: [#10646](https://github.com/dotnet/razor/pull/10646))
@@ -32,7 +55,7 @@
3255
* Added XAML Hot Reload support for x:FactoryMethod and x:Arguments
3356
* Bump xamltools to 17.12.35304.30 (PR: [#7507](https://github.com/dotnet/vscode-csharp/pull/7508))
3457

35-
# 2.44.x
58+
# 2.44.19
3659
* Bump Roslyn to 4.12.0-2.24416.3 (PR: [#7448](https://github.com/dotnet/vscode-csharp/pull/7448))
3760
* Use EnableCodeStyleSeverity instead of AnalysisLevel to control new diagnostic severity behavior (PR: [#73843](https://github.com/dotnet/roslyn/pull/73843))
3861
* Cleanup LSP error reporting (PR: [#74530](https://github.com/dotnet/roslyn/pull/74530))
@@ -59,7 +82,7 @@
5982
* Task 2187810: [VS Code] Add OnEnter rules to indent tags (PR: [#7426](https://github.com/dotnet/vscode-csharp/pull/7426))
6083
* Fix completion handler bug that causes language server to crash (#7401) (PR: [#7406](https://github.com/dotnet/vscode-csharp/pull/7406))
6184

62-
# 2.41.x
85+
# 2.41.26
6386
* Bump Roslyn to 4.12.0-1.24376.3 (PR: [#7393](https://github.com/dotnet/vscode-csharp/pull/7393))
6487
* Fix race condition in LSP FindAllReferences when linked files were involved.(PR: [#74566](https://github.com/dotnet/roslyn/pull/74566))
6588
* Fix dll load issue when loading Razor projects in VSCode (PR: [#74570](https://github.com/dotnet/roslyn/pull/74570))
@@ -86,7 +109,7 @@
86109
* `dotnet.implementType.insertionBehavior` to `dotnet.typeMembers.memberInsertionLocation`
87110
* `dotnet.implementType.propertyGenerationBehavior` to `dotnet.typeMembers.propertyGenerationBehavior`
88111

89-
# 2.39.x
112+
# 2.39.29
90113
* Add language status bar item displaying project context for open files (PR: [#7321](https://github.com/dotnet/vscode-csharp/pull/7321), PR: [#7333](https://github.com/dotnet/vscode-csharp/pull/7333))
91114
* Add language status bar item for workspace status (C# standalone) (PR: [#7254](https://github.com/dotnet/vscode-csharp/pull/7254), PR: [#7329])https://github.com/dotnet/vscode-csharp/pull/7329))
92115
* Update Razor to 9.0.0-preview.24365.1 (PR: [#7354](https://github.com/dotnet/vscode-csharp/pull/7354))

CONTRIBUTING.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Setting up your local development environment for the vscode-csharp repository i
2222

2323
Before you start, make sure you have the following software installed on your machine:
2424

25-
* Node.js v18 ([v18.17.0 LTS](https://nodejs.org/en/blog/release/v18.17.0)).
25+
* Node.js v20 ([v20.17.0 LTS](https://nodejs.org/en/blog/release/v20.17.0)).
2626
* Note - Building with higher major versions of Node.js is not advised - it may work but we do not test it.
2727
* Npm (The version shipped with node is fine)
2828
* .NET 8.0 SDK (dotnet should be on your path)
@@ -36,9 +36,10 @@ Follow these steps to build, run, and test the repository:
3636
#### Building
3737

3838
1. Run `npm i` - This command installs the project dependencies.
39-
2. Run `npm i -g gulp` - This command installs Gulp globally.
40-
3. Run `gulp installDependencies` - This command downloads the various dependencies as specified by the version in the [package.json](package.json) file.
41-
4. Run `code .` - This command opens the project in Visual Studio Code.
39+
2. Run `vsts-npm-auth -config .npmrc` - This command will configure your credentials for the next command.
40+
3. Run `npm i -g gulp` - This command installs Gulp globally.
41+
4. Run `gulp installDependencies` - This command downloads the various dependencies as specified by the version in the [package.json](package.json) file.
42+
5. Run `code .` - This command opens the project in Visual Studio Code.
4243

4344
#### Running
4445

@@ -50,12 +51,16 @@ After completing the build steps:
5051

5152
#### Testing
5253

53-
To run tests:
54+
To run all tests, execute `npm run test`.
5455

55-
1. Execute `npm run test` or press <kbd>F5</kbd> in VS Code with the "Launch Tests" debug configuration selected.
56-
2. For integration tests, select either of the two 'current file' integration tests (one for roslyn and one for razor), from the drop-down and press <kbd>F5</kbd> to start debugging:
57-
- For Roslyn Server: `Launch Current File slnWithCsproj Integration Tests`
58-
- For Razor Server: `Launch Current File BasicRazorApp2_1 Integration Tests`
56+
To debug unit tests locally, press <kbd>F5</kbd> in VS Code with the "Launch Tests" debug configuration selected.
57+
58+
To debug integration tests
59+
1. Import the `csharp-standalone-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.
60+
2. Open any integration test file and <kbd>F5</kbd> launch with the correct launch configuration selected.
61+
- For integration tests inside `test/lsptoolshost`, use `Launch Current File slnWithCsproj Integration Tests`
62+
- For integration tests inside `test/razor`, use `Launch Current File BasicRazorApp2_1 Integration Tests`
63+
- For integration tests inside `test/omnisharp`, use one of the `Omnisharp:` current file profiles
5964

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

@@ -141,6 +146,11 @@ Or, in VSCode settings (`Ctrl+,`):
141146
3. Enable `razor.languageServer.debug`.
142147
4. Set `razor.server.trace` to `Debug`. This gives you more detailed log messages in the output window.
143148

149+
### Updating NPM packages
150+
We use the .NET eng AzDo artifacts feed https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet-public-npm/npm/registry/ with upstreams to the public npm registry.
151+
Auth is required in order to pull new packages from the upstream. This can be done by running `vsts-npm-auth -config .npmrc`.
152+
If you need to renew authorization, you can force it via `vsts-npm-auth -config .npmrc -F`
153+
144154
## Creating VSIX Packages for the Extension
145155

146156
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.

__mocks__/vscode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as vscodeAdapter from '../src/vscodeAdapter';
7-
import { getFakeVsCode } from '../test/unitTests/fakes';
7+
import { getFakeVsCode } from '../test/fakes';
88

99
// This module creates a manual mock for the vscode module for running in unit tests.
1010
// Jest will automatically pick this up as it is in the __mocks__ directory next to node_modules.

0 commit comments

Comments
 (0)