@zzzen/pyright-internal 1.2.0-dev.20250420 → 1.2.0-dev.20250802
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyzer/analyzerNodeInfo.js +1 -1
- package/dist/analyzer/analyzerNodeInfo.js.map +1 -1
- package/dist/analyzer/binder.d.ts +2 -1
- package/dist/analyzer/binder.js +33 -18
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/checker.js +81 -44
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/codeFlowEngine.js +19 -7
- package/dist/analyzer/codeFlowEngine.js.map +1 -1
- package/dist/analyzer/codeFlowTypes.d.ts +9 -8
- package/dist/analyzer/codeFlowTypes.js +9 -8
- package/dist/analyzer/codeFlowTypes.js.map +1 -1
- package/dist/analyzer/codeFlowUtils.js +4 -2
- package/dist/analyzer/codeFlowUtils.js.map +1 -1
- package/dist/analyzer/docStringUtils.js +3 -1
- package/dist/analyzer/docStringUtils.js.map +1 -1
- package/dist/analyzer/importStatementUtils.js +5 -3
- package/dist/analyzer/importStatementUtils.js.map +1 -1
- package/dist/analyzer/operations.js +1 -1
- package/dist/analyzer/operations.js.map +1 -1
- package/dist/analyzer/packageTypeVerifier.js +5 -3
- package/dist/analyzer/packageTypeVerifier.js.map +1 -1
- package/dist/analyzer/parameterUtils.js +10 -3
- package/dist/analyzer/parameterUtils.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.d.ts +3 -4
- package/dist/analyzer/parseTreeUtils.js +19 -225
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/patternMatching.js +4 -0
- package/dist/analyzer/patternMatching.js.map +1 -1
- package/dist/analyzer/program.d.ts +12 -2
- package/dist/analyzer/program.js +74 -58
- package/dist/analyzer/program.js.map +1 -1
- package/dist/analyzer/properties.js +3 -5
- package/dist/analyzer/properties.js.map +1 -1
- package/dist/analyzer/protocols.js +13 -3
- package/dist/analyzer/protocols.js.map +1 -1
- package/dist/analyzer/sentinel.d.ts +4 -0
- package/dist/analyzer/sentinel.js +51 -0
- package/dist/analyzer/sentinel.js.map +1 -0
- package/dist/analyzer/service.d.ts +2 -2
- package/dist/analyzer/service.js +7 -6
- package/dist/analyzer/service.js.map +1 -1
- package/dist/analyzer/sourceFile.d.ts +4 -0
- package/dist/analyzer/sourceFile.js +52 -12
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/sourceFileInfo.d.ts +10 -1
- package/dist/analyzer/sourceFileInfo.js +28 -0
- package/dist/analyzer/sourceFileInfo.js.map +1 -1
- package/dist/analyzer/sourceFileInfoUtils.js +4 -4
- package/dist/analyzer/sourceFileInfoUtils.js.map +1 -1
- package/dist/analyzer/sourceMapper.d.ts +1 -1
- package/dist/analyzer/sourceMapper.js +20 -20
- package/dist/analyzer/sourceMapper.js.map +1 -1
- package/dist/analyzer/symbol.d.ts +3 -0
- package/dist/analyzer/symbol.js +11 -0
- package/dist/analyzer/symbol.js.map +1 -1
- package/dist/analyzer/testWalker.js +2 -13
- package/dist/analyzer/testWalker.js.map +1 -1
- package/dist/analyzer/tracePrinter.js +1 -1
- package/dist/analyzer/tracePrinter.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +261 -137
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.d.ts +8 -4
- package/dist/analyzer/typeEvaluatorTypes.js +15 -2
- package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
- package/dist/analyzer/typeGuards.js +47 -13
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typePrinter.js +10 -2
- package/dist/analyzer/typePrinter.js.map +1 -1
- package/dist/analyzer/typePrinterUtils.js +2 -2
- package/dist/analyzer/typePrinterUtils.js.map +1 -1
- package/dist/analyzer/typeUtils.d.ts +2 -0
- package/dist/analyzer/typeUtils.js +10 -0
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/typedDicts.js +9 -5
- package/dist/analyzer/typedDicts.js.map +1 -1
- package/dist/analyzer/types.d.ts +9 -2
- package/dist/analyzer/types.js +39 -1
- package/dist/analyzer/types.js.map +1 -1
- package/dist/commands/dumpFileDebugInfoCommand.d.ts +96 -0
- package/dist/commands/dumpFileDebugInfoCommand.js +13 -2
- package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
- package/dist/common/cancellationUtils.d.ts +1 -1
- package/dist/common/cancellationUtils.js +2 -2
- package/dist/common/cancellationUtils.js.map +1 -1
- package/dist/common/charCodes.d.ts +1 -1
- package/dist/common/charCodes.js +1 -1
- package/dist/common/charCodes.js.map +1 -1
- package/dist/common/configOptions.d.ts +1 -0
- package/dist/common/configOptions.js +5 -0
- package/dist/common/configOptions.js.map +1 -1
- package/dist/common/core.d.ts +1 -3
- package/dist/common/core.js +3 -4
- package/dist/common/core.js.map +1 -1
- package/dist/common/diagnostic.d.ts +1 -1
- package/dist/common/diagnosticRules.d.ts +1 -0
- package/dist/common/diagnosticRules.js +1 -0
- package/dist/common/diagnosticRules.js.map +1 -1
- package/dist/common/docRange.d.ts +6 -0
- package/dist/common/docRange.js +10 -0
- package/dist/common/docRange.js.map +1 -0
- package/dist/common/envVarUtils.js +1 -6
- package/dist/common/envVarUtils.js.map +1 -1
- package/dist/common/extensibility.d.ts +11 -2
- package/dist/common/extensibility.js.map +1 -1
- package/dist/common/fileBasedCancellationUtils.d.ts +1 -0
- package/dist/common/fileBasedCancellationUtils.js +1 -0
- package/dist/common/fileBasedCancellationUtils.js.map +1 -1
- package/dist/common/logTracker.d.ts +5 -1
- package/dist/common/logTracker.js +43 -26
- package/dist/common/logTracker.js.map +1 -1
- package/dist/common/pathUtils.d.ts +1 -1
- package/dist/common/pathUtils.js +3 -2
- package/dist/common/pathUtils.js.map +1 -1
- package/dist/common/realFileSystem.d.ts +1 -1
- package/dist/common/realFileSystem.js +2 -1
- package/dist/common/realFileSystem.js.map +1 -1
- package/dist/common/stringUtils.d.ts +0 -1
- package/dist/common/stringUtils.js +0 -42
- package/dist/common/stringUtils.js.map +1 -1
- package/dist/common/textEditTracker.js +5 -3
- package/dist/common/textEditTracker.js.map +1 -1
- package/dist/common/textRange.d.ts +5 -11
- package/dist/common/textRange.js +31 -56
- package/dist/common/textRange.js.map +1 -1
- package/dist/common/textRangeCollection.js +3 -2
- package/dist/common/textRangeCollection.js.map +1 -1
- package/dist/common/uri/baseUri.js +2 -1
- package/dist/common/uri/baseUri.js.map +1 -1
- package/dist/common/uri/uri.d.ts +5 -2
- package/dist/common/uri/uri.js +21 -5
- package/dist/common/uri/uri.js.map +1 -1
- package/dist/common/uri/uriUtils.d.ts +2 -2
- package/dist/common/uri/uriUtils.js +4 -3
- package/dist/common/uri/uriUtils.js.map +1 -1
- package/dist/common/workspaceEditUtils.js +9 -9
- package/dist/common/workspaceEditUtils.js.map +1 -1
- package/dist/languageServerBase.d.ts +5 -3
- package/dist/languageServerBase.js +44 -37
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/analyzerServiceExecutor.d.ts +3 -0
- package/dist/languageService/analyzerServiceExecutor.js +1 -0
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
- package/dist/languageService/autoImporter.d.ts +2 -2
- package/dist/languageService/autoImporter.js +3 -3
- package/dist/languageService/autoImporter.js.map +1 -1
- package/dist/languageService/callHierarchyProvider.js +2 -3
- package/dist/languageService/callHierarchyProvider.js.map +1 -1
- package/dist/languageService/completionProvider.js +16 -13
- package/dist/languageService/completionProvider.js.map +1 -1
- package/dist/languageService/definitionProvider.d.ts +2 -1
- package/dist/languageService/definitionProvider.js.map +1 -1
- package/dist/languageService/documentSymbolCollector.d.ts +4 -1
- package/dist/languageService/documentSymbolCollector.js +9 -7
- package/dist/languageService/documentSymbolCollector.js.map +1 -1
- package/dist/languageService/hoverProvider.js +1 -9
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/languageService/importSorter.js +1 -0
- package/dist/languageService/importSorter.js.map +1 -1
- package/dist/languageService/navigationUtils.d.ts +1 -1
- package/dist/languageService/referencesProvider.d.ts +2 -1
- package/dist/languageService/referencesProvider.js +8 -7
- package/dist/languageService/referencesProvider.js.map +1 -1
- package/dist/languageService/renameProvider.js +4 -19
- package/dist/languageService/renameProvider.js.map +1 -1
- package/dist/languageService/tooltipUtils.d.ts +2 -0
- package/dist/languageService/tooltipUtils.js +2 -0
- package/dist/languageService/tooltipUtils.js.map +1 -1
- package/dist/languageService/workspaceSymbolProvider.js +1 -1
- package/dist/languageService/workspaceSymbolProvider.js.map +1 -1
- package/dist/localization/localize.d.ts +12 -2
- package/dist/localization/localize.js +12 -2
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.cs.json +23 -9
- package/dist/localization/package.nls.de.json +18 -4
- package/dist/localization/package.nls.en-us.json +36 -2
- package/dist/localization/package.nls.es.json +18 -4
- package/dist/localization/package.nls.fr.json +22 -8
- package/dist/localization/package.nls.it.json +23 -9
- package/dist/localization/package.nls.ja.json +18 -4
- package/dist/localization/package.nls.ko.json +23 -9
- package/dist/localization/package.nls.pl.json +18 -4
- package/dist/localization/package.nls.pt-br.json +18 -4
- package/dist/localization/package.nls.qps-ploc.json +17 -3
- package/dist/localization/package.nls.ru.json +18 -4
- package/dist/localization/package.nls.tr.json +23 -9
- package/dist/localization/package.nls.zh-cn.json +18 -4
- package/dist/localization/package.nls.zh-tw.json +18 -4
- package/dist/parser/characters.d.ts +1 -8
- package/dist/parser/characters.js +6 -3
- package/dist/parser/characters.js.map +1 -1
- package/dist/parser/parseNodeUtils.d.ts +12 -0
- package/dist/parser/parseNodeUtils.js +136 -0
- package/dist/parser/parseNodeUtils.js.map +1 -0
- package/dist/parser/parseNodes.d.ts +12 -2
- package/dist/parser/parseNodes.js +17 -2
- package/dist/parser/parseNodes.js.map +1 -1
- package/dist/parser/parser.d.ts +3 -2
- package/dist/parser/parser.js +54 -47
- package/dist/parser/parser.js.map +1 -1
- package/dist/parser/tokenizer.d.ts +3 -3
- package/dist/parser/tokenizer.js +58 -38
- package/dist/parser/tokenizer.js.map +1 -1
- package/dist/parser/tokenizerTypes.d.ts +4 -3
- package/dist/parser/tokenizerTypes.js +4 -3
- package/dist/parser/tokenizerTypes.js.map +1 -1
- package/dist/pyright.js +1 -1
- package/dist/pyright.js.map +1 -1
- package/dist/server.js +3 -3
- package/dist/server.js.map +1 -1
- package/dist/tests/checker.test.js +2 -2
- package/dist/tests/common.test.js +6 -6
- package/dist/tests/common.test.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.unicode.fourslash.js +29 -0
- package/dist/tests/fourslash/completions.autoimport.unicode.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.method.fourslash.js +8 -8
- package/dist/tests/harness/fourslash/testState.d.ts +3 -2
- package/dist/tests/harness/fourslash/testState.js +9 -3
- package/dist/tests/harness/fourslash/testState.js.map +1 -1
- package/dist/tests/lsp/languageServer.js +1 -1
- package/dist/tests/lsp/languageServer.js.map +1 -1
- package/dist/tests/lsp/languageServerTestUtils.d.ts +1 -2
- package/dist/tests/lsp/languageServerTestUtils.js +2 -2
- package/dist/tests/lsp/languageServerTestUtils.js.map +1 -1
- package/dist/tests/positionUtils.test.js +1 -1
- package/dist/tests/service.test.js +4 -4
- package/dist/tests/service.test.js.map +1 -1
- package/dist/tests/sourceFile.test.js +19 -1
- package/dist/tests/sourceFile.test.js.map +1 -1
- package/dist/tests/stringUtils.test.js +0 -12
- package/dist/tests/stringUtils.test.js.map +1 -1
- package/dist/tests/testStateUtils.js +8 -3
- package/dist/tests/testStateUtils.js.map +1 -1
- package/dist/tests/tokenizer.test.js +5 -5
- package/dist/tests/tokenizer.test.js.map +1 -1
- package/dist/tests/typeEvaluator1.test.js +11 -13
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator2.test.js +15 -1
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +16 -1
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/tests/typeEvaluator5.test.js +9 -3
- package/dist/tests/typeEvaluator5.test.js.map +1 -1
- package/dist/tests/typeEvaluator6.test.js +1 -1
- package/dist/tests/typeEvaluator7.test.js +9 -0
- package/dist/tests/typeEvaluator7.test.js.map +1 -1
- package/dist/tests/typeEvaluator8.test.js +4 -0
- package/dist/tests/typeEvaluator8.test.js.map +1 -1
- package/dist/tests/workspaceEditUtils.test.js +7 -9
- package/dist/tests/workspaceEditUtils.test.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/workspaceFactory.d.ts +12 -1
- package/dist/workspaceFactory.js.map +1 -1
- package/package.json +2 -3
- package/dist/tests/fourslash/rename.args.fourslash.js +0 -72
- package/dist/tests/fourslash/rename.args.fourslash.js.map +0 -1
- /package/dist/tests/fourslash/{rename.args.fourslash.d.ts → completions.autoimport.unicode.fourslash.d.ts} +0 -0
|
@@ -8,7 +8,7 @@ import { EditableProgram, ProgramView } from '../common/extensibility';
|
|
|
8
8
|
import { LogTracker } from '../common/logTracker';
|
|
9
9
|
import { ServiceProvider } from '../common/serviceProvider';
|
|
10
10
|
import '../common/serviceProviderExtensions';
|
|
11
|
-
import { Range } from '../common/textRange';
|
|
11
|
+
import { Range, TextRange } from '../common/textRange';
|
|
12
12
|
import { Uri } from '../common/uri/uri';
|
|
13
13
|
import { ParseFileResults, ParserOutput } from '../parser/parser';
|
|
14
14
|
import { RequiringAnalysisCount } from './analysis';
|
|
@@ -16,7 +16,7 @@ import { ImportResolver } from './importResolver';
|
|
|
16
16
|
import { IPythonMode, SourceFile } from './sourceFile';
|
|
17
17
|
import { SourceFileInfo } from './sourceFileInfo';
|
|
18
18
|
import { SourceMapper } from './sourceMapper';
|
|
19
|
-
import { Symbol } from './symbol';
|
|
19
|
+
import { Symbol, SymbolTable } from './symbol';
|
|
20
20
|
import { PrintTypeOptions, TypeEvaluator } from './typeEvaluatorTypes';
|
|
21
21
|
import { Type } from './types';
|
|
22
22
|
export interface MaxAnalysisTime {
|
|
@@ -24,10 +24,15 @@ export interface MaxAnalysisTime {
|
|
|
24
24
|
noOpenFilesTimeInMs: number;
|
|
25
25
|
}
|
|
26
26
|
export type PreCheckCallback = (parserOutput: ParserOutput, evaluator: TypeEvaluator) => void;
|
|
27
|
+
export interface ChangedRange {
|
|
28
|
+
range: TextRange;
|
|
29
|
+
delta: number;
|
|
30
|
+
}
|
|
27
31
|
export interface OpenFileOptions {
|
|
28
32
|
isTracked: boolean;
|
|
29
33
|
ipythonMode: IPythonMode;
|
|
30
34
|
chainedFileUri: Uri | undefined;
|
|
35
|
+
changedRange?: ChangedRange;
|
|
31
36
|
}
|
|
32
37
|
export declare class Program {
|
|
33
38
|
readonly serviceProvider: ServiceProvider;
|
|
@@ -43,6 +48,7 @@ export declare class Program {
|
|
|
43
48
|
private _configOptions;
|
|
44
49
|
private _importResolver;
|
|
45
50
|
private _evaluator;
|
|
51
|
+
private _disposed;
|
|
46
52
|
private _parsedFileCount;
|
|
47
53
|
private _preCheckCallback;
|
|
48
54
|
private _editModeTracker;
|
|
@@ -55,6 +61,7 @@ export declare class Program {
|
|
|
55
61
|
get configOptions(): ConfigOptions;
|
|
56
62
|
get importResolver(): ImportResolver;
|
|
57
63
|
get fileSystem(): import("../common/fileSystem").FileSystem;
|
|
64
|
+
get isDisposed(): boolean;
|
|
58
65
|
dispose(): void;
|
|
59
66
|
enterEditMode(): void;
|
|
60
67
|
exitEditMode(): FileEditAction[];
|
|
@@ -87,6 +94,7 @@ export declare class Program {
|
|
|
87
94
|
getBoundSourceFile(uri: Uri): SourceFile | undefined;
|
|
88
95
|
getSourceFileInfoList(): readonly SourceFileInfo[];
|
|
89
96
|
getSourceFileInfo(uri: Uri): SourceFileInfo | undefined;
|
|
97
|
+
getModuleSymbolTable(fileUri: Uri): SymbolTable | undefined;
|
|
90
98
|
getBoundSourceFileInfo(uri: Uri, content?: string, force?: boolean): SourceFileInfo | undefined;
|
|
91
99
|
analyze(maxTime?: MaxAnalysisTime, token?: CancellationToken): boolean;
|
|
92
100
|
analyzeFile(fileUri: Uri, token?: CancellationToken): boolean;
|
|
@@ -96,6 +104,7 @@ export declare class Program {
|
|
|
96
104
|
getSourceMapper(fileUri: Uri, token: CancellationToken, mapCompiled?: boolean, preferStubs?: boolean): SourceMapper;
|
|
97
105
|
getParserOutput(fileUri: Uri): ParserOutput | undefined;
|
|
98
106
|
getParseResults(fileUri: Uri): ParseFileResults | undefined;
|
|
107
|
+
getParseDiagnostics(fileUri: Uri): Diagnostic[] | undefined;
|
|
99
108
|
handleMemoryHighUsage(): void;
|
|
100
109
|
printDetailedAnalysisTimes(): void;
|
|
101
110
|
printDependencies(projectRootDir: Uri, verbose: boolean): void;
|
|
@@ -108,6 +117,7 @@ export declare class Program {
|
|
|
108
117
|
clone(): Program;
|
|
109
118
|
getCacheUsage(): number;
|
|
110
119
|
emptyCache(): void;
|
|
120
|
+
bindShadowFile(stubFileUri: Uri, shadowFile: Uri): SourceFile | undefined;
|
|
111
121
|
private _handleMemoryHighUsage;
|
|
112
122
|
private _discardCachedParseResults;
|
|
113
123
|
private _runEvaluatorWithCancellationToken;
|
package/dist/analyzer/program.js
CHANGED
|
@@ -97,6 +97,7 @@ class Program {
|
|
|
97
97
|
this._disableChecker = _disableChecker;
|
|
98
98
|
this._sourceFileList = [];
|
|
99
99
|
this._sourceFileMap = new Map();
|
|
100
|
+
this._disposed = false;
|
|
100
101
|
this._parsedFileCount = 0;
|
|
101
102
|
this._editModeTracker = new EditModeTracker();
|
|
102
103
|
this._lookUpImport = (fileUriOrModule, options) => {
|
|
@@ -198,8 +199,12 @@ class Program {
|
|
|
198
199
|
get fileSystem() {
|
|
199
200
|
return this._importResolver.fileSystem;
|
|
200
201
|
}
|
|
202
|
+
get isDisposed() {
|
|
203
|
+
return this._disposed;
|
|
204
|
+
}
|
|
201
205
|
dispose() {
|
|
202
206
|
this._cacheManager.unregisterCacheOwner(this);
|
|
207
|
+
this._disposed = true;
|
|
203
208
|
}
|
|
204
209
|
enterEditMode() {
|
|
205
210
|
this._editModeTracker.enable();
|
|
@@ -218,10 +223,10 @@ class Program {
|
|
|
218
223
|
const newContents = fileInfo.restore();
|
|
219
224
|
if (newContents) {
|
|
220
225
|
// Create a text document so we can compute the edits.
|
|
221
|
-
const textDocument = vscode_languageserver_textdocument_1.TextDocument.create(fileInfo.
|
|
226
|
+
const textDocument = vscode_languageserver_textdocument_1.TextDocument.create(fileInfo.uri.toString(), 'python', 1, fileInfo.contents || '');
|
|
222
227
|
// Add an edit action to the list.
|
|
223
228
|
edits.push({
|
|
224
|
-
fileUri: fileInfo.
|
|
229
|
+
fileUri: fileInfo.uri,
|
|
225
230
|
range: {
|
|
226
231
|
start: { line: 0, character: 0 },
|
|
227
232
|
end: { line: textDocument.lineCount, character: 0 },
|
|
@@ -239,7 +244,7 @@ class Program {
|
|
|
239
244
|
// We don't need to care about file diagnostics since in edit mode
|
|
240
245
|
// checker won't run.
|
|
241
246
|
v.sourceFile.prepareForClose();
|
|
242
|
-
this._removeSourceFileFromListAndMap(v.
|
|
247
|
+
this._removeSourceFileFromListAndMap(v.uri, i);
|
|
243
248
|
}
|
|
244
249
|
}
|
|
245
250
|
}
|
|
@@ -273,7 +278,7 @@ class Program {
|
|
|
273
278
|
// Files that are not in the tracked file list are
|
|
274
279
|
// marked as no longer tracked.
|
|
275
280
|
this._sourceFileList.forEach((oldFile) => {
|
|
276
|
-
const fileUri = oldFile.
|
|
281
|
+
const fileUri = oldFile.uri;
|
|
277
282
|
if (!newFileMap.has(fileUri.key)) {
|
|
278
283
|
oldFile.isTracked = false;
|
|
279
284
|
}
|
|
@@ -322,8 +327,7 @@ class Program {
|
|
|
322
327
|
return sourceFileInfo.sourceFile;
|
|
323
328
|
}
|
|
324
329
|
const sourceFile = this._sourceFileFactory.createSourceFile(this.serviceProvider, fileUri, importName, isThirdPartyImport, isInPyTypedPackage, this._editModeTracker, this._console, this._logTracker);
|
|
325
|
-
sourceFileInfo = new sourceFileInfo_1.SourceFileInfo(sourceFile,
|
|
326
|
-
/* isTypeshedFile */ false, isThirdPartyImport, isInPyTypedPackage, this._editModeTracker, {
|
|
330
|
+
sourceFileInfo = new sourceFileInfo_1.SourceFileInfo(sourceFile, sourceFile.isTypingStubFile() || sourceFile.isTypeshedStubFile() || sourceFile.isBuiltInStubFile(), isThirdPartyImport, isInPyTypedPackage, this._editModeTracker, {
|
|
327
331
|
isTracked: true,
|
|
328
332
|
});
|
|
329
333
|
this._addToSourceFileListAndMap(sourceFileInfo);
|
|
@@ -359,7 +363,7 @@ class Program {
|
|
|
359
363
|
}
|
|
360
364
|
getChainedUri(fileUri) {
|
|
361
365
|
const sourceFileInfo = this.getSourceFileInfo(fileUri);
|
|
362
|
-
return sourceFileInfo?.chainedSourceFile?.
|
|
366
|
+
return sourceFileInfo?.chainedSourceFile?.uri;
|
|
363
367
|
}
|
|
364
368
|
updateChainedUri(fileUri, chainedFileUri) {
|
|
365
369
|
const sourceFileInfo = this.getSourceFileInfo(fileUri);
|
|
@@ -451,10 +455,10 @@ class Program {
|
|
|
451
455
|
return this._sourceFileList.filter((s) => s.isOpenByClient);
|
|
452
456
|
}
|
|
453
457
|
getOwnedFiles() {
|
|
454
|
-
return this._sourceFileList.filter((s) => (0, sourceFileInfoUtils_1.isUserCode)(s) && this.owns(s.
|
|
458
|
+
return this._sourceFileList.filter((s) => (0, sourceFileInfoUtils_1.isUserCode)(s) && this.owns(s.uri));
|
|
455
459
|
}
|
|
456
460
|
getCheckingRequiredFiles() {
|
|
457
|
-
return this._sourceFileList.filter((s) => s.isOpenByClient && this.owns(s.
|
|
461
|
+
return this._sourceFileList.filter((s) => s.isOpenByClient && this.owns(s.uri) && s.sourceFile.isCheckingRequired());
|
|
458
462
|
}
|
|
459
463
|
getFilesToAnalyzeCount() {
|
|
460
464
|
let filesToAnalyzeCount = 0;
|
|
@@ -485,7 +489,7 @@ class Program {
|
|
|
485
489
|
}
|
|
486
490
|
containsSourceFileIn(folder) {
|
|
487
491
|
for (const normalizedSourceFilePath of this._sourceFileMap.values()) {
|
|
488
|
-
if (normalizedSourceFilePath.
|
|
492
|
+
if (normalizedSourceFilePath.uri.startsWith(folder)) {
|
|
489
493
|
return true;
|
|
490
494
|
}
|
|
491
495
|
}
|
|
@@ -519,6 +523,13 @@ class Program {
|
|
|
519
523
|
}
|
|
520
524
|
return undefined;
|
|
521
525
|
}
|
|
526
|
+
getModuleSymbolTable(fileUri) {
|
|
527
|
+
const sourceFileInfo = this.getSourceFileInfo(fileUri);
|
|
528
|
+
if (sourceFileInfo) {
|
|
529
|
+
return sourceFileInfo.sourceFile.getModuleSymbolTable();
|
|
530
|
+
}
|
|
531
|
+
return undefined;
|
|
532
|
+
}
|
|
522
533
|
getBoundSourceFileInfo(uri, content, force) {
|
|
523
534
|
const sourceFileInfo = this.getSourceFileInfo(uri);
|
|
524
535
|
if (!sourceFileInfo) {
|
|
@@ -619,6 +630,11 @@ class Program {
|
|
|
619
630
|
/* content */ undefined,
|
|
620
631
|
/* force */ true)?.sourceFile.getParseResults();
|
|
621
632
|
}
|
|
633
|
+
getParseDiagnostics(fileUri) {
|
|
634
|
+
return this.getBoundSourceFileInfo(fileUri,
|
|
635
|
+
/* content */ undefined,
|
|
636
|
+
/* force */ true)?.sourceFile.getParseDiagnostics();
|
|
637
|
+
}
|
|
622
638
|
handleMemoryHighUsage() {
|
|
623
639
|
this._handleMemoryHighUsage();
|
|
624
640
|
}
|
|
@@ -634,7 +650,7 @@ class Program {
|
|
|
634
650
|
this._console.info('Analysis time by file');
|
|
635
651
|
sortedFiles.forEach((sfInfo) => {
|
|
636
652
|
const checkTimeInMs = sfInfo.sourceFile.getCheckTime();
|
|
637
|
-
this._console.info(`${checkTimeInMs}ms: ${sfInfo.
|
|
653
|
+
this._console.info(`${checkTimeInMs}ms: ${sfInfo.uri}`);
|
|
638
654
|
});
|
|
639
655
|
}
|
|
640
656
|
// Prints import dependency information for each of the files in
|
|
@@ -644,12 +660,12 @@ class Program {
|
|
|
644
660
|
const sortedFiles = this._sourceFileList
|
|
645
661
|
.filter((s) => !s.isTypeshedFile)
|
|
646
662
|
.sort((a, b) => {
|
|
647
|
-
return fs.getOriginalUri(a.
|
|
663
|
+
return fs.getOriginalUri(a.uri) < fs.getOriginalUri(b.uri) ? 1 : -1;
|
|
648
664
|
});
|
|
649
665
|
const zeroImportFiles = [];
|
|
650
666
|
sortedFiles.forEach((sfInfo) => {
|
|
651
667
|
this._console.info('');
|
|
652
|
-
const fileUri = fs.getOriginalUri(sfInfo.
|
|
668
|
+
const fileUri = fs.getOriginalUri(sfInfo.uri);
|
|
653
669
|
let fileString = fileUri.toString();
|
|
654
670
|
const relPath = projectRootDir.getRelativePathComponents(fileUri);
|
|
655
671
|
if (relPath) {
|
|
@@ -659,13 +675,13 @@ class Program {
|
|
|
659
675
|
this._console.info(` Imports ${sfInfo.imports.length} ` + `file${sfInfo.imports.length === 1 ? '' : 's'}`);
|
|
660
676
|
if (verbose) {
|
|
661
677
|
sfInfo.imports.forEach((importInfo) => {
|
|
662
|
-
this._console.info(` ${fs.getOriginalUri(importInfo.
|
|
678
|
+
this._console.info(` ${fs.getOriginalUri(importInfo.uri)}`);
|
|
663
679
|
});
|
|
664
680
|
}
|
|
665
681
|
this._console.info(` Imported by ${sfInfo.importedBy.length} ` + `file${sfInfo.importedBy.length === 1 ? '' : 's'}`);
|
|
666
682
|
if (verbose) {
|
|
667
683
|
sfInfo.importedBy.forEach((importInfo) => {
|
|
668
|
-
this._console.info(` ${fs.getOriginalUri(importInfo.
|
|
684
|
+
this._console.info(` ${fs.getOriginalUri(importInfo.uri)}`);
|
|
669
685
|
});
|
|
670
686
|
}
|
|
671
687
|
if (sfInfo.importedBy.length === 0) {
|
|
@@ -683,7 +699,7 @@ class Program {
|
|
|
683
699
|
writeTypeStub(targetImportPath, targetIsSingleFile, stubPath, token) {
|
|
684
700
|
for (const sourceFileInfo of this._sourceFileList) {
|
|
685
701
|
(0, cancellationUtils_1.throwIfCancellationRequested)(token);
|
|
686
|
-
const fileUri = sourceFileInfo.
|
|
702
|
+
const fileUri = sourceFileInfo.uri;
|
|
687
703
|
// Generate type stubs only for the files within the target path,
|
|
688
704
|
// not any files that the target module happened to import.
|
|
689
705
|
const relativePath = targetImportPath.getRelativePath(fileUri);
|
|
@@ -761,7 +777,7 @@ class Program {
|
|
|
761
777
|
diag.category !== 5 /* DiagnosticCategory.Deprecated */);
|
|
762
778
|
}
|
|
763
779
|
fileDiagnostics.push({
|
|
764
|
-
fileUri: sourceFileInfo.
|
|
780
|
+
fileUri: sourceFileInfo.uri,
|
|
765
781
|
version: sourceFileInfo.sourceFile.getClientVersion(),
|
|
766
782
|
diagnostics,
|
|
767
783
|
});
|
|
@@ -776,7 +792,7 @@ class Program {
|
|
|
776
792
|
// This condition occurs when the user switches from workspace to
|
|
777
793
|
// "open files only" mode. Clear all diagnostics for this file.
|
|
778
794
|
fileDiagnostics.push({
|
|
779
|
-
fileUri: sourceFileInfo.
|
|
795
|
+
fileUri: sourceFileInfo.uri,
|
|
780
796
|
version: sourceFileInfo.sourceFile.getClientVersion(),
|
|
781
797
|
diagnostics: [],
|
|
782
798
|
});
|
|
@@ -802,7 +818,7 @@ class Program {
|
|
|
802
818
|
const program = new Program(this._importResolver, this._configOptions, this.serviceProvider, new logTracker_1.LogTracker(this._console, 'Cloned'), this._disableChecker);
|
|
803
819
|
// Cloned program will use whatever user files the program currently has.
|
|
804
820
|
const userFiles = this.getUserFiles();
|
|
805
|
-
program.setTrackedFiles(userFiles.map((i) => i.
|
|
821
|
+
program.setTrackedFiles(userFiles.map((i) => i.uri));
|
|
806
822
|
program.markAllFilesDirty(/* evenIfContentsAreSame */ true);
|
|
807
823
|
// Make sure we keep editor content (open file) which could be different than one in the file system.
|
|
808
824
|
for (const fileInfo of this.getOpened()) {
|
|
@@ -810,9 +826,9 @@ class Program {
|
|
|
810
826
|
if (version === undefined) {
|
|
811
827
|
continue;
|
|
812
828
|
}
|
|
813
|
-
program.setFileOpened(fileInfo.
|
|
814
|
-
chainedFileUri: fileInfo.chainedSourceFile?.
|
|
815
|
-
ipythonMode: fileInfo.
|
|
829
|
+
program.setFileOpened(fileInfo.uri, version, fileInfo.sourceFile.getOpenFileContents() ?? '', {
|
|
830
|
+
chainedFileUri: fileInfo.chainedSourceFile?.uri,
|
|
831
|
+
ipythonMode: fileInfo.ipythonMode,
|
|
816
832
|
isTracked: fileInfo.isTracked,
|
|
817
833
|
});
|
|
818
834
|
}
|
|
@@ -835,6 +851,20 @@ class Program {
|
|
|
835
851
|
this._parsedFileCount = 0;
|
|
836
852
|
this.serviceProvider.tryGet(serviceKeys_1.ServiceKeys.stateMutationListeners)?.forEach((l) => l.onClearCache?.());
|
|
837
853
|
}
|
|
854
|
+
bindShadowFile(stubFileUri, shadowFile) {
|
|
855
|
+
let stubFileInfo = this.getSourceFileInfo(stubFileUri);
|
|
856
|
+
if (!stubFileInfo) {
|
|
857
|
+
// make sure uri exits before adding interimFile
|
|
858
|
+
if (!this.fileSystem.existsSync(stubFileUri)) {
|
|
859
|
+
return undefined;
|
|
860
|
+
}
|
|
861
|
+
// Special case for import statement like "import X.Y". The SourceFile
|
|
862
|
+
// for X might not be in memory since import `X.Y` only brings in Y.
|
|
863
|
+
stubFileInfo = this.addInterimFile(stubFileUri);
|
|
864
|
+
}
|
|
865
|
+
this._addShadowedFile(stubFileInfo, shadowFile);
|
|
866
|
+
return this.getBoundSourceFile(shadowFile);
|
|
867
|
+
}
|
|
838
868
|
_handleMemoryHighUsage() {
|
|
839
869
|
const cacheUsage = this._cacheManager.getCacheUsage();
|
|
840
870
|
const usedHeapRatio = this._cacheManager.getUsedHeapRatio(this._configOptions.verboseOutput ? this._console : undefined);
|
|
@@ -898,13 +928,13 @@ class Program {
|
|
|
898
928
|
// Clear only if there are any errors for this file.
|
|
899
929
|
if (fileInfo.diagnosticsVersion !== undefined) {
|
|
900
930
|
fileDiagnostics.push({
|
|
901
|
-
fileUri: fileInfo.
|
|
931
|
+
fileUri: fileInfo.uri,
|
|
902
932
|
version: fileInfo.sourceFile.getClientVersion(),
|
|
903
933
|
diagnostics: [],
|
|
904
934
|
});
|
|
905
935
|
}
|
|
906
936
|
fileInfo.sourceFile.prepareForClose();
|
|
907
|
-
this._removeSourceFileFromListAndMap(fileInfo.
|
|
937
|
+
this._removeSourceFileFromListAndMap(fileInfo.uri, i);
|
|
908
938
|
// Unlink any imports and remove them from the list if
|
|
909
939
|
// they are no longer referenced.
|
|
910
940
|
fileInfo.imports.forEach((importedFile) => {
|
|
@@ -922,13 +952,13 @@ class Program {
|
|
|
922
952
|
// Clear if there are any errors for this import.
|
|
923
953
|
if (importedFile.diagnosticsVersion !== undefined) {
|
|
924
954
|
fileDiagnostics.push({
|
|
925
|
-
fileUri: importedFile.
|
|
955
|
+
fileUri: importedFile.uri,
|
|
926
956
|
version: importedFile.sourceFile.getClientVersion(),
|
|
927
957
|
diagnostics: [],
|
|
928
958
|
});
|
|
929
959
|
}
|
|
930
960
|
importedFile.sourceFile.prepareForClose();
|
|
931
|
-
this._removeSourceFileFromListAndMap(importedFile.
|
|
961
|
+
this._removeSourceFileFromListAndMap(importedFile.uri, indexToRemove);
|
|
932
962
|
i--;
|
|
933
963
|
}
|
|
934
964
|
}
|
|
@@ -944,7 +974,7 @@ class Program {
|
|
|
944
974
|
// out the errors for the now-closed file.
|
|
945
975
|
if (!this._shouldCheckFile(fileInfo) && fileInfo.diagnosticsVersion !== undefined) {
|
|
946
976
|
fileDiagnostics.push({
|
|
947
|
-
fileUri: fileInfo.
|
|
977
|
+
fileUri: fileInfo.uri,
|
|
948
978
|
version: fileInfo.sourceFile.getClientVersion(),
|
|
949
979
|
diagnostics: [],
|
|
950
980
|
});
|
|
@@ -978,7 +1008,7 @@ class Program {
|
|
|
978
1008
|
if (fileInfo.isTracked || fileInfo.isOpenByClient || fileInfo.shadows.length > 0) {
|
|
979
1009
|
return true;
|
|
980
1010
|
}
|
|
981
|
-
const fileUri = fileInfo.
|
|
1011
|
+
const fileUri = fileInfo.uri;
|
|
982
1012
|
// Avoid infinite recursion.
|
|
983
1013
|
if (recursionSet.has(fileUri.key)) {
|
|
984
1014
|
return false;
|
|
@@ -992,20 +1022,7 @@ class Program {
|
|
|
992
1022
|
return false;
|
|
993
1023
|
}
|
|
994
1024
|
_createSourceMapper(execEnv, token, from, mapCompiled, preferStubs) {
|
|
995
|
-
const sourceMapper = new sourceMapper_1.SourceMapper(this._importResolver, execEnv, this._evaluator, (stubFileUri, implFileUri) => {
|
|
996
|
-
let stubFileInfo = this.getSourceFileInfo(stubFileUri);
|
|
997
|
-
if (!stubFileInfo) {
|
|
998
|
-
// make sure uri exits before adding interimFile
|
|
999
|
-
if (!this.fileSystem.existsSync(stubFileUri)) {
|
|
1000
|
-
return undefined;
|
|
1001
|
-
}
|
|
1002
|
-
// Special case for import statement like "import X.Y". The SourceFile
|
|
1003
|
-
// for X might not be in memory since import `X.Y` only brings in Y.
|
|
1004
|
-
stubFileInfo = this.addInterimFile(stubFileUri);
|
|
1005
|
-
}
|
|
1006
|
-
this._addShadowedFile(stubFileInfo, implFileUri);
|
|
1007
|
-
return this.getBoundSourceFile(implFileUri);
|
|
1008
|
-
}, (f) => {
|
|
1025
|
+
const sourceMapper = new sourceMapper_1.SourceMapper(this._importResolver, execEnv, this._evaluator, (stubFileUri, implFileUri) => this.bindShadowFile(stubFileUri, implFileUri), (f) => {
|
|
1009
1026
|
let fileInfo = this.getBoundSourceFileInfo(f);
|
|
1010
1027
|
if (!fileInfo) {
|
|
1011
1028
|
// make sure uri exits before adding interimFile
|
|
@@ -1120,7 +1137,7 @@ class Program {
|
|
|
1120
1137
|
sourceFileInfo.chainedSourceFile = undefined;
|
|
1121
1138
|
}
|
|
1122
1139
|
else {
|
|
1123
|
-
const fileUri = sourceFileInfo.chainedSourceFile.
|
|
1140
|
+
const fileUri = sourceFileInfo.chainedSourceFile.uri;
|
|
1124
1141
|
newImportPathMap.set(fileUri.key, {
|
|
1125
1142
|
path: fileUri,
|
|
1126
1143
|
isTypeshedFile: false,
|
|
@@ -1167,7 +1184,7 @@ class Program {
|
|
|
1167
1184
|
if (!sourceFileInfo.sourceFile.isStubFile() && !importResult.isStdlibTypeshedFile) {
|
|
1168
1185
|
if (options.verboseOutput) {
|
|
1169
1186
|
this._console.info(`Could not resolve source for '${importResult.importName}' ` +
|
|
1170
|
-
`in file '${sourceFileInfo.
|
|
1187
|
+
`in file '${sourceFileInfo.uri.toUserVisibleString()}'`);
|
|
1171
1188
|
if (importResult.nonStubImportResult.importFailureInfo) {
|
|
1172
1189
|
importResult.nonStubImportResult.importFailureInfo.forEach((diag) => {
|
|
1173
1190
|
this._console.info(` ${diag}`);
|
|
@@ -1179,7 +1196,7 @@ class Program {
|
|
|
1179
1196
|
}
|
|
1180
1197
|
else if (options.verboseOutput) {
|
|
1181
1198
|
this._console.info(`Could not import '${importResult.importName}' ` +
|
|
1182
|
-
`in file '${sourceFileInfo.
|
|
1199
|
+
`in file '${sourceFileInfo.uri.toUserVisibleString()}'`);
|
|
1183
1200
|
if (importResult.importFailureInfo) {
|
|
1184
1201
|
importResult.importFailureInfo.forEach((diag) => {
|
|
1185
1202
|
this._console.info(` ${diag}`);
|
|
@@ -1189,11 +1206,11 @@ class Program {
|
|
|
1189
1206
|
});
|
|
1190
1207
|
const updatedImportMap = new Map();
|
|
1191
1208
|
sourceFileInfo.imports.forEach((importInfo) => {
|
|
1192
|
-
const oldFilePath = importInfo.
|
|
1209
|
+
const oldFilePath = importInfo.uri;
|
|
1193
1210
|
// A previous import was removed.
|
|
1194
1211
|
if (!newImportPathMap.has(oldFilePath.key)) {
|
|
1195
1212
|
importInfo.mutate((s) => {
|
|
1196
|
-
s.importedBy = s.importedBy.filter((fi) => !fi.
|
|
1213
|
+
s.importedBy = s.importedBy.filter((fi) => !fi.uri.equals(sourceFileInfo.uri));
|
|
1197
1214
|
});
|
|
1198
1215
|
}
|
|
1199
1216
|
else {
|
|
@@ -1246,7 +1263,7 @@ class Program {
|
|
|
1246
1263
|
this._sourceFileList.splice(indexToRemove, 1);
|
|
1247
1264
|
}
|
|
1248
1265
|
_addToSourceFileListAndMap(fileInfo) {
|
|
1249
|
-
const fileUri = fileInfo.
|
|
1266
|
+
const fileUri = fileInfo.uri;
|
|
1250
1267
|
// We should never add a file with the same path twice.
|
|
1251
1268
|
(0, debug_1.assert)(!this._sourceFileMap.has(fileUri.key));
|
|
1252
1269
|
// We should never have an empty URI for a source file.
|
|
@@ -1350,7 +1367,7 @@ class Program {
|
|
|
1350
1367
|
const implicitSet = new Set();
|
|
1351
1368
|
let nextImplicitImport = this._getImplicitImports(fileToAnalyze);
|
|
1352
1369
|
while (nextImplicitImport) {
|
|
1353
|
-
const implicitPath = nextImplicitImport.
|
|
1370
|
+
const implicitPath = nextImplicitImport.uri;
|
|
1354
1371
|
if (implicitSet.has(implicitPath.key)) {
|
|
1355
1372
|
// We've found a cycle. Break out of the loop.
|
|
1356
1373
|
debug.fail(this.serviceProvider
|
|
@@ -1441,7 +1458,7 @@ class Program {
|
|
|
1441
1458
|
return false;
|
|
1442
1459
|
}
|
|
1443
1460
|
_checkTypes(fileToCheck, token, chainedByList) {
|
|
1444
|
-
return this._logTracker.log(`analyzing: ${fileToCheck.
|
|
1461
|
+
return this._logTracker.log(`analyzing: ${fileToCheck.uri}`, (logState) => {
|
|
1445
1462
|
// If the file isn't needed because it was eliminated from the
|
|
1446
1463
|
// transitive closure or deleted, skip the file rather than wasting
|
|
1447
1464
|
// time on it.
|
|
@@ -1475,7 +1492,7 @@ class Program {
|
|
|
1475
1492
|
}
|
|
1476
1493
|
}
|
|
1477
1494
|
if (boundFile) {
|
|
1478
|
-
const execEnv = this._configOptions.findExecEnvironment(fileToCheck.
|
|
1495
|
+
const execEnv = this._configOptions.findExecEnvironment(fileToCheck.uri);
|
|
1479
1496
|
fileToCheck.sourceFile.check(this.configOptions, this._lookUpImport, this._importResolver, this._evaluator, this._createSourceMapper(execEnv, token, fileToCheck), dependentFiles);
|
|
1480
1497
|
}
|
|
1481
1498
|
}
|
|
@@ -1487,8 +1504,7 @@ class Program {
|
|
|
1487
1504
|
// Don't detect import cycles when doing type stub generation. Some
|
|
1488
1505
|
// third-party modules are pretty convoluted.
|
|
1489
1506
|
// Or if the file is the notebook cell. notebook cell can't have cycles.
|
|
1490
|
-
if (!this._allowedThirdPartyImports &&
|
|
1491
|
-
fileToCheck.sourceFile.getIPythonMode() !== sourceFile_1.IPythonMode.CellDocs) {
|
|
1507
|
+
if (!this._allowedThirdPartyImports && fileToCheck.ipythonMode !== sourceFile_1.IPythonMode.CellDocs) {
|
|
1492
1508
|
// We need to force all of the files to be parsed and build
|
|
1493
1509
|
// a closure map for the files.
|
|
1494
1510
|
const closureMap = new Map();
|
|
@@ -1512,7 +1528,7 @@ class Program {
|
|
|
1512
1528
|
});
|
|
1513
1529
|
}
|
|
1514
1530
|
_checkDependentFiles(fileToCheck, chainedByList, token) {
|
|
1515
|
-
if (fileToCheck.
|
|
1531
|
+
if (fileToCheck.ipythonMode !== sourceFile_1.IPythonMode.CellDocs) {
|
|
1516
1532
|
return undefined;
|
|
1517
1533
|
}
|
|
1518
1534
|
// If we don't have chainedByList, it means none of them are checked yet.
|
|
@@ -1567,7 +1583,7 @@ class Program {
|
|
|
1567
1583
|
_getImportsRecursive(file, closureMap, recursionCount) {
|
|
1568
1584
|
// If the file is already in the closure map, we found a cyclical
|
|
1569
1585
|
// dependency. Don't recur further.
|
|
1570
|
-
const fileUri = file.
|
|
1586
|
+
const fileUri = file.uri;
|
|
1571
1587
|
if (closureMap.has(fileUri.key)) {
|
|
1572
1588
|
return;
|
|
1573
1589
|
}
|
|
@@ -1601,7 +1617,7 @@ class Program {
|
|
|
1601
1617
|
if (sourceFileInfo.sourceFile.isNoCircularDependencyConfirmed()) {
|
|
1602
1618
|
return false;
|
|
1603
1619
|
}
|
|
1604
|
-
const fileUri = sourceFileInfo.
|
|
1620
|
+
const fileUri = sourceFileInfo.uri;
|
|
1605
1621
|
filesVisited.set(fileUri.key, sourceFileInfo);
|
|
1606
1622
|
let detectedCycle = false;
|
|
1607
1623
|
if (dependencyMap.has(fileUri.key)) {
|
|
@@ -1645,7 +1661,7 @@ class Program {
|
|
|
1645
1661
|
_logImportCycle(dependencyChain) {
|
|
1646
1662
|
const circDep = new circularDependency_1.CircularDependency();
|
|
1647
1663
|
dependencyChain.forEach((sourceFileInfo) => {
|
|
1648
|
-
circDep.appendPath(sourceFileInfo.
|
|
1664
|
+
circDep.appendPath(sourceFileInfo.uri);
|
|
1649
1665
|
});
|
|
1650
1666
|
circDep.normalizeOrder();
|
|
1651
1667
|
const firstFilePath = circDep.getPaths()[0];
|
|
@@ -1654,7 +1670,7 @@ class Program {
|
|
|
1654
1670
|
firstSourceFile.sourceFile.addCircularDependency(this.configOptions, circDep);
|
|
1655
1671
|
}
|
|
1656
1672
|
_markFileDirtyRecursive(sourceFileInfo, markSet, forceRebinding = false) {
|
|
1657
|
-
const fileUri = sourceFileInfo.
|
|
1673
|
+
const fileUri = sourceFileInfo.uri;
|
|
1658
1674
|
// Don't mark it again if it's already been visited.
|
|
1659
1675
|
if (markSet.has(fileUri.key)) {
|
|
1660
1676
|
return;
|