Skip to content

Commit 32d519b

Browse files
authored
Update to latest lsp for pull diagnostics (#23979)
This is to match the latest updates we've made in pylance. See this PR: microsoft/pyrx#5590
1 parent 8ea21a9 commit 32d519b

140 files changed

Lines changed: 2468 additions & 1168 deletions

File tree

Some content is hidden

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

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"no-control-regex": "off",
7070
"no-extend-native": "off",
7171
"no-multi-str": "off",
72+
"no-shadow": "off",
7273
"no-param-reassign": "off",
7374
"no-prototype-builtins": "off",
7475
"no-restricted-syntax": [

package-lock.json

Lines changed: 1951 additions & 856 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,11 +1525,11 @@
15251525
"@iarna/toml": "^2.2.5",
15261526
"@vscode/extension-telemetry": "^0.8.4",
15271527
"arch": "^2.1.0",
1528-
"fs-extra": "^10.0.1",
1528+
"fs-extra": "^11.2.0",
15291529
"glob": "^7.2.0",
15301530
"hash.js": "^1.1.7",
15311531
"iconv-lite": "^0.6.3",
1532-
"inversify": "^5.0.4",
1532+
"inversify": "^6.0.2",
15331533
"jsonc-parser": "^3.0.0",
15341534
"lodash": "^4.17.21",
15351535
"minimatch": "^5.0.1",
@@ -1544,11 +1544,10 @@
15441544
"tmp": "^0.0.33",
15451545
"uint64be": "^3.0.0",
15461546
"unicode": "^14.0.0",
1547-
"untildify": "^4.0.0",
15481547
"vscode-debugprotocol": "^1.28.0",
1549-
"vscode-jsonrpc": "^9.0.0-next.2",
1550-
"vscode-languageclient": "^10.0.0-next.2",
1551-
"vscode-languageserver-protocol": "^3.17.6-next.3",
1548+
"vscode-jsonrpc": "^9.0.0-next.5",
1549+
"vscode-languageclient": "^10.0.0-next.12",
1550+
"vscode-languageserver-protocol": "^3.17.6-next.10",
15521551
"vscode-tas-client": "^0.1.84",
15531552
"which": "^2.0.2",
15541553
"winreg": "^1.2.4",
@@ -1561,36 +1560,37 @@
15611560
"@types/chai-arrays": "^2.0.0",
15621561
"@types/chai-as-promised": "^7.1.0",
15631562
"@types/download": "^8.0.1",
1564-
"@types/fs-extra": "^9.0.13",
1563+
"@types/fs-extra": "^11.0.4",
15651564
"@types/glob": "^7.2.0",
15661565
"@types/lodash": "^4.14.104",
15671566
"@types/mocha": "^9.1.0",
1568-
"@types/node": "^18.17.1",
1567+
"@types/node": "^22.5.0",
15691568
"@types/semver": "^5.5.0",
15701569
"@types/shortid": "^0.0.29",
1571-
"@types/sinon": "^10.0.11",
1570+
"@types/sinon": "^17.0.3",
15721571
"@types/stack-trace": "0.0.29",
15731572
"@types/tmp": "^0.0.33",
15741573
"@types/vscode": "^1.81.0",
15751574
"@types/which": "^2.0.1",
15761575
"@types/winreg": "^1.2.30",
15771576
"@types/xml2js": "^0.4.2",
1578-
"@typescript-eslint/eslint-plugin": "^3.7.0",
1579-
"@typescript-eslint/parser": "^3.7.0",
1577+
"@typescript-eslint/eslint-plugin": "^6.21.0",
1578+
"@typescript-eslint/parser": "^6.21.0",
15801579
"@vscode/test-electron": "^2.3.8",
15811580
"@vscode/vsce": "^2.27.0",
15821581
"bent": "^7.3.12",
15831582
"chai": "^4.1.2",
15841583
"chai-arrays": "^2.0.0",
15851584
"chai-as-promised": "^7.1.1",
15861585
"copy-webpack-plugin": "^9.1.0",
1586+
"cross-env": "^7.0.3",
15871587
"cross-spawn": "^6.0.5",
15881588
"del": "^6.0.0",
15891589
"download": "^8.0.0",
15901590
"eslint": "^7.2.0",
15911591
"eslint-config-airbnb": "^18.2.0",
15921592
"eslint-config-prettier": "^8.3.0",
1593-
"eslint-plugin-import": "^2.25.4",
1593+
"eslint-plugin-import": "^2.29.1",
15941594
"eslint-plugin-jsx-a11y": "^6.3.1",
15951595
"eslint-plugin-react": "^7.20.3",
15961596
"eslint-plugin-react-hooks": "^4.0.0",
@@ -1609,14 +1609,14 @@
16091609
"prettier": "^2.0.2",
16101610
"rewiremock": "^3.13.0",
16111611
"shortid": "^2.2.8",
1612-
"sinon": "^13.0.1",
1612+
"sinon": "^18.0.0",
16131613
"source-map-support": "^0.5.12",
16141614
"ts-loader": "^9.2.8",
16151615
"ts-mockito": "^2.5.0",
16161616
"ts-node": "^10.7.0",
16171617
"tsconfig-paths-webpack-plugin": "^3.2.0",
16181618
"typemoq": "^2.1.0",
1619-
"typescript": "4.5.5",
1619+
"typescript": "~5.2",
16201620
"uuid": "^8.3.2",
16211621
"webpack": "^5.76.0",
16221622
"webpack-bundle-analyzer": "^4.5.0",

src/client/activation/extensionSurvey.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
'use strict';
55

6-
import { inject, injectable, optional } from 'inversify';
6+
import { inject, injectable } from 'inversify';
77
import * as querystring from 'querystring';
88
import { env, UIKind } from 'vscode';
99
import { IApplicationEnvironment, IApplicationShell } from '../common/application/types';
@@ -37,8 +37,8 @@ export class ExtensionSurveyPrompt implements IExtensionSingleActivationService
3737
@inject(IExperimentService) private experiments: IExperimentService,
3838
@inject(IApplicationEnvironment) private appEnvironment: IApplicationEnvironment,
3939
@inject(IPlatformService) private platformService: IPlatformService,
40-
@optional() private sampleSizePerOneHundredUsers: number = 10,
41-
@optional() private waitTimeToShowSurvey: number = WAIT_TIME_TO_SHOW_SURVEY,
40+
private sampleSizePerOneHundredUsers: number = 10,
41+
private waitTimeToShowSurvey: number = WAIT_TIME_TO_SHOW_SURVEY,
4242
) {}
4343

4444
public async activate(): Promise<void> {

src/client/application/diagnostics/checks/macPythonInterpreter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const InvalidMacPythonInterpreterServiceId = 'InvalidMacPythonInterpreter
4040
export class InvalidMacPythonInterpreterService extends BaseDiagnosticsService {
4141
protected changeThrottleTimeout = 1000;
4242

43-
private timeOut?: NodeJS.Timer | number;
43+
private timeOut?: NodeJS.Timeout | number;
4444

4545
constructor(
4646
@inject(IServiceContainer) serviceContainer: IServiceContainer,

src/client/browser/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ async function runPylance(
108108
middleware,
109109
};
110110

111-
const client = new LanguageClient('python', 'Python Language Server', clientOptions, worker);
111+
const client = new LanguageClient('python', 'Python Language Server', worker, clientOptions);
112112
languageClient = client;
113113

114114
context.subscriptions.push(

src/client/common/application/commands/reportIssueCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
'use strict';
55

6-
import * as fs from 'fs-extra';
76
import * as os from 'os';
87
import * as path from 'path';
98
import { inject, injectable } from 'inversify';
109
import { isEqual } from 'lodash';
10+
import * as fs from '../../platform/fs-paths';
1111
import { IExtensionSingleActivationService } from '../../../activation/types';
1212
import { IApplicationEnvironment, ICommandManager, IWorkspaceService } from '../types';
1313
import { EXTENSION_ROOT_DIR } from '../../../constants';

src/client/common/configSettings.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ import { debounceSync } from './utils/decorators';
3838
import { SystemVariables } from './variables/systemVariables';
3939
import { getOSType, OSType } from './utils/platform';
4040
import { isWindows } from './platform/platformService';
41-
42-
const untildify = require('untildify');
41+
import { untildify } from './helpers';
4342

4443
export class PythonSettings implements IPythonSettings {
4544
private get onDidChange(): Event<ConfigurationChangeEvent | undefined> {

src/client/common/extensions.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,6 @@ String.prototype.trimQuotes = function (this: string): string {
6363
return this.replace(/(^['"])|(['"]$)/g, '');
6464
};
6565

66-
declare interface Promise<T> {
67-
/**
68-
* Catches task error and ignores them.
69-
*/
70-
ignoreErrors(): Promise<void>;
71-
}
72-
7366
/**
7467
* Explicitly tells that promise should be run asynchonously.
7568
*/

src/client/common/helpers.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
'use strict';
5+
import * as os from 'os';
56

67
import { ModuleNotInstalledError } from './errors/moduleNotInstalledError';
78

@@ -19,3 +20,7 @@ export function isNotInstalledError(error: Error): boolean {
1920
const isModuleNoInstalledError = error.message.indexOf('No module named') >= 0;
2021
return errorObj.code === 'ENOENT' || errorObj.code === 127 || isModuleNoInstalledError;
2122
}
23+
24+
export function untildify(path: string): string {
25+
return path.replace(/^~($|\/|\\)/, `${os.homedir()}$1`);
26+
}

0 commit comments

Comments
 (0)