Skip to content

Commit 1843ab7

Browse files
authored
Merge pull request #6586 from dibarbet/merge_main
Merge main into release
2 parents bff3482 + 47c3207 commit 1843ab7

File tree

201 files changed

+1702
-2521
lines changed

Some content is hidden

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

201 files changed

+1702
-2521
lines changed

.vscode/launch.json

Lines changed: 57 additions & 206 deletions
Large diffs are not rendered by default.

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
},
1717
"csharp.suppressDotnetRestoreNotification": true,
1818
"typescript.tsdk": "./node_modules/typescript/lib",
19-
"mocha.enabled": true,
2019
"omnisharp.autoStart": false,
2120
"editor.formatOnSave": false,
2221
"eslint.lintTask.enable": true,

.vscodeignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ CODEOWNERS
3535
gulpfile.ts
3636
!install.Lock
3737
ISSUE_TEMPLATE
38-
.mocharc.jsonc
3938
!README.md
4039
!CHANGELOG.md
4140
*.md

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
- Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876)
77

88
## Latest
9+
* Fix various failed requests in razor documents (PR: [#6580](https://github.com/dotnet/vscode-csharp/pull/6580))
10+
* Update Roslyn to 4.9.0-1.23519.13 (PR: [#6573](https://github.com/dotnet/vscode-csharp/pull/6573))
11+
* Filter completion list only with text before cursor (PR: [#70448](https://github.com/dotnet/roslyn/pull/70448))
12+
* Bump MSBuild.StructuredLogger package version (PR: [#70157](https://github.com/dotnet/roslyn/pull/70157))
13+
* Fix issues launching the server when a .NET 7 preview 7 runtime is installed (PR: [#70446](https://github.com/dotnet/roslyn/pull/70446))
14+
* Ensure LSP didChange processing matches specification. (PR: [#70407](https://github.com/dotnet/roslyn/pull/70407))
15+
* Debugger: Support Console.ReadLine with 'internalConsole' (PR: [#6569](https://github.com/dotnet/vscode-csharp/pull/6569))
16+
* Add dotnet executable path in list runtimes command (PR: [#6559](https://github.com/dotnet/vscode-csharp/pull/6559))
17+
* Update Razor to 7.0.0-preview.23516.2 (PR: [#6550](https://github.com/dotnet/vscode-csharp/pull/6550))
18+
* Make sure correct info is passed in code action resolve (PR: [razor#9420](https://github.com/dotnet/razor/pull/9420))
19+
20+
## 2.7.25
921
* Update Razor to 7.0.0-preview.23513.5 (PR: [#6551](https://github.com/dotnet/vscode-csharp/pull/6551))
1022
* Reduce noisy errors when viewing git diff (PR: [razor#9407](https://github.com/dotnet/razor/pull/9407))
1123
* Update Roslyn to 4.9.0-1.23513.7 (PR: [#6548](https://github.com/dotnet/vscode-csharp/pull/6548))
@@ -16,6 +28,7 @@
1628
* Fix dotnet path resolution when using snap installed packages (PR: [#6515](https://github.com/dotnet/vscode-csharp/pull/6515))
1729
* Track debugging sessions until csdevkit is initialized (PR: [#6480](https://github.com/dotnet/vscode-csharp/pull/6480))
1830
* Update vsdbg and vsdbg-ui to 2.0.4 (PR: [#6517](https://github.com/dotnet/vscode-csharp/pull/6517))
31+
* Debugger: better handle long strings ([#6496](https://github.com/dotnet/vscode-csharp/issues/6496)). Strings are truncated if they are longer than 1024 UTF-16 characters, but the full value up to 5,242,880 characters or 10 megabytes, is available using 'Copy Value' in the watch or variables window. Truncated strings will end with '...'.
1932
* Add setting to control Razor component commit behaviour (PR: [#6506](https://github.com/dotnet/vscode-csharp/pull/6506))
2033
* Razor textmate colorization fixes (PR: [#6514](https://github.com/dotnet/vscode-csharp/pull/6514))
2134
* Update Razor version to 7.0.0-preview.23475.5 (PR: [#6506](https://github.com/dotnet/vscode-csharp/pull/6506))
@@ -44,7 +57,6 @@
4457
* Update Razor project configuration file name (PR: [#70156](https://github.com/dotnet/roslyn/pull/70156))* added support.md file (PR: [#6478](https://github.com/dotnet/vscode-csharp/pull/6478))
4558
* Debugger: Improve the display of various debug configurations and snippets (PR: [#6456](https://github.com/dotnet/vscode-csharp/pull/6456))
4659
* Initialize Razor even if Razor doc isn't opened yet (PR: [#6473](https://github.com/dotnet/vscode-csharp/pull/6473))
47-
* Debugger: better handle long strings ([#6496](https://github.com/dotnet/vscode-csharp/issues/6496)). Strings are truncated if they are longer than 1024 UTF-16 characters, but the full value up to 5,242,880 characters or 10 megabytes, is available using 'Copy Value' in the watch or variables window. Truncated strings will end with '...'.
4860

4961
## 2.5.30
5062
* Add code action fix all support (PR: [#6310](https://github.com/dotnet/vscode-csharp/pull/6310))

azure-pipelines/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ stages:
3131
targetPath: '$(Build.SourcesDirectory)/vsix'
3232
artifactName: 'VSIX_Prerelease_$(System.JobAttempt)'
3333

34-
- script: npm run omnisharptest:artifacts
34+
- script: npm run test:artifacts
3535
displayName: 'Run artifacts tests'
3636

3737
- job:
@@ -58,6 +58,6 @@ stages:
5858
targetPath: '$(Build.SourcesDirectory)/vsix'
5959
artifactName: 'VSIX_Release_$(System.JobAttempt)'
6060

61-
- script: npm run omnisharptest:artifacts
61+
- script: npm run test:artifacts
6262
displayName: 'Run artifacts tests'
6363

debugger-launchjson.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,19 @@ Environment variables may be passed to your program using this schema:
124124

125125
The `"console"` setting controls what console (terminal) window the target app is launched into. It can be set to any of these values --
126126

127-
`"internalConsole"` (default) : the target process's console output (stdout/stderr) goes to the VS Code Debug Console. This is useful for executables that take their input from the network, files, etc. But this does **NOT** work for applications that want to read from the console (ex: `Console.ReadLine`).
127+
`"internalConsole"` (default) : the target process's console input (stdin) and output (stdout/stderr) are routed through the VS Code Debug Console. The advantage of this mode is that it allows you to see messages from both the debugger and the target program in one place, so you will not miss important messages or need to switch back and forth. This is useful for programs with simple console interactions (example: using `Console.WriteLine` and/or `Console.ReadLine`). This should NOT be used when the target program needs full control over the console, such as a program that changes the cursor position, uses `Console.ReadKey` for input, etc. See below for instructions on inputting into the console.
128128

129-
`"integratedTerminal"` : the target process will run inside [VS Code's integrated terminal](https://code.visualstudio.com/docs/editor/integrated-terminal). Click the 'Terminal' tab in the tab group beneath the editor to interact with your application. Alternatively add `"internalConsoleOptions": "neverOpen"` to make it so that the default foreground tab is the terminal tab.
129+
`"integratedTerminal"` : the target process will run inside [VS Code's integrated terminal](https://code.visualstudio.com/docs/editor/integrated-terminal). Click the 'Terminal' tab in the tab group beneath the editor to interact with your application. When using this mode, by default, the Debug Console will not be shown when starting debugging. This can be configured with `internalConsoleOptions`.
130130

131-
`"externalTerminal"`: the target process will run inside its own external terminal.
131+
`"externalTerminal"`: the target process will run inside its own external terminal. When using this mode, you will need to switch focus between Visual Studio Code and the external terminal window.
132+
133+
### Inputting text into the target process when using `internalConsole`
134+
135+
When using `internalConsole`, you can input text into Visual Studio Code that will be returned from `Console.ReadLine` and similar APIs that read from `stdin`. To do so, while the program is running, type text into the input box at the bottom of the Debug Console. Pressing enter will send the text to the target process. Note that if you enter text in this box while your program is stopped under the debugger, this text will be evaluated as a C# expression, not sent to the target process.
136+
137+
Example:
138+
139+
![Example of inputting text to the Console to be set to the target process's standard input](https://raw.githubusercontent.com/wiki/dotnet/vscode-csharp/images/ConsoleInput.gif)
132140

133141
## launchSettings.json support
134142

@@ -352,4 +360,4 @@ Example:
352360

353361
```json
354362
"checkForDevCert": "false"
355-
```
363+
```

debugger.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This page gives you detailed instructions on how to debug code running under .NET Core in VS Code.
33

44
#### Your Feedback​
5-
File bugs and feature requests [here](https://github.com/OmniSharp/omnisharp-vscode/issues) to help us build great tooling for .NET Core.
5+
File bugs and feature requests [here](https://github.com/dotnet/vscode-csharp/issues) to help us build great tooling for .NET Core.
66

77
### First Time setup
88
##### 1: Get Visual Studio Code
@@ -43,15 +43,15 @@ VS Code needs to be configured so it understands how to build your project and d
4343

4444
If you open the folder containing your project, the C# extension can automatically generate these files for you if you have a basic project. When you open a project and the C# extension is installed, you should see the following prompt in VS Code:
4545

46-
![Info: Required assets to build and debug are missing from your project. Add them? Yes | Close](https://raw.githubusercontent.com/wiki/OmniSharp/omnisharp-vscode/images/info-bar-add-required-assets.png)
46+
![Info: Required assets to build and debug are missing from your project. Add them? Yes | Close](https://raw.githubusercontent.com/wiki/dotnet/vscode-csharp/images/info-bar-add-required-assets.png)
4747

4848
Clicking `Yes` on this prompt should add these resources.
4949

5050
**Creating configuration files manually**
5151

5252
If your code has multiple projects or you would rather generate these files by hand, here is how --
5353

54-
**.vscode/tasks.json**: Start with [this example](https://raw.githubusercontent.com/wiki/OmniSharp/omnisharp-vscode/ExampleCode/tasks.json) which configures VS Code to launch `dotnet build`. Update the `cwd` property if your project isn't in the root of the open folder. If you don't want to build from VS Code at all, you can skip this file. If you do this, you will need to comment out the `preLaunchTask` from .vscode/launch.json when you create it.
54+
**.vscode/tasks.json**: Start with [this example](https://raw.githubusercontent.com/wiki/dotnet/vscode-csharp/ExampleCode/tasks.json) which configures VS Code to launch `dotnet build`. Update the `cwd` property if your project isn't in the root of the open folder. If you don't want to build from VS Code at all, you can skip this file. If you do this, you will need to comment out the `preLaunchTask` from .vscode/launch.json when you create it.
5555

5656
**.vscode/launch.json**: When you want to start debugging, press the debugger play button (or press <kbd>F5</kbd>) as you would normally do. VS Code will provide a list of templates to select from. Pick ".NET Core" from this list and the edit the `program` property to indicate the path to the application dll or .NET Core host executable to launch. For example:
5757

@@ -67,27 +67,27 @@ Your project is now all set. Set a breakpoint or two where you want to stop, cli
6767
If your code was built on a different computer from where you would like to run in there are a few things to keep in mind --
6868

6969
* **Source Maps**: Unless your local source code is at exactly the same path as where the code was originally built you will need to add a [sourceFileMap](https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md#source-file-map) to launch.json.
70-
* **Portable PDBs**: If the code was built on Windows, it might have been built using Windows PDBs instead of portable PDBs, but the C# extension only supports portable PDBs. See the [portable PDB documentation](https://github.com/OmniSharp/omnisharp-vscode/wiki/Portable-PDBs#how-to-generate-portable-pdbs) for more information.
70+
* **Portable PDBs**: If the code was built on Windows, it might have been built using Windows PDBs instead of portable PDBs, but the C# extension only supports portable PDBs. See the [portable PDB documentation](https://github.com/dotnet/vscode-csharp/wiki/Portable-PDBs#how-to-generate-portable-pdbs) for more information.
7171
* **Debug vs. Release**: It is much easier to debug code which has been compiled in the `Debug` configuration. So unless the issue you are looking at only reproduces with optimizations, it is much better to use Debug bits. If you do need to debug optimized code, you will need to disable [justMyCode](https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md#just-my-code) in launch.json.
7272

7373
#### [Configurating launch.json for C# Debugging](debugger-launchjson.md)
7474

7575
#### Attach Support
7676
The C# debugger supports attaching to processes. To do this, switch to the Debug tab, and open the configuration drop down.
7777

78-
![Debug launch configuration drop down](https://raw.githubusercontent.com/wiki/OmniSharp/omnisharp-vscode/images/debug-launch-configurations.png)
78+
![Debug launch configuration drop down](https://raw.githubusercontent.com/wiki/dotnet/vscode-csharp/images/debug-launch-configurations.png)
7979

8080
Select the '.NET Core Attach' configuration. Clicking the play button (or pressing <kbd>F5</kbd>) will then try to attach. In launch.json, if `processId` is set to `""` this will provide UI to select which process to attach to.
8181

8282
#### Remote Debugging
8383

84-
The debugger supports remotely launching or attaching to processes. See [Attaching to remote processes](https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes) in the wiki for more information.
84+
The debugger supports remotely launching or attaching to processes. See [Attaching to remote processes](https://github.com/dotnet/vscode-csharp/wiki/Attaching-to-remote-processes) in the wiki for more information.
8585

8686
#### Exception Settings
8787

8888
The VS Code .NET debugger supports configuration options for if the debugger stops when exceptions are thrown or caught. This is done through two different entries in the BREAKPOINTS section of the Run view:
8989

90-
![Exceptions settings in BREAKPOINTS Run View](https://raw.githubusercontent.com/wiki/OmniSharp/omnisharp-vscode/images/Exception-Settings.png)
90+
![Exceptions settings in BREAKPOINTS Run View](https://raw.githubusercontent.com/wiki/dotnet/vscode-csharp/images/Exception-Settings.png)
9191

9292
Note that the BREAKPOINTS section will be missing these entries until the first time that the folder has been debugged with the .NET debugger.
9393

jest.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ const config: Config = {
1010
'<rootDir>/test/integrationTests/jest.config.ts',
1111
'<rootDir>/test/razorIntegrationTests/jest.config.ts',
1212
'<rootDir>/test/razorTests/jest.config.ts',
13+
'<rootDir>/test/artifactTests/jest.config.ts',
1314
'<rootDir>/omnisharptest/omnisharpUnitTests/jest.config.ts',
15+
'<rootDir>/omnisharptest/omnisharpIntegrationTests/jest.config.ts',
1416
],
1517
};
1618

omnisharptest/omnisharpFeatureTests/index.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

omnisharptest/omnisharpIntegrationTests/advisor.integration.test.ts

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as vscode from 'vscode';
7-
8-
import { expect, should } from 'chai';
6+
import { expect, test, beforeAll, afterAll } from '@jest/globals';
97
import * as path from 'path';
10-
import { activateCSharpExtension, isRazorWorkspace, isSlnWithGenerator } from './integrationHelpers';
8+
import * as vscode from 'vscode';
9+
import { activateCSharpExtension, describeIfNotRazorOrGenerator } from './integrationHelpers';
1110
import testAssetWorkspace from './testAssets/activeTestAssetWorkspace';
1211

1312
import { Advisor } from '../../src/features/diagnosticsProvider';
@@ -17,16 +16,10 @@ function setLimit(to: number | null) {
1716
return csharpConfig.update('maxProjectFileCountForDiagnosticAnalysis', to);
1817
}
1918

20-
suite(`Advisor ${testAssetWorkspace.description}`, function () {
19+
describeIfNotRazorOrGenerator(`Advisor ${testAssetWorkspace.description}`, function () {
2120
let advisor: Advisor;
2221

23-
suiteSetup(async function () {
24-
should();
25-
26-
if (isRazorWorkspace(vscode.workspace) || isSlnWithGenerator(vscode.workspace)) {
27-
this.skip();
28-
}
29-
22+
beforeAll(async function () {
3023
const activation = await activateCSharpExtension();
3124
await testAssetWorkspace.restore();
3225

@@ -40,43 +33,43 @@ suite(`Advisor ${testAssetWorkspace.description}`, function () {
4033
await testAssetWorkspace.waitForIdle(activation.eventStream);
4134
});
4235

43-
suiteTeardown(async () => {
36+
afterAll(async () => {
4437
await testAssetWorkspace.cleanupWorkspace();
4538
});
4639

4740
test('Advisor.shouldValidateAll returns true when maxProjectFileCountForDiagnosticAnalysis is higher than the file count', async () => {
4841
await setLimit(1000);
4942

50-
expect(advisor.shouldValidateAll()).to.be.true;
43+
expect(advisor.shouldValidateAll()).toBe(true);
5144
});
5245

5346
test('Advisor.shouldValidateFiles returns true when maxProjectFileCountForDiagnosticAnalysis is higher than the file count', async () => {
5447
await setLimit(1000);
5548

56-
expect(advisor.shouldValidateFiles()).to.be.true;
49+
expect(advisor.shouldValidateFiles()).toBe(true);
5750
});
5851

5952
test('Advisor.shouldValidateAll returns false when maxProjectFileCountForDiagnosticAnalysis is lower than the file count', async () => {
6053
await setLimit(1);
6154

62-
expect(advisor.shouldValidateAll()).to.be.false;
55+
expect(advisor.shouldValidateAll()).toBe(false);
6356
});
6457

6558
test('Advisor.shouldValidateFiles returns true when maxProjectFileCountForDiagnosticAnalysis is lower than the file count', async () => {
6659
await setLimit(1);
6760

68-
expect(advisor.shouldValidateFiles()).to.be.true;
61+
expect(advisor.shouldValidateFiles()).toBe(true);
6962
});
7063

7164
test('Advisor.shouldValidateAll returns true when maxProjectFileCountForDiagnosticAnalysis is null', async () => {
7265
await setLimit(null);
7366

74-
expect(advisor.shouldValidateAll()).to.be.true;
67+
expect(advisor.shouldValidateAll()).toBe(true);
7568
});
7669

7770
test('Advisor.shouldValidateFiles returns true when maxProjectFileCountForDiagnosticAnalysis is null', async () => {
7871
await setLimit(null);
7972

80-
expect(advisor.shouldValidateFiles()).to.be.true;
73+
expect(advisor.shouldValidateFiles()).toBe(true);
8174
});
8275
});

0 commit comments

Comments
 (0)