Skip to content

Commit 1ebb88d

Browse files
author
Becca McHenry
committed
Merge remote-tracking branch 'origin' into u/beccam/dedupeDiagnostics
2 parents 076b499 + 4202215 commit 1ebb88d

File tree

89 files changed

+1833
-2438
lines changed

Some content is hidden

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

89 files changed

+1833
-2438
lines changed

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@
290290
"updatePackageDependencies"
291291
],
292292
"env": {
293-
"NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/af4c33cdb53e85a7de39fb07195e05b2/razorlanguageserver-linux-arm64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/24783517c9a4729efbd7dfd2a97fe5cc/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/e5e12ac99072e02499bef77c2c5034a2/razorlanguageserver-linux-musl-x64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/86a165500517ca828227bfd0f28f7a02/razorlanguageserver-linux-x64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/d61e51f223e6bfeceae821b1cce36bfc/razorlanguageserver-osx-arm64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/b9ee27ddd84b0f4faf82e88589c8584f/razorlanguageserver-osx-x64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/d279c139e3d914fec96dfab50f05f438/razorlanguageserver-win-arm64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/258d3df59cb903ca4bcb9d42b854e28b/razorlanguageserver-win-x64-7.0.0-preview.23456.2.zip,https://download.visualstudio.microsoft.com/download/pr/e5617c98-d08e-43f2-a9bf-a36fec5306b7/d2ffb8978958712807d88ebf38914f47/razorlanguageserver-win-x86-7.0.0-preview.23456.2.zip",
294-
"NEW_DEPS_VERSION": "7.0.0-preview.23456.2",
293+
"NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/5d2a9551b2419050af29fd67cbfb07e2/razorlanguageserver-linux-arm64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/c9d05d0efed3e5eef277fca1a8b6a9ed/razorlanguageserver-linux-musl-arm64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/4e41816de1d92aaa60902ac6cdbd2b32/razorlanguageserver-linux-musl-x64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/220b7d238a8e4b5de28dfd1b8dc1b828/razorlanguageserver-linux-x64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/3189d3c39a5064da2695e522f1b0e82a/razorlanguageserver-osx-arm64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/9c8b944036c4a878f06c27dff6754699/razorlanguageserver-osx-x64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/2325f8e4f971ce802a3cc9c6b4491e05/razorlanguageserver-win-arm64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/6367c634fe3d849456d2ff67b572ec1a/razorlanguageserver-win-x64-8.0.0-preview.23465.2.zip,https://download.visualstudio.microsoft.com/download/pr/a25d8ba1-e305-49cf-ba25-d8e5455d42f1/2d57ef6a6a45f5eb743298fd8d488990/razorlanguageserver-win-x86-8.0.0-preview.23465.2.zip",
294+
"NEW_DEPS_VERSION": "8.0.0-preview.23465.2",
295295
"NEW_DEPS_ID": "Razor"
296296
},
297297
"cwd": "${workspaceFolder}"

CHANGELOG.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,36 @@
88
- Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876)
99

1010
## Latest
11+
* Update Roslyn version to 4.8.0-3.23472.2 and Razor version to 8.0.0-preview.23465.2 (PR: [#6423](https://github.com/dotnet/vscode-csharp/pull/6423))
12+
* Use message pack for project.razor.* configuration file (PR: [#9270](https://github.com/dotnet/razor/pull/9270))
13+
14+
## 2.3.27
15+
* Update Roslyn version to 4.8.0-3.23470.7 (PR: [#6408](https://github.com/dotnet/vscode-csharp/pull/6408))
16+
* Update NuGet version to fix issues loading projects with .NET 8 RC2 (PR: [#70023](https://github.com/dotnet/roslyn/pull/70023))
17+
* Update MSBuildLocator version to fix issues loading projects when only .NET 6 is installed (PR: [#70038](https://github.com/dotnet/roslyn/pull/70038))
18+
* Remove diagnostic source name (PR: [#69939](https://github.com/dotnet/roslyn/pull/69939))
19+
* Fix fold all regions (PR: [#69817](https://github.com/dotnet/roslyn/pull/69817))
20+
* Fix escaping and wrapping in hover (PR: [#69893](https://github.com/dotnet/roslyn/pull/69893))
21+
* Fix error in override completion when containing type does not exist (PR: [#69855](https://github.com/dotnet/roslyn/pull/69855))
22+
* Fix issues generating assets in Omnisharp (PR: [#6380](https://github.com/dotnet/vscode-csharp/pull/6380))
23+
* Allow Razor to format new documents via Roslyn (PR: [#6329](https://github.com/dotnet/vscode-csharp/pull/6329))
24+
* Switch to named pipes for client <-> server communication (PR: [#6351](https://github.com/dotnet/vscode-csharp/pull/6351))
25+
* Only show clr debugger if on Windows (PR: [#6359](https://github.com/dotnet/vscode-csharp/pull/6359))
1126
* Update Razor version to 7.0.0-preview.23456.2 (PR: [#6304](https://github.com/dotnet/vscode-csharp/pull/6304))
1227
* Fixes regression where semantic colors for razor components appear as red
28+
* Make completion complex text edits more robust (PR: [#6325](https://github.com/dotnet/vscode-csharp/pull/6325))
29+
* Fix dotnet info when the dotnet path contains spaces (PR: [#6334](https://github.com/dotnet/vscode-csharp/pull/6334))
1330
* Add support for specifying a .runsettings file when using Roslyn LSP (PR: [#6265](https://github.com/dotnet/vscode-csharp/pull/6265))
1431
* Update Roslyn version (PR: [#6265](https://github.com/dotnet/vscode-csharp/pull/6265))
1532
* Add server support for .runsettings in unit tests (PR: [#69792](https://github.com/dotnet/roslyn/pull/69792))
1633
* Log more information when we're unable to parse a URI (PR: [#69840](https://github.com/dotnet/roslyn/pull/69840))
1734
* Bump ICSharpCode.Decompiler to 8.1.0.745 (PR: [#69772](https://github.com/dotnet/roslyn/pull/69772))
1835
* Fix override completion erroring when framework assemblies are not found (PR: [#69795](https://github.com/dotnet/roslyn/pull/69795))
36+
* Remove test only files from vsix (PR: [#6332](https://github.com/dotnet/vscode-csharp/pull/6332))
1937
* Fix override completion when drive letter casing does not match (PR: [#6315](https://github.com/dotnet/vscode-csharp/pull/6315))
2038
* Allow the server path to be specified by the `DOTNET_ROSLYN_SERVER_PATH` environment variable (PR: [#6316](https://github.com/dotnet/vscode-csharp/pull/6316))
2139

22-
## 2.1.10
40+
## 2.2.10
2341
* Update Roslyn version
2442
* Includes better support for .NET 8 and .NET Framework-targeting projects (PR: [#69616](https://github.com/dotnet/roslyn/pull/69616))
2543
* This should fix a number of reports where projects don't have full IntelliSense. .NET Framework projects on Windows should load without errors. .NET Framework targeting projects on Mac and Linux which would use Mono are still processed as if they are .NET Core projects and may not load correctly; support for Mono is coming in a future update.
@@ -29,7 +47,7 @@
2947
* Fix parsing of tasks.json with comments in certain locations (PR: [#6288](https://github.com/dotnet/vscode-csharp/pull/6288))
3048
* Fix Razor browser discovery issues on Mac and Linux `DOTNET_ROSLYN_SERVER_PATH` environment variable (PR: [#6269](https://github.com/dotnet/vscode-csharp/pull/6269))
3149

32-
## 2.0.448
50+
## 2.1.2
3351
* Update Roslyn version (PR: [#6264](https://github.com/dotnet/vscode-csharp/pull/6264))
3452
* Upgrade MSBuildLocator to fix homebrew dotnet resolution (PR: [#69769](https://github.com/dotnet/roslyn/pull/69769))
3553
* Fix reported ExeName / ExeVersion (PR: [#69771](https://github.com/dotnet/roslyn/pull/69771))

gulpfile.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,9 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as gulp from 'gulp';
7-
import * as optionsSchemaGenerator from './src/tools/generateOptionsSchema';
8-
import * as packageDependencyUpdater from './src/tools/updatePackageDependencies';
9-
106
require('./tasks/testTasks');
117
require('./tasks/offlinePackagingTasks');
128
require('./tasks/backcompatTasks');
139
require('./tasks/localizationTasks');
1410
require('./tasks/createTagsTasks');
15-
16-
// Disable warning about wanting an async function
17-
// tslint:disable-next-line
18-
gulp.task('generateOptionsSchema', async (): Promise<void> => {
19-
optionsSchemaGenerator.GenerateOptionsSchema();
20-
return Promise.resolve();
21-
});
22-
23-
// Disable warning about wanting an async function
24-
// tslint:disable-next-line
25-
gulp.task('updatePackageDependencies', async (): Promise<void> => {
26-
return packageDependencyUpdater.updatePackageDependencies();
27-
});
11+
require('./tasks/debuggerTasks');

omnisharptest/omnisharpFeatureTests/assets.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ suite('Asset generation: csproj', () => {
7878
// We do not check the watch task since this parameter can break hot reload scenarios.
7979
tasksJson.tasks
8080
.filter((task) => task.label !== 'watch')
81-
.forEach((task) => task.args!.should.contain('/consoleloggerparameters:NoSummary'));
81+
.forEach((task) => task.args!.should.contain('/consoleloggerparameters:NoSummary;ForceNoAlign'));
8282
});
8383

8484
test("Generated 'watch' task does not have the property GenerateFullPaths set to true ", () => {
@@ -111,7 +111,7 @@ suite('Asset generation: csproj', () => {
111111

112112
const watchTask = tasksJson.tasks!.find((task) => task.label === 'watch');
113113
isNotNull(watchTask?.args);
114-
watchTask.args.should.not.contain('/consoleloggerparameters:NoSummary');
114+
watchTask.args.should.not.contain('/consoleloggerparameters:NoSummary;ForceNoAlign');
115115
});
116116

117117
test('Create tasks.json for nested project opened in workspace', () => {

omnisharptest/omnisharpUnitTests/common.test.ts renamed to omnisharptest/omnisharpJestTests/common.test.ts

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

6+
import { describe, test, expect } from '@jest/globals';
67
import * as path from 'path';
78

89
import { isSubfolderOf, safeLength, sum } from '../../src/common';
910

10-
import { should, expect } from 'chai';
11-
12-
suite('Common', () => {
13-
suiteSetup(() => should());
14-
15-
suite('safeLength', () => {
11+
describe('Common', () => {
12+
describe('safeLength', () => {
1613
test('return 0 for empty array', () => {
1714
const array: any[] = [];
1815
const result = safeLength(array);
19-
result.should.equal(0);
16+
expect(result).toBe(0);
2017
});
2118

2219
test('returns 5 for array of 5 elements', () => {
2320
const array = [1, 2, 3, 4, 5];
2421
const result = safeLength(array);
25-
result.should.equal(5);
22+
expect(result).toBe(5);
2623
});
2724

2825
test('returns 0 for undefined', () => {
2926
const array = undefined;
3027
const result = safeLength(array);
31-
result.should.equal(0);
28+
expect(result).toBe(0);
3229
});
3330
});
3431

35-
suite('sum', () => {
32+
describe('sum', () => {
3633
test('produce total from numbers', () => {
3734
const array = [1, 2, 3, 4, 5];
3835
const result = sum(array, (i) => i);
39-
result.should.equal(15);
36+
expect(result).toBe(15);
4037
});
4138

4239
test('produce total from lengths of arrays', () => {
4340
const array = [[1, 2], [3], [], [4, 5, 6]];
4441
const result = sum(array, (i) => i.length);
45-
result.should.equal(6);
42+
expect(result).toBe(6);
4643
});
4744

4845
test('produce total of true values from array of booleans', () => {
4946
const array = [true, false, false, true, true, true, false, true];
5047
const result = sum(array, (b) => (b ? 1 : 0));
51-
result.should.equal(5);
48+
expect(result).toBe(5);
5249
});
5350
});
5451

55-
suite('isSubfolderOf', () => {
52+
describe('isSubfolderOf', () => {
5653
test('same paths', () => {
5754
const subfolder: string = ['C:', 'temp', 'VS', 'dotnetProject'].join(path.sep);
5855
const folder: string = ['C:', 'temp', 'VS', 'dotnetProject'].join(path.sep);
5956

60-
expect(isSubfolderOf(subfolder, folder)).to.be.true;
57+
expect(isSubfolderOf(subfolder, folder)).toBe(true);
6158
});
6259

6360
test('correct subfolder', () => {
64-
const subfolder: string = ['C:', 'temp', 'VS'].join(path.sep);
65-
const folder: string = ['C:', 'temp', 'VS', 'dotnetProject'].join(path.sep);
61+
const folder: string = ['C:', 'temp', 'VS'].join(path.sep);
62+
const subfolder: string = ['C:', 'temp', 'VS', 'dotnetProject'].join(path.sep);
6663

67-
expect(isSubfolderOf(subfolder, folder)).to.be.true;
64+
expect(isSubfolderOf(subfolder, folder)).toBe(true);
6865
});
6966

70-
test('longer subfolder', () => {
71-
const subfolder: string = ['C:', 'temp', 'VS', 'a', 'b', 'c'].join(path.sep);
72-
const folder: string = ['C:', 'temp', 'VS'].join(path.sep);
67+
test('longer folder', () => {
68+
const folder: string = ['C:', 'temp', 'VS', 'a', 'b', 'c'].join(path.sep);
69+
const subfolder: string = ['C:', 'temp', 'VS'].join(path.sep);
7370

74-
expect(isSubfolderOf(subfolder, folder)).to.be.false;
71+
expect(isSubfolderOf(subfolder, folder)).toBe(false);
7572
});
7673

7774
test('Different drive', () => {
7875
const subfolder: string = ['C:', 'temp', 'VS'].join(path.sep);
7976
const folder: string = ['E:', 'temp', 'VS'].join(path.sep);
8077

81-
expect(isSubfolderOf(subfolder, folder)).to.be.false;
78+
expect(isSubfolderOf(subfolder, folder)).toBe(false);
8279
});
8380
});
8481
});
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import * as vscode from 'vscode';
7+
import reportIssue from '../../../src/shared/reportIssue';
8+
import { FakeMonoResolver, fakeMonoInfo } from '../../omnisharpUnitTests/fakes/fakeMonoResolver';
9+
import { FakeDotnetResolver } from '../../omnisharpUnitTests/fakes/fakeDotnetResolver';
10+
import { DotnetInfo } from '../../../src/shared/utils/dotnetInfo';
11+
import { jest, describe, test, expect, beforeEach } from '@jest/globals';
12+
13+
describe(`${reportIssue.name}`, () => {
14+
const vscodeVersion = 'myVersion';
15+
const csharpExtVersion = 'csharpExtVersion';
16+
const isValidForMono = true;
17+
const extension1 = {
18+
packageJSON: {
19+
name: 'name1',
20+
publisher: 'publisher1',
21+
version: 'version1',
22+
isBuiltin: true,
23+
},
24+
id: 'id1',
25+
extensionPath: 'c:/extensions/abc-x64',
26+
} as vscode.Extension<any>;
27+
28+
const extension2 = {
29+
packageJSON: {
30+
name: 'name2',
31+
publisher: 'publisher2',
32+
version: 'version2',
33+
isBuiltin: false,
34+
},
35+
id: 'id2',
36+
extensionPath: 'c:/extensions/xyz-x64',
37+
} as vscode.Extension<any>;
38+
39+
const fakeDotnetInfo: DotnetInfo = {
40+
FullInfo: 'myDotnetInfo',
41+
Version: '1.0.x',
42+
RuntimeId: 'win10-x64',
43+
Runtimes: {},
44+
};
45+
46+
let fakeMonoResolver: FakeMonoResolver;
47+
let fakeDotnetResolver: FakeDotnetResolver;
48+
const getDotnetInfo = async () => Promise.resolve(fakeDotnetInfo);
49+
let issueBody: string;
50+
51+
beforeEach(() => {
52+
jest.spyOn(vscode.workspace, 'getConfiguration').mockReturnValue({
53+
get: jest.fn((_config: string) => {
54+
return undefined;
55+
}),
56+
has: jest.fn(),
57+
inspect: jest.fn(),
58+
update: jest.fn(),
59+
} as vscode.WorkspaceConfiguration);
60+
61+
jest.spyOn(vscode.commands, 'executeCommand').mockImplementation(async (command: string, ...rest: any[]) => {
62+
issueBody = rest[0].issueBody;
63+
return {} as any;
64+
});
65+
jest.replaceProperty(vscode, 'extensions', {
66+
all: [extension1, extension2],
67+
getExtension: jest.fn(),
68+
onDidChange: jest.fn(),
69+
} as typeof vscode.extensions);
70+
71+
fakeMonoResolver = new FakeMonoResolver();
72+
fakeDotnetResolver = new FakeDotnetResolver();
73+
});
74+
75+
describe('The body is passed to the vscode clipboard and', () => {
76+
test('it contains the vscode version', async () => {
77+
await reportIssue(csharpExtVersion, getDotnetInfo, isValidForMono, fakeDotnetResolver, fakeMonoResolver);
78+
expect(issueBody).toContain(`**VSCode version**: ${vscodeVersion}`);
79+
});
80+
81+
test('it contains the csharp extension version', async () => {
82+
await reportIssue(csharpExtVersion, getDotnetInfo, isValidForMono, fakeDotnetResolver, fakeMonoResolver);
83+
expect(issueBody).toContain(`**C# Extension**: ${csharpExtVersion}`);
84+
});
85+
86+
test('it contains dotnet info', async () => {
87+
await reportIssue(csharpExtVersion, getDotnetInfo, isValidForMono, fakeDotnetResolver, fakeMonoResolver);
88+
expect(issueBody).toContain(fakeDotnetInfo.FullInfo);
89+
});
90+
91+
test('mono information is obtained when it is a valid mono platform', async () => {
92+
await reportIssue(csharpExtVersion, getDotnetInfo, isValidForMono, fakeDotnetResolver, fakeMonoResolver);
93+
expect(fakeMonoResolver.getMonoCalled).toEqual(true);
94+
});
95+
96+
test('mono version is put in the body when it is a valid mono platform', async () => {
97+
await reportIssue(csharpExtVersion, getDotnetInfo, isValidForMono, fakeDotnetResolver, fakeMonoResolver);
98+
expect(fakeMonoResolver.getMonoCalled).toEqual(true);
99+
expect(issueBody).toContain(fakeMonoInfo.version);
100+
});
101+
102+
test('mono information is not obtained when it is not a valid mono platform', async () => {
103+
await reportIssue(csharpExtVersion, getDotnetInfo, false, fakeDotnetResolver, fakeMonoResolver);
104+
expect(fakeMonoResolver.getMonoCalled).toEqual(false);
105+
});
106+
107+
test('The url contains the name, publisher and version for all the extensions that are not builtin', async () => {
108+
await reportIssue(csharpExtVersion, getDotnetInfo, isValidForMono, fakeDotnetResolver, fakeMonoResolver);
109+
expect(issueBody).toContain(extension2.packageJSON.name);
110+
expect(issueBody).toContain(extension2.packageJSON.publisher);
111+
expect(issueBody).toContain(extension2.packageJSON.version);
112+
expect(issueBody).not.toContain(extension1.packageJSON.name);
113+
expect(issueBody).not.toContain(extension1.packageJSON.publisher);
114+
expect(issueBody).not.toContain(extension1.packageJSON.version);
115+
});
116+
});
117+
});

0 commit comments

Comments
 (0)