Skip to content

Commit

Permalink
Merge pull request #7586 from dotnet/merge/main-to-prerelease
Browse files Browse the repository at this point in the history
[automated] Merge branch 'main' => 'prerelease'
  • Loading branch information
JoeRobich committed Sep 20, 2024
2 parents 15cdec6 + fd8ac54 commit 926acc1
Show file tree
Hide file tree
Showing 99 changed files with 1,265 additions and 1,403 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/no-require-imports": "off",
// Allow unused vars if prefixed by _
"@typescript-eslint/no-unused-vars": [
"warn",
Expand Down
43 changes: 34 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"args": [
// Launch VSCode using a specific profile to ensure that user settings are not used.
// This profile must be imported into vscode before running this launch configuration.
// The profile can be found under /test/csharp-standalone-profile.
// The profile can be found under /test/csharp-test-profile.
"--profile",
"csharp-standalone-profile",
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/lsp_tools_host_slnWithCsproj.code-workspace",
"csharp-test-profile",
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests"
],
Expand All @@ -36,6 +36,31 @@
"preLaunchTask": "buildDev",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "[DevKit] Launch Current File slnWithCsproj Integration Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
// Launch VSCode using a specific profile to ensure that user settings are not used.
// This profile must be imported into vscode before running this launch configuration.
// The profile can be found under /test/csharp-test-profile.
"--profile",
"csharp-test-profile",
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests"
],
"env": {
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
"TEST_FILE_FILTER": "${file}",
},
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/*.js", "${workspaceRoot}/out/test/**/*.js"],
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"preLaunchTask": "buildDev",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "Launch Current File BasicRazorApp2_1 Integration Tests",
"type": "extensionHost",
Expand All @@ -44,9 +69,9 @@
"args": [
// Launch VSCode using a specific profile to ensure that user settings are not used.
// This profile must be imported into vscode before running this launch configuration.
// The profile can be found under /test/csharp-standalone-profile.
// The profile can be found under /test/csharp-test-profile.
"--profile",
"csharp-standalone-profile",
"csharp-test-profile",
"${workspaceRoot}/test/razor/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/lsp_tools_host_BasicRazorApp2_1.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests"
Expand All @@ -69,9 +94,9 @@
"args": [
// Launch VSCode using a specific profile to ensure that user settings are not used.
// This profile must be imported into vscode before running this launch configuration.
// The profile can be found under /test/csharp-standalone-profile.
// The profile can be found under /test/csharp-test-profile.
"--profile",
"csharp-standalone-profile",
"csharp-test-profile",
"${workspaceRoot}/test/omnisharp/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_${input:omnisharpAssetName}.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests"
Expand All @@ -94,9 +119,9 @@
"args": [
// Launch VSCode using a specific profile to ensure that user settings are not used.
// This profile must be imported into vscode before running this launch configuration.
// The profile can be found under /test/csharp-standalone-profile.
// The profile can be found under /test/csharp-test-profile.
"--profile",
"csharp-standalone-profile",
"csharp-test-profile",
"${workspaceRoot}/test/omnisharp/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_lsp_${input:omnisharpAssetName}.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests"
Expand Down
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
.vscode/**
.vscode-test/**
coverage/**
docs/**
out/**
msbuild/**
src/**
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
- 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)

# Latest
# 2.50.x

# 2.49.x
* Update Razor to 9.0.0-preview.24467.1
* Fix LF line-ending auto format bug (PR: [#10802](https://github.com/dotnet/razor/pull/10802))
* Bumped xamltools to 17.12.35319.159 (PR: [#7583](https://github.com/dotnet/vscode-csharp/pull/7583))
* Bump xamlTools to 17.12.35318.29 (PR: [#7577](https://github.com/OmniSharp/omnisharp-vscode/pull/7577))
* Register Copilot `relatedFilesProvider` for C# (PR: [#7578](https://github.com/OmniSharp/omnisharp-vscode/pull/7578))

# 2.48.x
* Add signing support to VSIX (PR: [#7490](https://github.com/dotnet/vscode-csharp/pull/7490))
* Update Debugger to v2.47.0 (PR: [#7547](https://github.com/dotnet/vscode-csharp/pull/7547))
* Adds in support for .NET 9 Break for Async User-Unhandled
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ To run all tests, execute `npm run test`.
To debug unit tests locally, press <kbd>F5</kbd> in VS Code with the "Launch Tests" debug configuration selected.

To debug integration tests
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.
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).
2. Open any integration test file and <kbd>F5</kbd> launch with the correct launch configuration selected.
- For integration tests inside `test/lsptoolshost`, use `Launch Current File slnWithCsproj Integration Tests`
- 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)
- For integration tests inside `test/razor`, use `Launch Current File BasicRazorApp2_1 Integration Tests`
- For integration tests inside `test/omnisharp`, use one of the `Omnisharp:` current file profiles

Expand Down
60 changes: 59 additions & 1 deletion SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,69 @@
# Support

## How to file issues and get help
## How to get help

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.

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

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

For help and questions about using this project, please see the [README](https://github.com/dotnet/vscode-csharp/blob/main/README.md).

### How to file an issue

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.
![csharp.reportIssue command](./docs/report_issue.png)

#### Collecting general logs

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.

1. First, set `dotnet.server.trace` to `Trace` in VSCode settings
![settings window showing trace option](./docs/trace_logs.png)
2. Reload the window via the `Developer: Reload Window` (`workbench.action.reloadWindow`) command
3. Reproduce the issue
4. Open the output window via `View` -> `Output` and change to the `C#` output window.
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.
6. Once the logs are collected, reset `dotnet.server.trace` back to `Information`

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.

#### Project loading problems

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.

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:

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.

![language status bar opened showing file active project context](./docs/language_status.png)
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.

#### Colorization problems

For issues related to classification (colorizing the document), please provide the following
1. Which theme is currently being used
2. A screenshot of the `Developer: Inspect Editor Tokens and Scopes` (`editor.action.inspectTMScopes`) command output on the incorrect word
![inspect tokens and scopes output](./docs/inspect_tokens.png)

#### Diagnostics problems

For issues with diagnostics, please provide values of the background analysis scope options, `dotnet.backgroundAnalysis.analyzerDiagnosticsScope` and `dotnet.backgroundAnalysis.compilerDiagnosticsScope`
![background analysis settings](./docs/background_analysis.png)

#### Language server crashing

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.
![vscode setting for crash dump path](./docs/crash_dump.png)

When the server crashes, this should create a crash dump for it.

> [!WARNING]
> The dump can contain detailed information on the project - generally we will provide an email so that it can be shared privately


## Microsoft Support Policy

Support for this project is limited to the resources listed above.
77 changes: 37 additions & 40 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,58 +24,55 @@ stages:
isOfficial: false
signType: test

- stage: Test_Linux_Stage
displayName: Test Linux
- stage:
displayName: Test Linux (.NET 6)
dependsOn: []
jobs:
- job: Test_Linux_Job
displayName: Test Linux
strategy:
matrix:
DotNet6:
containerName: mcr.microsoft.com/dotnet/sdk:6.0
DotNet7:
containerName: mcr.microsoft.com/dotnet/sdk:7.0
DotNet8:
containerName: mcr.microsoft.com/dotnet/sdk:8.0
pool:
name: NetCore-Public
demands: ImageOverride -equals 1es-ubuntu-2004-open
container: $[ variables['containerName'] ]
steps:
- template: azure-pipelines/test.yml
parameters:
# Prefer the dotnet from the container.
installDotNet: false
installAdditionalLinuxDependencies: true
- template: azure-pipelines/test-matrix.yml
parameters:
# Prefer the dotnet from the container.
installDotNet: false
installAdditionalLinuxDependencies: true
pool:
name: NetCore-Public
demands: ImageOverride -equals 1es-ubuntu-2004-open
containerName: mcr.microsoft.com/dotnet/sdk:6.0

- stage:
displayName: Test Linux (.NET 8)
dependsOn: []
jobs:
- template: azure-pipelines/test-matrix.yml
parameters:
# Prefer the dotnet from the container.
installDotNet: false
installAdditionalLinuxDependencies: true
pool:
name: NetCore-Public
demands: ImageOverride -equals 1es-ubuntu-2004-open
containerName: mcr.microsoft.com/dotnet/sdk:8.0

- stage: Test_Windows_Stage
displayName: Test Windows
dependsOn: []
jobs:
- job: Test_Windows_Job
displayName: Test Windows
pool:
name: NetCore-Public
demands: ImageOverride -equals 1es-windows-2022-open
steps:
- template: azure-pipelines/test.yml
parameters:
installDotNet: true
- template: azure-pipelines/test-matrix.yml
parameters:
installDotNet: true
pool:
name: NetCore-Public
demands: ImageOverride -equals 1es-windows-2022-open

- stage: Test_MacOS_Stage
displayName: Test MacOS
dependsOn: []
jobs:
- job: Test_MacOS_Job
displayName: Test MacOS
pool:
name: Azure Pipelines
vmImage: macOS-13
steps:
- template: azure-pipelines/test.yml
parameters:
installDotNet: true
- template: azure-pipelines/test-matrix.yml
parameters:
installDotNet: true
pool:
name: Azure Pipelines
vmImage: macOS-13

- stage: Test_OmniSharp
displayName: Test OmniSharp
Expand Down
30 changes: 30 additions & 0 deletions azure-pipelines/test-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
parameters:
- name: pool
type: object
- name: containerName
type: string
default: ''
- name: installDotNet
type: boolean
- name: installAdditionalLinuxDependencies
type: boolean
default: false

jobs:
- job:
strategy:
matrix:
CSharpTests:
npmCommand: 'test:withoutDevKit'
DevKitTests:
npmCommand: test:integration:devkit
pool: ${{ parameters.pool }}
${{ if parameters.containerName }}:
container: ${{ parameters.containerName }}
steps:
- template: /azure-pipelines/test.yml@self
parameters:
# Prefer the dotnet from the container.
installDotNet: false
installAdditionalLinuxDependencies: true
npmCommand: $(npmCommand)
12 changes: 7 additions & 5 deletions azure-pipelines/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ parameters:
- name: installAdditionalLinuxDependencies
type: boolean
default: false
- name: npmCommand
type: string

steps:
- checkout: self
Expand All @@ -23,8 +25,8 @@ steps:
parameters:
installAdditionalLinuxDependencies: ${{ parameters.installAdditionalLinuxDependencies }}

- script: npm run test
displayName: 🧪 Run unit and integration tests
- script: npm run ${{ parameters.npmCommand }}
displayName: 🧪 Run $(Agent.JobName)
env:
DISPLAY: :99.0

Expand All @@ -37,11 +39,11 @@ steps:
searchFolder: '$(Build.SourcesDirectory)/out'
publishRunAttachments: true
mergeTestResults: true
testRunTitle: $(Agent.JobName) (Attempt $(System.JobAttempt))
testRunTitle: $(System.StageDisplayName) $(Agent.JobName) (Attempt $(System.JobAttempt))

- task: PublishPipelineArtifact@1
condition: failed()
displayName: 'Upload integration test logs'
inputs:
targetPath: '$(Build.SourcesDirectory)/.vscode-test/user-data/logs'
artifactName: 'VSCode Test Logs ($(Agent.JobName)-$(System.JobAttempt))'
targetPath: '$(Build.SourcesDirectory)/out/logs'
artifactName: 'Test Logs ($(System.StageDisplayName)-$(Agent.JobName)-$(System.JobAttempt))'
Binary file added docs/background_analysis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/crash_dump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/inspect_tokens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/language_status.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/report_issue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/trace_logs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const config: Config = {
// Azure DevOps does not display test suites (it ignores them entirely).
// So we have to put all the info in the test case name so the UI shows anything relatively useful.
// See https://github.com/microsoft/azure-pipelines-tasks/issues/7659
titleTemplate: '{filename} / {suitename} / {title}',
classNameTemplate: '{suitename}',
titleTemplate: `${process.env.JEST_SUITE_NAME} {suitename} / {title}`,
},
],
],
Expand Down
Loading

0 comments on commit 926acc1

Please sign in to comment.