Skip to content

Commit

Permalink
Update to latest lsp for pull diagnostics (microsoft#23979)
Browse files Browse the repository at this point in the history
This is to match the latest updates we've made in pylance.

See this PR:
microsoft/pyrx#5590
  • Loading branch information
rchiodo authored Aug 23, 2024
1 parent 8ea21a9 commit 32d519b
Show file tree
Hide file tree
Showing 140 changed files with 2,468 additions and 1,168 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"no-control-regex": "off",
"no-extend-native": "off",
"no-multi-str": "off",
"no-shadow": "off",
"no-param-reassign": "off",
"no-prototype-builtins": "off",
"no-restricted-syntax": [
Expand Down
2,807 changes: 1,951 additions & 856 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1525,11 +1525,11 @@
"@iarna/toml": "^2.2.5",
"@vscode/extension-telemetry": "^0.8.4",
"arch": "^2.1.0",
"fs-extra": "^10.0.1",
"fs-extra": "^11.2.0",
"glob": "^7.2.0",
"hash.js": "^1.1.7",
"iconv-lite": "^0.6.3",
"inversify": "^5.0.4",
"inversify": "^6.0.2",
"jsonc-parser": "^3.0.0",
"lodash": "^4.17.21",
"minimatch": "^5.0.1",
Expand All @@ -1544,11 +1544,10 @@
"tmp": "^0.0.33",
"uint64be": "^3.0.0",
"unicode": "^14.0.0",
"untildify": "^4.0.0",
"vscode-debugprotocol": "^1.28.0",
"vscode-jsonrpc": "^9.0.0-next.2",
"vscode-languageclient": "^10.0.0-next.2",
"vscode-languageserver-protocol": "^3.17.6-next.3",
"vscode-jsonrpc": "^9.0.0-next.5",
"vscode-languageclient": "^10.0.0-next.12",
"vscode-languageserver-protocol": "^3.17.6-next.10",
"vscode-tas-client": "^0.1.84",
"which": "^2.0.2",
"winreg": "^1.2.4",
Expand All @@ -1561,36 +1560,37 @@
"@types/chai-arrays": "^2.0.0",
"@types/chai-as-promised": "^7.1.0",
"@types/download": "^8.0.1",
"@types/fs-extra": "^9.0.13",
"@types/fs-extra": "^11.0.4",
"@types/glob": "^7.2.0",
"@types/lodash": "^4.14.104",
"@types/mocha": "^9.1.0",
"@types/node": "^18.17.1",
"@types/node": "^22.5.0",
"@types/semver": "^5.5.0",
"@types/shortid": "^0.0.29",
"@types/sinon": "^10.0.11",
"@types/sinon": "^17.0.3",
"@types/stack-trace": "0.0.29",
"@types/tmp": "^0.0.33",
"@types/vscode": "^1.81.0",
"@types/which": "^2.0.1",
"@types/winreg": "^1.2.30",
"@types/xml2js": "^0.4.2",
"@typescript-eslint/eslint-plugin": "^3.7.0",
"@typescript-eslint/parser": "^3.7.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vscode/test-electron": "^2.3.8",
"@vscode/vsce": "^2.27.0",
"bent": "^7.3.12",
"chai": "^4.1.2",
"chai-arrays": "^2.0.0",
"chai-as-promised": "^7.1.1",
"copy-webpack-plugin": "^9.1.0",
"cross-env": "^7.0.3",
"cross-spawn": "^6.0.5",
"del": "^6.0.0",
"download": "^8.0.0",
"eslint": "^7.2.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.20.3",
"eslint-plugin-react-hooks": "^4.0.0",
Expand All @@ -1609,14 +1609,14 @@
"prettier": "^2.0.2",
"rewiremock": "^3.13.0",
"shortid": "^2.2.8",
"sinon": "^13.0.1",
"sinon": "^18.0.0",
"source-map-support": "^0.5.12",
"ts-loader": "^9.2.8",
"ts-mockito": "^2.5.0",
"ts-node": "^10.7.0",
"tsconfig-paths-webpack-plugin": "^3.2.0",
"typemoq": "^2.1.0",
"typescript": "4.5.5",
"typescript": "~5.2",
"uuid": "^8.3.2",
"webpack": "^5.76.0",
"webpack-bundle-analyzer": "^4.5.0",
Expand Down
6 changes: 3 additions & 3 deletions src/client/activation/extensionSurvey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

'use strict';

import { inject, injectable, optional } from 'inversify';
import { inject, injectable } from 'inversify';
import * as querystring from 'querystring';
import { env, UIKind } from 'vscode';
import { IApplicationEnvironment, IApplicationShell } from '../common/application/types';
Expand Down Expand Up @@ -37,8 +37,8 @@ export class ExtensionSurveyPrompt implements IExtensionSingleActivationService
@inject(IExperimentService) private experiments: IExperimentService,
@inject(IApplicationEnvironment) private appEnvironment: IApplicationEnvironment,
@inject(IPlatformService) private platformService: IPlatformService,
@optional() private sampleSizePerOneHundredUsers: number = 10,
@optional() private waitTimeToShowSurvey: number = WAIT_TIME_TO_SHOW_SURVEY,
private sampleSizePerOneHundredUsers: number = 10,
private waitTimeToShowSurvey: number = WAIT_TIME_TO_SHOW_SURVEY,
) {}

public async activate(): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const InvalidMacPythonInterpreterServiceId = 'InvalidMacPythonInterpreter
export class InvalidMacPythonInterpreterService extends BaseDiagnosticsService {
protected changeThrottleTimeout = 1000;

private timeOut?: NodeJS.Timer | number;
private timeOut?: NodeJS.Timeout | number;

constructor(
@inject(IServiceContainer) serviceContainer: IServiceContainer,
Expand Down
2 changes: 1 addition & 1 deletion src/client/browser/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async function runPylance(
middleware,
};

const client = new LanguageClient('python', 'Python Language Server', clientOptions, worker);
const client = new LanguageClient('python', 'Python Language Server', worker, clientOptions);
languageClient = client;

context.subscriptions.push(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

'use strict';

import * as fs from 'fs-extra';
import * as os from 'os';
import * as path from 'path';
import { inject, injectable } from 'inversify';
import { isEqual } from 'lodash';
import * as fs from '../../platform/fs-paths';
import { IExtensionSingleActivationService } from '../../../activation/types';
import { IApplicationEnvironment, ICommandManager, IWorkspaceService } from '../types';
import { EXTENSION_ROOT_DIR } from '../../../constants';
Expand Down
3 changes: 1 addition & 2 deletions src/client/common/configSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ import { debounceSync } from './utils/decorators';
import { SystemVariables } from './variables/systemVariables';
import { getOSType, OSType } from './utils/platform';
import { isWindows } from './platform/platformService';

const untildify = require('untildify');
import { untildify } from './helpers';

export class PythonSettings implements IPythonSettings {
private get onDidChange(): Event<ConfigurationChangeEvent | undefined> {
Expand Down
7 changes: 0 additions & 7 deletions src/client/common/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ String.prototype.trimQuotes = function (this: string): string {
return this.replace(/(^['"])|(['"]$)/g, '');
};

declare interface Promise<T> {
/**
* Catches task error and ignores them.
*/
ignoreErrors(): Promise<void>;
}

/**
* Explicitly tells that promise should be run asynchonously.
*/
Expand Down
5 changes: 5 additions & 0 deletions src/client/common/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

'use strict';
import * as os from 'os';

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

Expand All @@ -19,3 +20,7 @@ export function isNotInstalledError(error: Error): boolean {
const isModuleNoInstalledError = error.message.indexOf('No module named') >= 0;
return errorObj.code === 'ENOENT' || errorObj.code === 127 || isModuleNoInstalledError;
}

export function untildify(path: string): string {
return path.replace(/^~($|\/|\\)/, `${os.homedir()}$1`);
}
1 change: 1 addition & 0 deletions src/client/common/installer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface IProductPathService {
}

export enum ModuleInstallFlags {
none = 0,
upgrade = 1,
updateDependencies = 2,
reInstall = 4,
Expand Down
2 changes: 1 addition & 1 deletion src/client/common/interpreterPathService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

'use strict';

import * as fs from 'fs-extra';
import * as fs from '../common/platform/fs-paths';
import { inject, injectable } from 'inversify';
import { ConfigurationChangeEvent, ConfigurationTarget, Event, EventEmitter, Uri } from 'vscode';
import { traceError, traceVerbose } from '../logging';
Expand Down
2 changes: 1 addition & 1 deletion src/client/common/platform/fileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export class FileSystemUtils implements IFileSystemUtils {
pathUtils.paths,
tmp || TemporaryFileSystem.withDefaults(),
getHash || getHashString,
globFiles || promisify(glob),
globFiles || promisify(glob.default),
);
}

Expand Down
Loading

0 comments on commit 32d519b

Please sign in to comment.