Skip to content

Commit 9ec70f0

Browse files
authoredJan 11, 2025··
[automated] Merge branch 'main' => 'prerelease' (#7917)
2 parents a4e6477 + 68f193b commit 9ec70f0

28 files changed

+230
-178
lines changed
 

‎CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +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+
# 2.62.x
7+
* Update Roslyn to 4.14.0-1.25060.2 (PR: [#7916](https://github.com/dotnet/vscode-csharp/pull/7916))
8+
* Support Extracting method with complex flow control cosntructs in them. (PR: [#76686](https://github.com/dotnet/roslyn/pull/76686))
9+
* Classify the langword attribute value in DocComments (PR: [#76678](https://github.com/dotnet/roslyn/pull/76678))
10+
* Fix FAR/rename with method type parameters (PR: [#76652](https://github.com/dotnet/roslyn/pull/76652))
11+
* Fix assembly load when file path contains URI reserved chars (PR: [#76617](https://github.com/dotnet/roslyn/pull/76617))
12+
* Reduce allocations during checksum creation. (PR: [#76524](https://github.com/dotnet/roslyn/pull/76524))
13+
* Bump xamlTools to 17.13.35709.178 (PR: [#7914](https://github.com/dotnet/vscode-csharp/pull/7914))
14+
15+
616
# 2.61.x
717
* Update Razor to 9.0.0-preview.25052.3 (PR: [#7904](https://github.com/dotnet/vscode-csharp/pull/7904))
818
* Offer generate handler for `@bind-XX:after` and `:set` (#11350) (PR: [#11350](https://github.com/dotnet/razor/pull/11350))

‎CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Follow these steps to build, run, and test the repository:
3535

3636
#### Building
3737

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

‎azure-pipelines/test-matrix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
CSharpTests:
20-
npmCommand: 'test:unit' # Restore when integration test are stable: 'test:withoutDevKit'
20+
npmCommand: test:withoutDevKit
2121
DevKitTests:
2222
npmCommand: test:integration:devkit
2323
pool: ${{ parameters.pool }}

‎package-lock.json

+152-140
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
}
3838
},
3939
"defaults": {
40-
"roslyn": "4.13.0-3.25051.1",
40+
"roslyn": "4.14.0-1.25060.2",
4141
"omniSharp": "1.39.12",
4242
"razor": "9.0.0-preview.25052.3",
4343
"razorOmnisharp": "7.0.0-preview.23363.1",
44-
"xamlTools": "17.13.35703.12"
44+
"xamlTools": "17.13.35709.178"
4545
},
4646
"main": "./dist/extension",
4747
"l10n": "./l10n",
@@ -96,7 +96,7 @@
9696
"@vscode/extension-telemetry": "^0.9.0",
9797
"@vscode/js-debug-browsers": "^1.1.0",
9898
"async-file": "2.0.2",
99-
"cross-spawn": "6.0.5",
99+
"cross-spawn": "6.0.6",
100100
"execa": "4.0.0",
101101
"fs-extra": "9.1.0",
102102
"http-proxy-agent": "7.0.0",
@@ -136,8 +136,8 @@
136136
"@types/uuid": "^9.0.1",
137137
"@types/vscode": "1.93.0",
138138
"@types/yauzl": "2.10.0",
139-
"@typescript-eslint/eslint-plugin": "^8.5.0",
140-
"@typescript-eslint/parser": "^8.5.0",
139+
"@typescript-eslint/eslint-plugin": "^8.19.0",
140+
"@typescript-eslint/parser": "^8.19.0",
141141
"@vscode/l10n-dev": "^0.0.35",
142142
"@vscode/test-electron": "2.3.8",
143143
"@vscode/vsce": "3.0.0",

‎src/lsptoolshost/onAutoInsertFeature.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
} from 'vscode-languageserver-protocol';
2323

2424
import * as RoslynProtocol from './roslynProtocol';
25-
import * as UUID from 'vscode-languageclient/lib/common/utils/uuid';
25+
import { generateUuid } from 'vscode-languageclient/lib/common/utils/uuid';
2626

2727
export class OnAutoInsertFeature implements DynamicFeature<RoslynProtocol.OnAutoInsertRegistrationOptions> {
2828
private readonly _client: LanguageClient;
@@ -92,7 +92,7 @@ export class OnAutoInsertFeature implements DynamicFeature<RoslynProtocol.OnAuto
9292
return;
9393
}
9494
this.register({
95-
id: UUID.generateUuid(),
95+
id: generateUuid(),
9696
registerOptions: options,
9797
});
9898
}

‎src/lsptoolshost/optionNameConverter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import assert = require('node:assert');
6+
import assert from 'node:assert';
77

88
export function convertServerOptionNameToClientConfigurationName(section: string): string | null {
99
// Server name would be in format {languageName}|{grouping}.{name} or

‎src/lsptoolshost/restore.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
RestoreRequest,
1313
ProjectNeedsRestoreRequest,
1414
} from './roslynProtocol';
15-
import path = require('path');
15+
import path from 'path';
1616
import { showErrorMessage } from '../shared/observers/utils/showMessage';
1717
import { getCSharpDevKit } from '../utils/getCSharpDevKit';
1818

‎src/packageManager/proxy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { Url } from 'url';
7-
import HttpProxyAgent = require('http-proxy-agent');
8-
import HttpsProxyAgent = require('https-proxy-agent');
7+
import HttpProxyAgent from 'http-proxy-agent';
8+
import HttpsProxyAgent from 'https-proxy-agent';
99
import { Agent } from 'http';
1010

1111
function getSystemProxyURL(requestURL: Url): string | undefined {

‎src/razor/src/blazorDebug/blazorDebugConfigurationProvider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import execa = require('execa');
6+
import execa from 'execa';
77
import { promises, readFileSync } from 'fs';
88
import { join } from 'path';
99
import { fileURLToPath } from 'url';

‎src/razor/src/blazorDebug/terminateDebugHandler.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as psList from 'ps-list';
6+
import psList from 'ps-list';
77
import { DebugSession } from 'vscode';
88
import { RazorLogger } from '../razorLogger';
99
import { JS_DEBUG_NAME, SERVER_APP_NAME } from './constants';

‎src/utils/removeBom.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import removeBomBuffer = require('strip-bom-buf');
6+
import removeBomBuffer from 'strip-bom-buf';
77
import removeBomString from 'strip-bom';
88

99
export function removeBOMFromBuffer(buffer: Buffer): Buffer {

‎tasks/commandLineArguments.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as minimist from 'minimist';
6+
import minimist from 'minimist';
77
import * as path from 'path';
88

99
const argv = minimist(process.argv.slice(2));

‎tasks/createTagsTasks.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as gulp from 'gulp';
77
import * as fs from 'fs';
8-
import * as minimist from 'minimist';
8+
import minimist from 'minimist';
99
import { Octokit } from '@octokit/rest';
1010

1111
interface Options {

‎tasks/localizationTasks.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as gulp from 'gulp';
77
import * as process from 'node:process';
8-
import * as minimist from 'minimist';
8+
import minimist from 'minimist';
99
import { spawnSync } from 'node:child_process';
1010
import * as path from 'path';
1111
import * as util from 'node:util';

‎tasks/offlinePackagingTasks.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as cp from 'child_process';
7-
import * as del from 'del';
7+
import del from 'del';
88
import * as fs from 'fs';
99
import * as fsextra from 'fs-extra';
1010
import * as gulp from 'gulp';
@@ -31,7 +31,7 @@ import {
3131
import { getPackageJSON } from '../tasks/packageJson';
3232
import { createPackageAsync, generateVsixManifest } from '../tasks/vsceTasks';
3333
import { isValidDownload } from '../src/packageManager/isValidDownload';
34-
import path = require('path');
34+
import path from 'path';
3535
import { CancellationToken } from 'vscode';
3636
// There are no typings for this library.
3737
// eslint-disable-next-line @typescript-eslint/no-var-requires

‎tasks/signingTasks.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as cp from 'child_process';
77
import * as fs from 'fs';
88
import * as gulp from 'gulp';
99
import { rootPath } from './projectPaths';
10-
import path = require('path');
10+
import path from 'path';
1111
// There are no typings for this library.
1212
// eslint-disable-next-line @typescript-eslint/no-var-requires
1313
//const argv = require('yargs').argv;

‎tasks/testTasks.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as fs from 'fs';
6+
import fs from 'fs';
77
import * as gulp from 'gulp';
88
import * as path from 'path';
99
import { codeExtensionPath, rootPath, outPath } from './projectPaths';

‎test/lsptoolshost/integrationTests/buildDiagnostics.integration.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { describe, test, expect, beforeAll, afterAll, beforeEach, afterEach } fr
88
import testAssetWorkspace from './testAssets/testAssetWorkspace';
99
import { AnalysisSetting, BuildDiagnosticsService } from '../../../src/lsptoolshost/buildDiagnosticsService';
1010
import * as integrationHelpers from './integrationHelpers';
11-
import path = require('path');
11+
import path from 'path';
1212
describe(`Build and live diagnostics dedupe`, () => {
1313
beforeAll(async () => {
1414
await integrationHelpers.activateCSharpExtension();

‎test/lsptoolshost/integrationTests/documentDiagnostics.integration.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as vscode from 'vscode';
77
import { describe, test, beforeAll, afterAll, expect, beforeEach, afterEach } from '@jest/globals';
88
import testAssetWorkspace from './testAssets/testAssetWorkspace';
99
import { AnalysisSetting } from '../../../src/lsptoolshost/buildDiagnosticsService';
10-
import path = require('path');
10+
import path from 'path';
1111
import { getCode, setBackgroundAnalysisScopes, waitForExpectedDiagnostics } from './diagnosticsHelpers';
1212
import {
1313
activateCSharpExtension,

‎test/lsptoolshost/integrationTests/integrationHelpers.ts

+29-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,35 @@ export async function getCodeLensesAsync(): Promise<vscode.CodeLens[]> {
118118
// The number of code lens items to resolve. Set to a high number so we get pretty much everything in the document.
119119
const resolvedItemCount = 100;
120120

121+
let tryCount = 0;
122+
const maxRetryCount = 3;
123+
do {
124+
try {
125+
const result = await executeCodeLensProviderAsync(activeEditor, resolvedItemCount);
126+
return result;
127+
} catch (e) {
128+
tryCount++;
129+
// It is totally possible that the code lens request is cancelled due to the server returning a content modified error.
130+
// This is not an error condition - it just means that the server snapshot has moved on and we need to retry the request.
131+
//
132+
// This error is not thrown as an error type that matches ours, so we'll check the name of the error to determine if it was a cancellation.
133+
if (Object.prototype.hasOwnProperty.call(e, 'name') && (e as any).name === 'Canceled') {
134+
console.log('CodeLens provider was cancelled, retrying in 1 second');
135+
await sleep(1000);
136+
} else {
137+
console.log('CodeLens provider encountered unexpected error');
138+
console.log(JSON.stringify(e));
139+
throw e;
140+
}
141+
}
142+
} while (tryCount < maxRetryCount);
143+
throw new Error(`Failed to get code lenses after ${maxRetryCount} retries`);
144+
}
145+
146+
async function executeCodeLensProviderAsync(
147+
activeEditor: vscode.TextEditor,
148+
resolvedItemCount: number
149+
): Promise<vscode.CodeLens[]> {
121150
const codeLenses = <vscode.CodeLens[]>(
122151
await vscode.commands.executeCommand(
123152
'vscode.executeCodeLensProvider',
@@ -130,7 +159,6 @@ export async function getCodeLensesAsync(): Promise<vscode.CodeLens[]> {
130159
if (rangeCompare !== 0) {
131160
return rangeCompare;
132161
}
133-
134162
return a.command!.title.localeCompare(b.command!.command);
135163
});
136164
}

‎test/lsptoolshost/unitTests/migrateOptions.test.ts

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import { getVSCodeWithConfig } from '../../fakes';
1818
import { CSharpExtensionId } from '../../../src/constants/csharpExtensionId';
1919
import { ConfigurationTarget } from '../../../src/vscodeAdapter';
2020

21+
// Necessary when spying on module members.
22+
jest.mock('fs', () => ({ __esModule: true, ...(<any>jest.requireActual('fs')) }));
23+
2124
describe('Migrate configurations', () => {
2225
const packageJson = JSON.parse(fs.readFileSync('package.json').toString());
2326
const configuration = packageJson.contributes.configuration;

‎test/omnisharp/omnisharpUnitTests/features/reportIssue.test.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ describe(`${reportIssue.name}`, () => {
6262
issueBody = rest[0].issueBody;
6363
return {} as any;
6464
});
65-
jest.replaceProperty(vscode, 'extensions', {
66-
all: [extension1, extension2],
67-
getExtension: jest.fn(),
68-
onDidChange: jest.fn(),
69-
} as typeof vscode.extensions);
65+
jest.replaceProperty(vscode.extensions, 'all', [extension1, extension2] as readonly vscode.Extension<any>[]);
7066

7167
fakeMonoResolver = new FakeMonoResolver();
7268
fakeDotnetResolver = new FakeDotnetResolver();

‎test/omnisharp/omnisharpUnitTests/packages/packageFilterer.test.ts

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import { MockedFunction } from 'jest-mock';
1111
import * as fs from 'fs';
1212
import { join } from 'path';
1313

14+
// Necessary when spying on module members.
15+
jest.mock('fs', () => ({ __esModule: true, ...(<any>jest.requireActual('fs')) }));
16+
1417
describe(`${getNotInstalledPackagesForPlatform.name}`, () => {
1518
let absolutePathPackages: AbsolutePathPackage[];
1619
const extensionPath = '/ExtensionPath';

‎test/omnisharp/omnisharpUnitTests/testAssets/mockHttpsServer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as fs from 'async-file';
7-
import * as getPort from 'get-port';
7+
import getPort from 'get-port';
88

99
// There are no typings for this library.
1010
// eslint-disable-next-line @typescript-eslint/no-var-requires

‎test/omnisharp/omnisharpUnitTests/testAssets/testZip.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as archiver from 'archiver';
6+
import archiver from 'archiver';
77
import { TestFile } from './testFile';
88

99
export default class TestZip {

‎tsconfig.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"compilerOptions": {
3-
"target": "es6",
4-
"module": "commonjs",
3+
"esModuleInterop": true,
4+
"target": "ES2022",
5+
"module": "CommonJS",
56
"outDir": "out",
67
"lib": [
78
"ES2021"
@@ -20,7 +21,6 @@
2021
"src",
2122
"tasks",
2223
"test",
23-
"omnisharptest",
2424
"typings",
2525
"__mocks__",
2626
"jest.config.ts",

‎version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "2.61",
3+
"version": "2.62",
44
"publicReleaseRefSpec": [
55
"^refs/heads/release$",
66
"^refs/heads/prerelease$",

0 commit comments

Comments
 (0)
Please sign in to comment.