Skip to content

Commit 926acc1

Browse files
authored
Merge pull request #7586 from dotnet/merge/main-to-prerelease
[automated] Merge branch 'main' => 'prerelease'
2 parents 15cdec6 + fd8ac54 commit 926acc1

File tree

99 files changed

+1265
-1403
lines changed

Some content is hidden

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

99 files changed

+1265
-1403
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = {
2121
rules: {
2222
"@typescript-eslint/no-explicit-any": "off",
2323
"@typescript-eslint/no-non-null-assertion": "off",
24-
"@typescript-eslint/semi": ["error", "always"],
24+
"@typescript-eslint/no-require-imports": "off",
2525
// Allow unused vars if prefixed by _
2626
"@typescript-eslint/no-unused-vars": [
2727
"warn",

.vscode/launch.json

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"args": [
2020
// Launch VSCode using a specific profile to ensure that user settings are not used.
2121
// This profile must be imported into vscode before running this launch configuration.
22-
// The profile can be found under /test/csharp-standalone-profile.
22+
// The profile can be found under /test/csharp-test-profile.
2323
"--profile",
24-
"csharp-standalone-profile",
25-
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/lsp_tools_host_slnWithCsproj.code-workspace",
24+
"csharp-test-profile",
25+
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace",
2626
"--extensionDevelopmentPath=${workspaceRoot}",
2727
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests"
2828
],
@@ -36,6 +36,31 @@
3636
"preLaunchTask": "buildDev",
3737
"internalConsoleOptions": "openOnSessionStart"
3838
},
39+
{
40+
"name": "[DevKit] Launch Current File slnWithCsproj Integration Tests",
41+
"type": "extensionHost",
42+
"request": "launch",
43+
"runtimeExecutable": "${execPath}",
44+
"args": [
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-test-profile.
48+
"--profile",
49+
"csharp-test-profile",
50+
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace",
51+
"--extensionDevelopmentPath=${workspaceRoot}",
52+
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests"
53+
],
54+
"env": {
55+
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
56+
"TEST_FILE_FILTER": "${file}",
57+
},
58+
"sourceMaps": true,
59+
"outFiles": ["${workspaceRoot}/dist/*.js", "${workspaceRoot}/out/test/**/*.js"],
60+
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
61+
"preLaunchTask": "buildDev",
62+
"internalConsoleOptions": "openOnSessionStart"
63+
},
3964
{
4065
"name": "Launch Current File BasicRazorApp2_1 Integration Tests",
4166
"type": "extensionHost",
@@ -44,9 +69,9 @@
4469
"args": [
4570
// Launch VSCode using a specific profile to ensure that user settings are not used.
4671
// This profile must be imported into vscode before running this launch configuration.
47-
// The profile can be found under /test/csharp-standalone-profile.
72+
// The profile can be found under /test/csharp-test-profile.
4873
"--profile",
49-
"csharp-standalone-profile",
74+
"csharp-test-profile",
5075
"${workspaceRoot}/test/razor/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/lsp_tools_host_BasicRazorApp2_1.code-workspace",
5176
"--extensionDevelopmentPath=${workspaceRoot}",
5277
"--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests"
@@ -69,9 +94,9 @@
6994
"args": [
7095
// Launch VSCode using a specific profile to ensure that user settings are not used.
7196
// This profile must be imported into vscode before running this launch configuration.
72-
// The profile can be found under /test/csharp-standalone-profile.
97+
// The profile can be found under /test/csharp-test-profile.
7398
"--profile",
74-
"csharp-standalone-profile",
99+
"csharp-test-profile",
75100
"${workspaceRoot}/test/omnisharp/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_${input:omnisharpAssetName}.code-workspace",
76101
"--extensionDevelopmentPath=${workspaceRoot}",
77102
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests"
@@ -94,9 +119,9 @@
94119
"args": [
95120
// Launch VSCode using a specific profile to ensure that user settings are not used.
96121
// This profile must be imported into vscode before running this launch configuration.
97-
// The profile can be found under /test/csharp-standalone-profile.
122+
// The profile can be found under /test/csharp-test-profile.
98123
"--profile",
99-
"csharp-standalone-profile",
124+
"csharp-test-profile",
100125
"${workspaceRoot}/test/omnisharp/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_lsp_${input:omnisharpAssetName}.code-workspace",
101126
"--extensionDevelopmentPath=${workspaceRoot}",
102127
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests"

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
.vscode/**
1414
.vscode-test/**
1515
coverage/**
16+
docs/**
1617
out/**
1718
msbuild/**
1819
src/**

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@
33
- Diagnostics related feature requests and improvements [#5951](https://github.com/dotnet/vscode-csharp/issues/5951)
44
- Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876)
55

6-
# Latest
6+
# 2.50.x
7+
8+
# 2.49.x
9+
* Update Razor to 9.0.0-preview.24467.1
10+
* Fix LF line-ending auto format bug (PR: [#10802](https://github.com/dotnet/razor/pull/10802))
11+
* Bumped xamltools to 17.12.35319.159 (PR: [#7583](https://github.com/dotnet/vscode-csharp/pull/7583))
12+
* Bump xamlTools to 17.12.35318.29 (PR: [#7577](https://github.com/OmniSharp/omnisharp-vscode/pull/7577))
13+
* Register Copilot `relatedFilesProvider` for C# (PR: [#7578](https://github.com/OmniSharp/omnisharp-vscode/pull/7578))
14+
15+
# 2.48.x
716
* Add signing support to VSIX (PR: [#7490](https://github.com/dotnet/vscode-csharp/pull/7490))
817
* Update Debugger to v2.47.0 (PR: [#7547](https://github.com/dotnet/vscode-csharp/pull/7547))
918
* Adds in support for .NET 9 Break for Async User-Unhandled

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ To run all tests, execute `npm run test`.
5656
To debug unit tests locally, press <kbd>F5</kbd> in VS Code with the "Launch Tests" debug configuration selected.
5757

5858
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.
59+
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).
6060
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`
61+
- 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)
6262
- For integration tests inside `test/razor`, use `Launch Current File BasicRazorApp2_1 Integration Tests`
6363
- For integration tests inside `test/omnisharp`, use one of the `Omnisharp:` current file profiles
6464

SUPPORT.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,69 @@
11
# Support
22

3-
## How to file issues and get help
3+
## How to get help
44

55
This project uses GitHub Issues to track bugs and feature requests. Please search the [existing issues](https://github.com/dotnet/vscode-csharp/issues) before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new Issue.
66

7+
This repository tracks issues related to the C# extension. Any issues related to the C# editing experience, Roslyn language server and other basic C# functionality should be filed here (regardless of if you're using C# Dev Kit or not).
8+
9+
For C# Dev Kit only features such as the Solution Explorer, Test Window, etc, please see https://github.com/microsoft/vscode-dotnettools/blob/main/SUPPORT.md
10+
711
For help and questions about using this project, please see the [README](https://github.com/dotnet/vscode-csharp/blob/main/README.md).
812

13+
### How to file an issue
14+
15+
We highly recommend using the C# extension's built-in command, `CSharp: Report an issue` (`csharp.reportIssue`) to create a pre-filled issue template. This will include helpful details such as local dotnet installations, installed extensions, and other information.
16+
![csharp.reportIssue command](./docs/report_issue.png)
17+
18+
#### Collecting general logs
19+
20+
The template has a section to include the `C#` output window logs. These logs are not automatically included as they may contain personal information (such as full file paths and project names), but they are key to resolving problems.
21+
22+
1. First, set `dotnet.server.trace` to `Trace` in VSCode settings
23+
![settings window showing trace option](./docs/trace_logs.png)
24+
2. Reload the window via the `Developer: Reload Window` (`workbench.action.reloadWindow`) command
25+
3. Reproduce the issue
26+
4. Open the output window via `View` -> `Output` and change to the `C#` output window.
27+
5. Select all (e.g. cntrl+a) and copy paste into the issue template under the 'C# Log' section. If you need to redact file paths and other information, please do so at this time.
28+
6. Once the logs are collected, reset `dotnet.server.trace` back to `Information`
29+
30+
Oftentimes the C# logs are enough, but sometimes when dealing with LSP server issues, the LSP trace logs are required. These can be found by following the same steps as above, but using the `C# LSP Trace Logs` output window instead.
31+
32+
#### Project loading problems
33+
34+
A common cause of missing language features is a failure to load the project(s) or solution. There can be a number of reasons why this happens, and some additional information is generally necessary to figure out what is going wrong.
35+
36+
First, providing the information from the issue template and the general logs (see above section) is almost always necessary. After that there are a couple things to check:
37+
38+
1. Is the file found in the correct project by the language server? This information is displayed in the bottom right corner of the VSCode window in the language status section. This item can be pinned using the pin icon so that it is always displayed.
39+
40+
![language status bar opened showing file active project context](./docs/language_status.png)
41+
2. If using C# Dev Kit, check that the Solution Explorer displays the project with the expected references. If not as expected, please also provide the contents of the `Projects` output window in the issue.
42+
43+
#### Colorization problems
44+
45+
For issues related to classification (colorizing the document), please provide the following
46+
1. Which theme is currently being used
47+
2. A screenshot of the `Developer: Inspect Editor Tokens and Scopes` (`editor.action.inspectTMScopes`) command output on the incorrect word
48+
![inspect tokens and scopes output](./docs/inspect_tokens.png)
49+
50+
#### Diagnostics problems
51+
52+
For issues with diagnostics, please provide values of the background analysis scope options, `dotnet.backgroundAnalysis.analyzerDiagnosticsScope` and `dotnet.backgroundAnalysis.compilerDiagnosticsScope`
53+
![background analysis settings](./docs/background_analysis.png)
54+
55+
#### Language server crashing
56+
57+
As before, the general log collection is usually useful. However we're not always able to diagnose just from the logs. In that case a crash dump is useful. This can be collected by setting the `dotnet.server.crashDumpPath` VSCode setting to a user-writeable folder.
58+
![vscode setting for crash dump path](./docs/crash_dump.png)
59+
60+
When the server crashes, this should create a crash dump for it.
61+
62+
> [!WARNING]
63+
> The dump can contain detailed information on the project - generally we will provide an email so that it can be shared privately
64+
65+
66+
967
## Microsoft Support Policy
1068

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

azure-pipelines.yml

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -24,58 +24,55 @@ stages:
2424
isOfficial: false
2525
signType: test
2626

27-
- stage: Test_Linux_Stage
28-
displayName: Test Linux
27+
- stage:
28+
displayName: Test Linux (.NET 6)
2929
dependsOn: []
3030
jobs:
31-
- job: Test_Linux_Job
32-
displayName: Test Linux
33-
strategy:
34-
matrix:
35-
DotNet6:
36-
containerName: mcr.microsoft.com/dotnet/sdk:6.0
37-
DotNet7:
38-
containerName: mcr.microsoft.com/dotnet/sdk:7.0
39-
DotNet8:
40-
containerName: mcr.microsoft.com/dotnet/sdk:8.0
41-
pool:
42-
name: NetCore-Public
43-
demands: ImageOverride -equals 1es-ubuntu-2004-open
44-
container: $[ variables['containerName'] ]
45-
steps:
46-
- template: azure-pipelines/test.yml
47-
parameters:
48-
# Prefer the dotnet from the container.
49-
installDotNet: false
50-
installAdditionalLinuxDependencies: true
31+
- template: azure-pipelines/test-matrix.yml
32+
parameters:
33+
# Prefer the dotnet from the container.
34+
installDotNet: false
35+
installAdditionalLinuxDependencies: true
36+
pool:
37+
name: NetCore-Public
38+
demands: ImageOverride -equals 1es-ubuntu-2004-open
39+
containerName: mcr.microsoft.com/dotnet/sdk:6.0
40+
41+
- stage:
42+
displayName: Test Linux (.NET 8)
43+
dependsOn: []
44+
jobs:
45+
- template: azure-pipelines/test-matrix.yml
46+
parameters:
47+
# Prefer the dotnet from the container.
48+
installDotNet: false
49+
installAdditionalLinuxDependencies: true
50+
pool:
51+
name: NetCore-Public
52+
demands: ImageOverride -equals 1es-ubuntu-2004-open
53+
containerName: mcr.microsoft.com/dotnet/sdk:8.0
5154

5255
- stage: Test_Windows_Stage
5356
displayName: Test Windows
5457
dependsOn: []
5558
jobs:
56-
- job: Test_Windows_Job
57-
displayName: Test Windows
58-
pool:
59-
name: NetCore-Public
60-
demands: ImageOverride -equals 1es-windows-2022-open
61-
steps:
62-
- template: azure-pipelines/test.yml
63-
parameters:
64-
installDotNet: true
59+
- template: azure-pipelines/test-matrix.yml
60+
parameters:
61+
installDotNet: true
62+
pool:
63+
name: NetCore-Public
64+
demands: ImageOverride -equals 1es-windows-2022-open
6565

6666
- stage: Test_MacOS_Stage
6767
displayName: Test MacOS
6868
dependsOn: []
6969
jobs:
70-
- job: Test_MacOS_Job
71-
displayName: Test MacOS
72-
pool:
73-
name: Azure Pipelines
74-
vmImage: macOS-13
75-
steps:
76-
- template: azure-pipelines/test.yml
77-
parameters:
78-
installDotNet: true
70+
- template: azure-pipelines/test-matrix.yml
71+
parameters:
72+
installDotNet: true
73+
pool:
74+
name: Azure Pipelines
75+
vmImage: macOS-13
7976

8077
- stage: Test_OmniSharp
8178
displayName: Test OmniSharp

azure-pipelines/test-matrix.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
parameters:
2+
- name: pool
3+
type: object
4+
- name: containerName
5+
type: string
6+
default: ''
7+
- name: installDotNet
8+
type: boolean
9+
- name: installAdditionalLinuxDependencies
10+
type: boolean
11+
default: false
12+
13+
jobs:
14+
- job:
15+
strategy:
16+
matrix:
17+
CSharpTests:
18+
npmCommand: 'test:withoutDevKit'
19+
DevKitTests:
20+
npmCommand: test:integration:devkit
21+
pool: ${{ parameters.pool }}
22+
${{ if parameters.containerName }}:
23+
container: ${{ parameters.containerName }}
24+
steps:
25+
- template: /azure-pipelines/test.yml@self
26+
parameters:
27+
# Prefer the dotnet from the container.
28+
installDotNet: false
29+
installAdditionalLinuxDependencies: true
30+
npmCommand: $(npmCommand)

azure-pipelines/test.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ parameters:
44
- name: installAdditionalLinuxDependencies
55
type: boolean
66
default: false
7+
- name: npmCommand
8+
type: string
79

810
steps:
911
- checkout: self
@@ -23,8 +25,8 @@ steps:
2325
parameters:
2426
installAdditionalLinuxDependencies: ${{ parameters.installAdditionalLinuxDependencies }}
2527

26-
- script: npm run test
27-
displayName: 🧪 Run unit and integration tests
28+
- script: npm run ${{ parameters.npmCommand }}
29+
displayName: 🧪 Run $(Agent.JobName)
2830
env:
2931
DISPLAY: :99.0
3032

@@ -37,11 +39,11 @@ steps:
3739
searchFolder: '$(Build.SourcesDirectory)/out'
3840
publishRunAttachments: true
3941
mergeTestResults: true
40-
testRunTitle: $(Agent.JobName) (Attempt $(System.JobAttempt))
42+
testRunTitle: $(System.StageDisplayName) $(Agent.JobName) (Attempt $(System.JobAttempt))
4143

4244
- task: PublishPipelineArtifact@1
4345
condition: failed()
4446
displayName: 'Upload integration test logs'
4547
inputs:
46-
targetPath: '$(Build.SourcesDirectory)/.vscode-test/user-data/logs'
47-
artifactName: 'VSCode Test Logs ($(Agent.JobName)-$(System.JobAttempt))'
48+
targetPath: '$(Build.SourcesDirectory)/out/logs'
49+
artifactName: 'Test Logs ($(System.StageDisplayName)-$(Agent.JobName)-$(System.JobAttempt))'

docs/background_analysis.png

48.1 KB
Loading

0 commit comments

Comments
 (0)