mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-05 12:27:30 +03:00
update dependencies (#3638)
This commit is contained in:
parent
327ed377ba
commit
7cadfb7412
4
.github/workflows/validation.yml
vendored
4
.github/workflows/validation.yml
vendored
@ -1,7 +1,7 @@
|
||||
name: 'Validation'
|
||||
|
||||
env:
|
||||
NODE_VERSION: '14' # Shipped with VS Code.
|
||||
NODE_VERSION: '16' # Shipped with VS Code.
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -65,7 +65,7 @@ jobs:
|
||||
- run: npm run install:all
|
||||
|
||||
- name: Check diff after npm install
|
||||
run: git diff --exit-code --name-only
|
||||
run: git diff -w --exit-code --name-only
|
||||
|
||||
- run: npm run check
|
||||
|
||||
|
13987
package-lock.json
generated
13987
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@ -21,20 +21,20 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob": "^7.2.0",
|
||||
"@types/node": "^17.0.14",
|
||||
"@types/node": "^17.0.45",
|
||||
"@types/yargs": "^16.0.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.9.1",
|
||||
"@typescript-eslint/parser": "^5.9.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.29.0",
|
||||
"@typescript-eslint/parser": "^5.29.0",
|
||||
"detect-indent": "^6.1.0",
|
||||
"eslint": "^8.6.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint": "^8.18.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-simple-import-sort": "^7.0.0",
|
||||
"glob": "^7.2.0",
|
||||
"glob": "^7.2.3",
|
||||
"jsonc-parser": "^3.0.0",
|
||||
"lerna": "^4.0.0",
|
||||
"npm-check-updates": "^12.1.0",
|
||||
"lerna": "^5.1.4",
|
||||
"npm-check-updates": "^12.5.12",
|
||||
"p-queue": "^6.6.2",
|
||||
"prettier": "2.5.1",
|
||||
"prettier": "2.7.1",
|
||||
"syncpack": "^5.8.15",
|
||||
"typescript": "~4.4.4",
|
||||
"yargs": "^16.2.0"
|
||||
|
5335
packages/pyright-internal/package-lock.json
generated
5335
packages/pyright-internal/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -16,8 +16,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@iarna/toml": "2.2.5",
|
||||
"@yarnpkg/fslib": "2.6.0",
|
||||
"@yarnpkg/libzip": "2.2.2",
|
||||
"@yarnpkg/fslib": "2.6.2",
|
||||
"@yarnpkg/libzip": "2.2.4",
|
||||
"chalk": "^4.1.2",
|
||||
"chokidar": "^3.5.3",
|
||||
"command-line-args": "^5.2.1",
|
||||
@ -34,13 +34,13 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/command-line-args": "^5.2.0",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^17.0.14",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "^17.0.45",
|
||||
"@types/tmp": "^0.2.3",
|
||||
"jest": "^27.4.7",
|
||||
"jest-junit": "^13.0.0",
|
||||
"jest": "^27.5.1",
|
||||
"jest-junit": "^13.2.0",
|
||||
"shx": "^0.3.4",
|
||||
"ts-jest": "^27.1.3",
|
||||
"ts-jest": "^27.1.5",
|
||||
"typescript": "~4.4.4"
|
||||
}
|
||||
}
|
||||
|
@ -1723,19 +1723,19 @@ export class Program {
|
||||
);
|
||||
});
|
||||
|
||||
ls.add(`found ${result?.completionMap?.size ?? 'null'} items`);
|
||||
ls.add(`found ${result?.completionMap.size ?? 'null'} items`);
|
||||
return result;
|
||||
}
|
||||
);
|
||||
|
||||
const completionResultsList: CompletionResultsList = {
|
||||
completionList: CompletionList.create(completionResult?.completionMap?.toArray()),
|
||||
completionList: CompletionList.create(completionResult?.completionMap.toArray()),
|
||||
memberAccessInfo: completionResult?.memberAccessInfo,
|
||||
autoImportInfo: completionResult?.autoImportInfo,
|
||||
extensionInfo: completionResult?.extensionInfo,
|
||||
};
|
||||
|
||||
if (!completionResult?.completionMap || !this._extension?.completionListExtension) {
|
||||
if (!completionResult || !this._extension?.completionListExtension) {
|
||||
return completionResultsList;
|
||||
}
|
||||
|
||||
|
@ -589,7 +589,8 @@ export interface AnalysisRequest {
|
||||
| 'writeTypeStub'
|
||||
| 'getSemanticTokens'
|
||||
| 'setExperimentOptions'
|
||||
| 'setImportResolver';
|
||||
| 'setImportResolver'
|
||||
| 'getInlayHints';
|
||||
|
||||
data: any;
|
||||
port?: MessagePort | undefined;
|
||||
|
@ -159,3 +159,10 @@ export function getLastDottedString(text: string) {
|
||||
const index = text.lastIndexOf('.');
|
||||
return index > 0 ? text.substring(index + 1) : text;
|
||||
}
|
||||
|
||||
export function truncate(text: string, maxLength: number) {
|
||||
if (text.length > maxLength) {
|
||||
return text.substring(0, maxLength - '...'.length) + '...';
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
@ -580,6 +580,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface {
|
||||
renameProvider: { prepareProvider: true, workDoneProgress: true },
|
||||
completionProvider: {
|
||||
triggerCharacters: this.client.hasVisualStudioExtensionsCapability ? ['.', '[', '@'] : ['.', '['],
|
||||
allCommitCharacters: ['.', ';', '(', '['],
|
||||
resolveProvider: true,
|
||||
workDoneProgress: true,
|
||||
completionItem: {
|
||||
@ -1001,7 +1002,7 @@ export abstract class LanguageServerBase implements LanguageServerInterface {
|
||||
token
|
||||
);
|
||||
|
||||
if (completions && completions.completionList) {
|
||||
if (completions) {
|
||||
completions.completionList.isIncomplete = completionIncomplete;
|
||||
}
|
||||
|
||||
|
@ -269,10 +269,10 @@ interface CompletionResultsBase {
|
||||
extensionInfo?: ExtensionInfo | undefined;
|
||||
}
|
||||
export interface CompletionResultsList extends CompletionResultsBase {
|
||||
completionList: CompletionList | undefined;
|
||||
completionList: CompletionList;
|
||||
}
|
||||
export interface CompletionResults extends CompletionResultsBase {
|
||||
completionMap: CompletionMap | undefined;
|
||||
completionMap: CompletionMap;
|
||||
}
|
||||
|
||||
export interface CompletionOptions {
|
||||
@ -746,7 +746,7 @@ export class CompletionProvider {
|
||||
}
|
||||
|
||||
const completionList = this._getExpressionCompletions(curNode, priorWord, priorText, postText);
|
||||
if (completionList?.completionMap) {
|
||||
if (completionList) {
|
||||
completionList.completionMap.delete(curNode.value);
|
||||
}
|
||||
|
||||
@ -840,7 +840,7 @@ export class CompletionProvider {
|
||||
case ErrorExpressionCategory.MissingIndexOrSlice: {
|
||||
let completionResults = this._getLiteralCompletions(node, priorWord, priorText, postText);
|
||||
|
||||
if (!completionResults || !completionResults.completionMap) {
|
||||
if (!completionResults) {
|
||||
completionResults = this._getExpressionCompletions(node, priorWord, priorText, postText);
|
||||
}
|
||||
|
||||
@ -2170,11 +2170,7 @@ export class CompletionProvider {
|
||||
lazyEdit: boolean,
|
||||
completionResults: CompletionResults
|
||||
) {
|
||||
if (
|
||||
!completionResults.completionMap ||
|
||||
!this._configOptions.autoImportCompletions ||
|
||||
!this._options.autoImport
|
||||
) {
|
||||
if (!this._configOptions.autoImportCompletions || !this._options.autoImport) {
|
||||
// If auto import on the server is turned off or this particular invocation
|
||||
// is turned off (ex, notebook), don't do any thing.
|
||||
return;
|
||||
|
@ -57,9 +57,9 @@ test('check chained files', async () => {
|
||||
CancellationToken.None
|
||||
);
|
||||
|
||||
assert(result?.completionList?.items.some((i) => i.label === 'foo1'));
|
||||
assert(result?.completionList?.items.some((i) => i.label === 'foo2'));
|
||||
assert(result?.completionList?.items.some((i) => i.label === 'foo3'));
|
||||
assert(result?.completionList.items.some((i) => i.label === 'foo1'));
|
||||
assert(result?.completionList.items.some((i) => i.label === 'foo2'));
|
||||
assert(result?.completionList.items.some((i) => i.label === 'foo3'));
|
||||
});
|
||||
|
||||
test('modify chained files', async () => {
|
||||
@ -104,9 +104,9 @@ test('modify chained files', async () => {
|
||||
|
||||
assert(result);
|
||||
|
||||
assert(!result.completionList?.items.some((i) => i.label === 'foo1'));
|
||||
assert(!result.completionList?.items.some((i) => i.label === 'foo2'));
|
||||
assert(result.completionList?.items.some((i) => i.label === 'foo3'));
|
||||
assert(!result.completionList.items.some((i) => i.label === 'foo1'));
|
||||
assert(!result.completionList.items.some((i) => i.label === 'foo2'));
|
||||
assert(result.completionList.items.some((i) => i.label === 'foo3'));
|
||||
});
|
||||
|
||||
test('modify chained files', async () => {
|
||||
|
@ -226,6 +226,7 @@ declare namespace _ {
|
||||
predicate: (m: Marker | undefined, d: T | undefined, text: string) => boolean
|
||||
): Range[];
|
||||
getPositionRange(markerString: string): PositionRange;
|
||||
getPosition(markerString: string): Position;
|
||||
expandPositionRange(range: PositionRange, start: number, end: number): PositionRange;
|
||||
convertPositionRange(range: Range): PositionRange;
|
||||
convertPathToUri(path: string): string;
|
||||
@ -344,6 +345,16 @@ declare namespace _ {
|
||||
setCancelled(numberOfCalls: number): void;
|
||||
resetCancelled(): void; */
|
||||
}
|
||||
|
||||
export interface InlayHint {
|
||||
label: string;
|
||||
position?: _.Position;
|
||||
kind?: Consts.InlayHintKind;
|
||||
tooltip?: string;
|
||||
paddingLeft?: boolean;
|
||||
paddingRight?: boolean;
|
||||
textEdits?: TextEdit[];
|
||||
}
|
||||
}
|
||||
|
||||
declare var helper: _.Fourslash;
|
||||
@ -408,4 +419,12 @@ declare namespace Consts {
|
||||
const Operator: 24;
|
||||
const TypeParameter: 25;
|
||||
}
|
||||
|
||||
namespace InlayHintKind {
|
||||
const Type = 1;
|
||||
const Parameter = 2;
|
||||
function is(value: number): value is InlayHintKind;
|
||||
}
|
||||
|
||||
export type InlayHintKind = 1 | 2;
|
||||
}
|
||||
|
@ -26,4 +26,5 @@ export namespace Consts {
|
||||
}
|
||||
|
||||
export import CompletionItemKind = lsp.CompletionItemKind;
|
||||
export import InlayHintKind = lsp.InlayHintKind;
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ export class TestState {
|
||||
this.openFile(marker.fileName);
|
||||
}
|
||||
|
||||
const content = this._getFileContent(marker.fileName);
|
||||
const content = this.getFileContent(marker.fileName);
|
||||
if (marker.position === -1 || marker.position > content.length) {
|
||||
throw new Error(`Marker "${nameOrMarker}" has been invalidated by unrecoverable edits to the file.`);
|
||||
}
|
||||
@ -312,6 +312,15 @@ export class TestState {
|
||||
return this.convertPositionRange(range);
|
||||
}
|
||||
|
||||
getPosition(markerString: string): Position {
|
||||
const marker = this.getMarkerByName(markerString);
|
||||
const ranges = this.getRanges().filter((r) => r.marker === marker);
|
||||
if (ranges.length !== 1) {
|
||||
this.raiseError(`no matching range for ${markerString}`);
|
||||
}
|
||||
return this.convertOffsetToPosition(marker.fileName, marker.position);
|
||||
}
|
||||
|
||||
expandPositionRange(range: PositionRange, start: number, end: number) {
|
||||
return {
|
||||
start: { line: range.start.line, character: range.start.character - start },
|
||||
@ -416,7 +425,7 @@ export class TestState {
|
||||
}
|
||||
|
||||
goToEOF() {
|
||||
const len = this._getFileContent(this.activeFile.fileName).length;
|
||||
const len = this.getFileContent(this.activeFile.fileName).length;
|
||||
this.goToPosition(len);
|
||||
}
|
||||
|
||||
@ -424,7 +433,7 @@ export class TestState {
|
||||
this.currentCaretPosition += count;
|
||||
this.currentCaretPosition = Math.min(
|
||||
this.currentCaretPosition,
|
||||
this._getFileContent(this.activeFile.fileName).length
|
||||
this.getFileContent(this.activeFile.fileName).length
|
||||
);
|
||||
this.selectionEnd = -1;
|
||||
}
|
||||
@ -448,7 +457,7 @@ export class TestState {
|
||||
for (const file of this.testData.files) {
|
||||
const active = this.activeFile === file;
|
||||
host.HOST.log(`=== Script (${file.fileName}) ${active ? '(active, cursor at |)' : ''} ===`);
|
||||
let content = this._getFileContent(file.fileName);
|
||||
let content = this.getFileContent(file.fileName);
|
||||
if (active) {
|
||||
content =
|
||||
content.substr(0, this.currentCaretPosition) +
|
||||
@ -1036,7 +1045,7 @@ export class TestState {
|
||||
}
|
||||
|
||||
verifyTextAtCaretIs(text: string) {
|
||||
const actual = this._getFileContent(this.activeFile.fileName).substring(
|
||||
const actual = this.getFileContent(this.activeFile.fileName).substring(
|
||||
this.currentCaretPosition,
|
||||
this.currentCaretPosition + text.length
|
||||
);
|
||||
@ -1091,7 +1100,7 @@ export class TestState {
|
||||
CancellationToken.None
|
||||
);
|
||||
|
||||
if (result?.completionList) {
|
||||
if (result) {
|
||||
if (verifyMode === 'exact') {
|
||||
if (result.completionList.items.length !== expectedCompletions.length) {
|
||||
assert.fail(
|
||||
@ -1518,19 +1527,19 @@ export class TestState {
|
||||
return configOptions;
|
||||
}
|
||||
|
||||
private _getFileContent(fileName: string): string {
|
||||
protected getFileContent(fileName: string): string {
|
||||
const files = this.testData.files.filter(
|
||||
(f) => comparePaths(f.fileName, fileName, this.testFS.ignoreCase) === Comparison.EqualTo
|
||||
);
|
||||
return files[0].content;
|
||||
}
|
||||
|
||||
protected convertPositionToOffset(fileName: string, position: Position): number {
|
||||
convertPositionToOffset(fileName: string, position: Position): number {
|
||||
const lines = this._getTextRangeCollection(fileName);
|
||||
return convertPositionToOffset(position, lines)!;
|
||||
}
|
||||
|
||||
protected convertOffsetToPosition(fileName: string, offset: number): Position {
|
||||
convertOffsetToPosition(fileName: string, offset: number): Position {
|
||||
const lines = this._getTextRangeCollection(fileName);
|
||||
|
||||
return convertOffsetToPosition(offset, lines);
|
||||
@ -1636,7 +1645,7 @@ export class TestState {
|
||||
}
|
||||
|
||||
protected _rangeText({ fileName, pos, end }: Range): string {
|
||||
return this._getFileContent(fileName).slice(pos, end);
|
||||
return this.getFileContent(fileName).slice(pos, end);
|
||||
}
|
||||
|
||||
private _getOnlyRange() {
|
||||
@ -1649,7 +1658,7 @@ export class TestState {
|
||||
}
|
||||
|
||||
private _verifyFileContent(fileName: string, text: string) {
|
||||
const actual = this._getFileContent(fileName);
|
||||
const actual = this.getFileContent(fileName);
|
||||
if (actual !== text) {
|
||||
throw new Error(`verifyFileContent failed:\n${this._showTextDiff(text, actual)}`);
|
||||
}
|
||||
@ -1672,7 +1681,7 @@ export class TestState {
|
||||
}
|
||||
|
||||
private _getLineContent(index: number) {
|
||||
const text = this._getFileContent(this.activeFile.fileName);
|
||||
const text = this.getFileContent(this.activeFile.fileName);
|
||||
const pos = this.convertPositionToOffset(this.activeFile.fileName, { line: index, character: 0 });
|
||||
let startPos = pos;
|
||||
let endPos = pos;
|
||||
|
2804
packages/pyright/package-lock.json
generated
2804
packages/pyright/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -24,14 +24,14 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/copy-webpack-plugin": "^10.1.0",
|
||||
"@types/node": "^17.0.14",
|
||||
"@types/node": "^17.0.45",
|
||||
"copy-webpack-plugin": "^10.2.4",
|
||||
"esbuild-loader": "^2.18.0",
|
||||
"esbuild-loader": "^2.19.0",
|
||||
"shx": "^0.3.4",
|
||||
"ts-loader": "^9.2.6",
|
||||
"ts-loader": "^9.3.1",
|
||||
"typescript": "~4.4.4",
|
||||
"webpack": "^5.68.0",
|
||||
"webpack-cli": "^4.9.2"
|
||||
"webpack": "^5.73.0",
|
||||
"webpack-cli": "^4.10.0"
|
||||
},
|
||||
"files": [
|
||||
"/dist",
|
||||
|
3499
packages/vscode-pyright/package-lock.json
generated
3499
packages/vscode-pyright/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -862,15 +862,15 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/copy-webpack-plugin": "^10.1.0",
|
||||
"@types/node": "^17.0.14",
|
||||
"@types/node": "^17.0.45",
|
||||
"@types/vscode": "~1.67.0",
|
||||
"copy-webpack-plugin": "^10.2.4",
|
||||
"detect-indent": "^6.1.0",
|
||||
"shx": "^0.3.4",
|
||||
"ts-loader": "^9.2.6",
|
||||
"ts-loader": "^9.3.1",
|
||||
"typescript": "~4.4.4",
|
||||
"vsce": "^2.7.0",
|
||||
"webpack": "^5.68.0",
|
||||
"webpack-cli": "^4.9.2"
|
||||
"webpack": "^5.73.0",
|
||||
"webpack-cli": "^4.10.0"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user