@zzzen/pyright-internal 1.2.0-dev.20260809 → 1.2.0-dev.20260823
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.d.ts +119 -24
- package/dist/analyzer/analyzerNodeInfo.js +408 -89
- package/dist/analyzer/analyzerNodeInfo.js.map +1 -1
- package/dist/analyzer/binder.d.ts +6 -3
- package/dist/analyzer/binder.js +157 -70
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/checker.d.ts +5 -2
- package/dist/analyzer/checker.js +92 -34
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/codeFlowEngine.d.ts +2 -1
- package/dist/analyzer/codeFlowEngine.js +12 -10
- package/dist/analyzer/codeFlowEngine.js.map +1 -1
- package/dist/analyzer/codeFlowUtils.d.ts +2 -1
- package/dist/analyzer/codeFlowUtils.js +2 -3
- package/dist/analyzer/codeFlowUtils.js.map +1 -1
- package/dist/analyzer/constraintSolver.js +47 -7
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/constructors.js +18 -8
- package/dist/analyzer/constructors.js.map +1 -1
- package/dist/analyzer/dataClasses.d.ts +6 -4
- package/dist/analyzer/dataClasses.js +119 -75
- package/dist/analyzer/dataClasses.js.map +1 -1
- package/dist/analyzer/declarationUtils.d.ts +2 -1
- package/dist/analyzer/declarationUtils.js +2 -2
- package/dist/analyzer/declarationUtils.js.map +1 -1
- package/dist/analyzer/decorators.d.ts +5 -4
- package/dist/analyzer/decorators.js +38 -21
- package/dist/analyzer/decorators.js.map +1 -1
- package/dist/analyzer/enums.d.ts +5 -4
- package/dist/analyzer/enums.js +11 -10
- package/dist/analyzer/enums.js.map +1 -1
- package/dist/analyzer/importResolver.d.ts +1 -1
- package/dist/analyzer/importResolver.js +5 -3
- package/dist/analyzer/importResolver.js.map +1 -1
- package/dist/analyzer/importStatementUtils.d.ts +3 -1
- package/dist/analyzer/importStatementUtils.js +14 -7
- package/dist/analyzer/importStatementUtils.js.map +1 -1
- package/dist/analyzer/namedTuples.d.ts +2 -1
- package/dist/analyzer/namedTuples.js +3 -4
- package/dist/analyzer/namedTuples.js.map +1 -1
- package/dist/analyzer/operations.d.ts +3 -2
- package/dist/analyzer/operations.js +8 -8
- package/dist/analyzer/operations.js.map +1 -1
- package/dist/analyzer/packageTypeVerifier.js +2 -2
- package/dist/analyzer/packageTypeVerifier.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.d.ts +13 -11
- package/dist/analyzer/parseTreeUtils.js +62 -36
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/parseTreeWalker.d.ts +7 -2
- package/dist/analyzer/parseTreeWalker.js +29 -175
- package/dist/analyzer/parseTreeWalker.js.map +1 -1
- package/dist/analyzer/patternMatching.d.ts +4 -3
- package/dist/analyzer/patternMatching.js +47 -43
- package/dist/analyzer/patternMatching.js.map +1 -1
- package/dist/analyzer/program.d.ts +12 -0
- package/dist/analyzer/program.js +235 -29
- package/dist/analyzer/program.js.map +1 -1
- package/dist/analyzer/properties.d.ts +4 -3
- package/dist/analyzer/properties.js +7 -8
- package/dist/analyzer/properties.js.map +1 -1
- package/dist/analyzer/protocols.js +14 -2
- package/dist/analyzer/protocols.js.map +1 -1
- package/dist/analyzer/scope.d.ts +3 -0
- package/dist/analyzer/scope.js +10 -0
- package/dist/analyzer/scope.js.map +1 -1
- package/dist/analyzer/scopeUtils.d.ts +4 -3
- package/dist/analyzer/scopeUtils.js +8 -8
- package/dist/analyzer/scopeUtils.js.map +1 -1
- package/dist/analyzer/sentinel.d.ts +2 -1
- package/dist/analyzer/sentinel.js +2 -3
- package/dist/analyzer/sentinel.js.map +1 -1
- package/dist/analyzer/service.js +28 -10
- package/dist/analyzer/service.js.map +1 -1
- package/dist/analyzer/sourceEnumerator.d.ts +5 -0
- package/dist/analyzer/sourceEnumerator.js +57 -3
- package/dist/analyzer/sourceEnumerator.js.map +1 -1
- package/dist/analyzer/sourceFile.d.ts +12 -6
- package/dist/analyzer/sourceFile.js +73 -50
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/sourceFileInfoUtils.d.ts +1 -0
- package/dist/analyzer/sourceFileInfoUtils.js +8 -0
- package/dist/analyzer/sourceFileInfoUtils.js.map +1 -1
- package/dist/analyzer/sourceMapper.d.ts +4 -1
- package/dist/analyzer/sourceMapper.js +14 -8
- package/dist/analyzer/sourceMapper.js.map +1 -1
- package/dist/analyzer/symbol.d.ts +4 -1
- package/dist/analyzer/symbol.js +8 -0
- package/dist/analyzer/symbol.js.map +1 -1
- package/dist/analyzer/testWalker.js +2 -1
- package/dist/analyzer/testWalker.js.map +1 -1
- package/dist/analyzer/tracePrinter.d.ts +2 -1
- package/dist/analyzer/tracePrinter.js +2 -2
- package/dist/analyzer/tracePrinter.js.map +1 -1
- package/dist/analyzer/tuples.d.ts +3 -2
- package/dist/analyzer/tuples.js +5 -5
- package/dist/analyzer/tuples.js.map +1 -1
- package/dist/analyzer/typeCacheUtils.d.ts +6 -2
- package/dist/analyzer/typeCacheUtils.js +16 -37
- package/dist/analyzer/typeCacheUtils.js.map +1 -1
- package/dist/analyzer/typeDocStringUtils.d.ts +5 -7
- package/dist/analyzer/typeDocStringUtils.js +229 -132
- package/dist/analyzer/typeDocStringUtils.js.map +1 -1
- package/dist/analyzer/typeEvaluator.d.ts +2 -0
- package/dist/analyzer/typeEvaluator.js +1280 -302
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.d.ts +2 -0
- package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
- package/dist/analyzer/typeGuards.d.ts +3 -2
- package/dist/analyzer/typeGuards.js +37 -33
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typeStubWriter.js +12 -9
- package/dist/analyzer/typeStubWriter.js.map +1 -1
- package/dist/analyzer/typeUtils.js +3 -1
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/typedDicts.d.ts +4 -3
- package/dist/analyzer/typedDicts.js +15 -14
- package/dist/analyzer/typedDicts.js.map +1 -1
- package/dist/analyzer/types.d.ts +11 -1
- package/dist/analyzer/types.js +48 -0
- package/dist/analyzer/types.js.map +1 -1
- package/dist/commands/dumpFileDebugInfoCommand.js +1 -1
- package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
- package/dist/common/collectionUtils.js +15 -6
- package/dist/common/collectionUtils.js.map +1 -1
- package/dist/common/commandLineOptions.d.ts +1 -0
- package/dist/common/commandLineOptions.js.map +1 -1
- package/dist/common/configOptions.d.ts +4 -1
- package/dist/common/configOptions.js +68 -12
- package/dist/common/configOptions.js.map +1 -1
- package/dist/common/envVarUtils.d.ts +1 -0
- package/dist/common/envVarUtils.js +41 -10
- package/dist/common/envVarUtils.js.map +1 -1
- package/dist/common/extensibility.d.ts +3 -1
- package/dist/common/extensibility.js.map +1 -1
- package/dist/common/extraPathGlob.d.ts +12 -0
- package/dist/common/extraPathGlob.js +315 -0
- package/dist/common/extraPathGlob.js.map +1 -0
- package/dist/common/host.d.ts +2 -0
- package/dist/common/host.js.map +1 -1
- package/dist/common/languageServerInterface.d.ts +2 -1
- package/dist/common/languageServerInterface.js.map +1 -1
- package/dist/common/pathConsts.d.ts +1 -0
- package/dist/common/pathConsts.js +11 -1
- package/dist/common/pathConsts.js.map +1 -1
- package/dist/common/processUtils.d.ts +4 -2
- package/dist/common/processUtils.js +3 -0
- package/dist/common/processUtils.js.map +1 -1
- package/dist/common/stringUtils.d.ts +6 -0
- package/dist/common/stringUtils.js +87 -5
- package/dist/common/stringUtils.js.map +1 -1
- package/dist/common/textEditTracker.d.ts +3 -1
- package/dist/common/textEditTracker.js +8 -6
- package/dist/common/textEditTracker.js.map +1 -1
- package/dist/common/textRangeCollection.d.ts +1 -0
- package/dist/common/textRangeCollection.js +32 -1
- package/dist/common/textRangeCollection.js.map +1 -1
- package/dist/common/uri/uriUtils.d.ts +3 -0
- package/dist/common/uri/uriUtils.js +65 -15
- package/dist/common/uri/uriUtils.js.map +1 -1
- package/dist/fileSystemMapping.d.ts +10 -0
- package/dist/fileSystemMapping.js +176 -0
- package/dist/fileSystemMapping.js.map +1 -0
- package/dist/languageService/analyzerServiceExecutor.js +2 -1
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
- package/dist/languageService/autoImporter.d.ts +1 -0
- package/dist/languageService/autoImporter.js +32 -5
- package/dist/languageService/autoImporter.js.map +1 -1
- package/dist/languageService/callHierarchyProvider.d.ts +7 -0
- package/dist/languageService/callHierarchyProvider.js +97 -11
- package/dist/languageService/callHierarchyProvider.js.map +1 -1
- package/dist/languageService/completionProvider.d.ts +30 -8
- package/dist/languageService/completionProvider.js +298 -93
- package/dist/languageService/completionProvider.js.map +1 -1
- package/dist/languageService/definitionProvider.js +7 -6
- package/dist/languageService/definitionProvider.js.map +1 -1
- package/dist/languageService/documentHighlightProvider.js +2 -1
- package/dist/languageService/documentHighlightProvider.js.map +1 -1
- package/dist/languageService/documentSymbolCollector.d.ts +3 -1
- package/dist/languageService/documentSymbolCollector.js +78 -14
- package/dist/languageService/documentSymbolCollector.js.map +1 -1
- package/dist/languageService/documentSymbolProvider.js +3 -2
- package/dist/languageService/documentSymbolProvider.js.map +1 -1
- package/dist/languageService/fileWatcherDynamicFeature.js +28 -1
- package/dist/languageService/fileWatcherDynamicFeature.js.map +1 -1
- package/dist/languageService/hoverProvider.d.ts +2 -1
- package/dist/languageService/hoverProvider.js +48 -16
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/languageService/importSorter.d.ts +3 -1
- package/dist/languageService/importSorter.js +4 -2
- package/dist/languageService/importSorter.js.map +1 -1
- package/dist/languageService/importStatementCandidates.js +4 -2
- package/dist/languageService/importStatementCandidates.js.map +1 -1
- package/dist/languageService/quickActions.js +2 -1
- package/dist/languageService/quickActions.js.map +1 -1
- package/dist/languageService/referencesProvider.js +12 -5
- package/dist/languageService/referencesProvider.js.map +1 -1
- package/dist/languageService/signatureHelpProvider.d.ts +3 -0
- package/dist/languageService/signatureHelpProvider.js +56 -18
- package/dist/languageService/signatureHelpProvider.js.map +1 -1
- package/dist/languageService/symbolIndexer.d.ts +2 -1
- package/dist/languageService/symbolIndexer.js +7 -7
- package/dist/languageService/symbolIndexer.js.map +1 -1
- package/dist/languageService/tooltipUtils.d.ts +1 -1
- package/dist/languageService/tooltipUtils.js +103 -35
- package/dist/languageService/tooltipUtils.js.map +1 -1
- package/dist/languageService/workspaceSymbolProvider.js +3 -2
- package/dist/languageService/workspaceSymbolProvider.js.map +1 -1
- package/dist/localization/localize.d.ts +12 -0
- package/dist/localization/localize.js +14 -0
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.cs.json +11 -0
- package/dist/localization/package.nls.de.json +11 -0
- package/dist/localization/package.nls.en-us.json +18 -0
- package/dist/localization/package.nls.es.json +11 -0
- package/dist/localization/package.nls.fr.json +11 -0
- package/dist/localization/package.nls.it.json +11 -0
- package/dist/localization/package.nls.ja.json +11 -0
- package/dist/localization/package.nls.ko.json +11 -0
- package/dist/localization/package.nls.pl.json +11 -0
- package/dist/localization/package.nls.pt-br.json +11 -0
- package/dist/localization/package.nls.qps-ploc.json +11 -0
- package/dist/localization/package.nls.ru.json +11 -0
- package/dist/localization/package.nls.tr.json +11 -0
- package/dist/localization/package.nls.zh-cn.json +12 -1
- package/dist/localization/package.nls.zh-tw.json +13 -2
- package/dist/parser/parseNodes.d.ts +85 -80
- package/dist/parser/parseNodes.js +182 -159
- package/dist/parser/parseNodes.js.map +1 -1
- package/dist/parser/parseTreeUtils.d.ts +3 -0
- package/dist/parser/parseTreeUtils.js +209 -0
- package/dist/parser/parseTreeUtils.js.map +1 -0
- package/dist/parser/parser.d.ts +16 -6
- package/dist/parser/parser.js +210 -144
- package/dist/parser/parser.js.map +1 -1
- package/dist/parser/stringAnnotationInfo.d.ts +16 -0
- package/dist/parser/stringAnnotationInfo.js +26 -0
- package/dist/parser/stringAnnotationInfo.js.map +1 -0
- package/dist/readonlyAugmentedFileSystem.d.ts +2 -9
- package/dist/readonlyAugmentedFileSystem.js +17 -144
- package/dist/readonlyAugmentedFileSystem.js.map +1 -1
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/dist/tests/analyzerNodeInfo.test.d.ts +1 -0
- package/dist/tests/analyzerNodeInfo.test.js +113 -0
- package/dist/tests/analyzerNodeInfo.test.js.map +1 -0
- package/dist/tests/collectionUtils.test.js +46 -0
- package/dist/tests/collectionUtils.test.js.map +1 -1
- package/dist/tests/completions.test.js +34 -0
- package/dist/tests/completions.test.js.map +1 -1
- package/dist/tests/config.test.js +131 -6
- package/dist/tests/config.test.js.map +1 -1
- package/dist/tests/extraPathGlob.test.d.ts +1 -0
- package/dist/tests/extraPathGlob.test.js +434 -0
- package/dist/tests/extraPathGlob.test.js.map +1 -0
- package/dist/tests/fileSystemMapping.test.d.ts +1 -0
- package/dist/tests/fileSystemMapping.test.js +458 -0
- package/dist/tests/fileSystemMapping.test.js.map +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.js +23 -0
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.js +14 -0
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.js +7 -0
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.callSite.isinstanceNarrowing.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.callSite.isinstanceNarrowing.fourslash.js +41 -0
- package/dist/tests/fourslash/completions.callSite.isinstanceNarrowing.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.js +2 -0
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.js +5 -0
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.js +4 -0
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.protocolMemberVariable.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.protocolMemberVariable.fourslash.js +48 -0
- package/dist/tests/fourslash/findallreferences.protocolMemberVariable.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.js +8 -2
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.js +5 -2
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.js +2 -2
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.js.map +1 -1
- package/dist/tests/harness/fourslash/testState.js +1 -1
- package/dist/tests/harness/fourslash/testState.js.map +1 -1
- package/dist/tests/hoverProvider.test.js +38 -0
- package/dist/tests/hoverProvider.test.js.map +1 -1
- package/dist/tests/importStatementUtils.test.js +6 -3
- package/dist/tests/importStatementUtils.test.js.map +1 -1
- package/dist/tests/ipythonMode.test.js +38 -0
- package/dist/tests/ipythonMode.test.js.map +1 -1
- package/dist/tests/parseTreeUtils.test.js +88 -0
- package/dist/tests/parseTreeUtils.test.js.map +1 -1
- package/dist/tests/parser.test.js +60 -3
- package/dist/tests/parser.test.js.map +1 -1
- package/dist/tests/positionUtils.test.js +23 -0
- package/dist/tests/positionUtils.test.js.map +1 -1
- package/dist/tests/pyrightFileSystem.test.js +41 -0
- package/dist/tests/pyrightFileSystem.test.js.map +1 -1
- package/dist/tests/service.test.js +77 -0
- package/dist/tests/service.test.js.map +1 -1
- package/dist/tests/sourceEnumeratorSymlink.test.d.ts +1 -0
- package/dist/tests/sourceEnumeratorSymlink.test.js +203 -0
- package/dist/tests/sourceEnumeratorSymlink.test.js.map +1 -0
- package/dist/tests/stringUtils.test.js +84 -0
- package/dist/tests/stringUtils.test.js.map +1 -1
- package/dist/tests/symlinkAliasInvalidation.test.d.ts +1 -0
- package/dist/tests/symlinkAliasInvalidation.test.js +471 -0
- package/dist/tests/symlinkAliasInvalidation.test.js.map +1 -0
- package/dist/tests/testUtils.d.ts +2 -0
- package/dist/tests/testUtils.js +7 -1
- package/dist/tests/testUtils.js.map +1 -1
- package/dist/tests/textEditUtil.test.js +2 -2
- package/dist/tests/textEditUtil.test.js.map +1 -1
- package/dist/tests/textRangeCollection.test.d.ts +1 -0
- package/dist/tests/textRangeCollection.test.js +137 -0
- package/dist/tests/textRangeCollection.test.js.map +1 -0
- package/dist/tests/typeCacheUtils.test.d.ts +1 -0
- package/dist/tests/typeCacheUtils.test.js +69 -0
- package/dist/tests/typeCacheUtils.test.js.map +1 -0
- package/dist/tests/typeEvaluator1.test.js +24 -3
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +8 -0
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +4 -0
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/tests/typeEvaluator5.test.js +12 -0
- package/dist/tests/typeEvaluator5.test.js.map +1 -1
- package/dist/tests/typeEvaluator6.test.js +33 -1
- package/dist/tests/typeEvaluator6.test.js.map +1 -1
- package/dist/tests/typeEvaluator7.test.js +29 -0
- package/dist/tests/typeEvaluator7.test.js.map +1 -1
- package/dist/tests/typeEvaluator8.test.js +318 -4
- package/dist/tests/typeEvaluator8.test.js.map +1 -1
- package/dist/tests/typeServer/typeCache.test.d.ts +1 -0
- package/dist/tests/typeServer/typeCache.test.js +69 -0
- package/dist/tests/typeServer/typeCache.test.js.map +1 -0
- package/dist/tests/typeServer/typeServer.virtualFileRedirect.test.js +18 -0
- package/dist/tests/typeServer/typeServer.virtualFileRedirect.test.js.map +1 -1
- package/dist/tests/types.test.d.ts +1 -0
- package/dist/{analyzer/parseTreeCleaner.js → tests/types.test.js} +23 -25
- package/dist/tests/types.test.js.map +1 -0
- package/dist/tests/uri.test.js +51 -0
- package/dist/tests/uri.test.js.map +1 -1
- package/dist/typeServer/notebookDocumentHandler.d.ts +9 -2
- package/dist/typeServer/notebookDocumentHandler.js +16 -6
- package/dist/typeServer/notebookDocumentHandler.js.map +1 -1
- package/dist/typeServer/programWrapper.d.ts +1 -0
- package/dist/typeServer/programWrapper.js +28 -15
- package/dist/typeServer/programWrapper.js.map +1 -1
- package/dist/typeServer/protocol/tspSupplemental.d.ts +1 -1
- package/dist/typeServer/protocol/tspSupplemental.js +2 -2
- package/dist/typeServer/server.d.ts +13 -2
- package/dist/typeServer/server.js +36 -23
- package/dist/typeServer/server.js.map +1 -1
- package/dist/typeServer/typeCache.d.ts +8 -4
- package/dist/typeServer/typeCache.js +33 -5
- package/dist/typeServer/typeCache.js.map +1 -1
- package/dist/typeServer/typeEvalUtils.d.ts +2 -1
- package/dist/typeServer/typeEvalUtils.js +7 -3
- package/dist/typeServer/typeEvalUtils.js.map +1 -1
- package/dist/typeServer/typeServerFileSystem.d.ts +10 -9
- package/dist/typeServer/typeServerFileSystem.js +16 -12
- package/dist/typeServer/typeServerFileSystem.js.map +1 -1
- package/package.json +7 -5
- package/dist/analyzer/parseTreeCleaner.d.ts +0 -8
- package/dist/analyzer/parseTreeCleaner.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceEnumerator.js","sourceRoot":"","sources":["../../../../../src/analyzer/sourceEnumerator.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAKH,qDAAsH;AAQtH,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file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AC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/F,CAAC;IACL,CAAC;CACJ;AA3QD,4CA2QC"}
|
|
@@ -6,11 +6,14 @@ import { FileSystem } from '../common/fileSystem';
|
|
|
6
6
|
import { LogTracker } from '../common/logTracker';
|
|
7
7
|
import { ServiceProvider } from '../common/serviceProvider';
|
|
8
8
|
import '../common/serviceProviderExtensions';
|
|
9
|
+
import * as StringUtils from '../common/stringUtils';
|
|
9
10
|
import { TextRange } from '../common/textRange';
|
|
10
11
|
import { TextRangeCollection } from '../common/textRangeCollection';
|
|
11
12
|
import { Uri } from '../common/uri/uri';
|
|
12
|
-
import {
|
|
13
|
+
import { ModuleNode } from '../parser/parseNodes';
|
|
14
|
+
import { ParseFileResults, ParseOptions, ParserOutput } from '../parser/parser';
|
|
13
15
|
import { ImportLookup } from './analyzerFileInfo';
|
|
16
|
+
import * as AnalyzerNodeInfo from './analyzerNodeInfo';
|
|
14
17
|
import { CellChainIndexProvider } from './cellChainIndex';
|
|
15
18
|
import { CircularDependency } from './circularDependency';
|
|
16
19
|
import { ImportResolver } from './importResolver';
|
|
@@ -25,6 +28,8 @@ export declare enum IPythonMode {
|
|
|
25
28
|
}
|
|
26
29
|
export interface SourceFileEditMode {
|
|
27
30
|
readonly isEditMode: boolean;
|
|
31
|
+
readonly isClonedProgram?: boolean;
|
|
32
|
+
readonly analysisContextOwner?: object;
|
|
28
33
|
}
|
|
29
34
|
export declare class SourceFile {
|
|
30
35
|
readonly serviceProvider: ServiceProvider;
|
|
@@ -68,9 +73,9 @@ export declare class SourceFile {
|
|
|
68
73
|
getCheckTime(): number | undefined;
|
|
69
74
|
restore(): string | undefined;
|
|
70
75
|
didContentsChangeOnDisk(): boolean;
|
|
71
|
-
dropParseAndBindInfo():
|
|
76
|
+
dropParseAndBindInfo(): ModuleNode | undefined;
|
|
72
77
|
markDirty(): void;
|
|
73
|
-
markReanalysisRequired(forceRebinding: boolean): void;
|
|
78
|
+
markReanalysisRequired(forceRebinding: boolean, nodeInfoReader: AnalyzerNodeInfo.AnalyzerNodeInfoReader): void;
|
|
74
79
|
getFileContentsVersion(): number;
|
|
75
80
|
getClientVersion(): number | undefined;
|
|
76
81
|
getSemanticVersion(): number;
|
|
@@ -99,17 +104,18 @@ export declare class SourceFile {
|
|
|
99
104
|
isNoCircularDependencyConfirmed(): boolean;
|
|
100
105
|
setHitMaxImportDepth(maxImportDepth: number): void;
|
|
101
106
|
parse(configOptions: ConfigOptions, importResolver: ImportResolver, content?: string): boolean;
|
|
102
|
-
bind(configOptions: ConfigOptions, importLookup: ImportLookup, builtinsScope: Scope | undefined, futureImports: Set<string>, cellChainIndex: CellChainIndexProvider | undefined):
|
|
103
|
-
check(configOptions: ConfigOptions, importLookup: ImportLookup, importResolver: ImportResolver, evaluator: TypeEvaluator, dependentFiles
|
|
107
|
+
bind(configOptions: ConfigOptions, importLookup: ImportLookup, builtinsScope: Scope | undefined, futureImports: Set<string>, cellChainIndex: CellChainIndexProvider | undefined, nodeInfoContext: AnalyzerNodeInfo.AnalyzerNodeInfoContext): boolean;
|
|
108
|
+
check(configOptions: ConfigOptions, importLookup: ImportLookup, importResolver: ImportResolver, evaluator: TypeEvaluator, dependentFiles: ParserOutput[] | undefined, nodeInfoReader: AnalyzerNodeInfo.AnalyzerNodeInfoReader): void;
|
|
104
109
|
test_enableIPythonMode(enable: boolean): void;
|
|
105
110
|
protected createDiagnosticSink(): DiagnosticSink;
|
|
106
111
|
protected createTextRangeDiagnosticSink(lines: TextRangeCollection<TextRange>): TextRangeDiagnosticSink;
|
|
112
|
+
protected readFileContents(): string;
|
|
113
|
+
protected parseFileContents(fileContents: string, parseOptions: ParseOptions, diagSink: DiagnosticSink, contentHash: StringUtils.StringFingerprint): ParseFileResults;
|
|
107
114
|
private _makeFileId;
|
|
108
115
|
private _recomputeDiagnostics;
|
|
109
116
|
private _cachePreEditState;
|
|
110
117
|
private _addTaskListDiagnostics;
|
|
111
118
|
private _buildFileInfo;
|
|
112
|
-
private _cleanParseTreeIfRequired;
|
|
113
119
|
private _resolveImports;
|
|
114
120
|
private _getPathForLogging;
|
|
115
121
|
private _parseFile;
|
|
@@ -68,7 +68,6 @@ const AnalyzerNodeInfo = __importStar(require("./analyzerNodeInfo"));
|
|
|
68
68
|
const binder_1 = require("./binder");
|
|
69
69
|
const checker_1 = require("./checker");
|
|
70
70
|
const CommentUtils = __importStar(require("./commentUtils"));
|
|
71
|
-
const parseTreeCleaner_1 = require("./parseTreeCleaner");
|
|
72
71
|
const testWalker_1 = require("./testWalker");
|
|
73
72
|
// Limit the number of import cycles tracked per source file.
|
|
74
73
|
const _maxImportCyclesPerFile = 4;
|
|
@@ -98,14 +97,11 @@ class WriteableData {
|
|
|
98
97
|
// Number that is incremented every time semantic of the file
|
|
99
98
|
// might have changed.
|
|
100
99
|
this.semanticVersion = 0;
|
|
101
|
-
// Length and
|
|
100
|
+
// Length and fingerprint of the latest file contents supplied by disk or the client.
|
|
102
101
|
this.lastFileContentLength = undefined;
|
|
103
102
|
this.lastFileContentHash = undefined;
|
|
104
103
|
// Version of file contents that have been analyzed.
|
|
105
104
|
this.analyzedFileContentsVersion = -1;
|
|
106
|
-
// Do we need to walk the parse tree and clean
|
|
107
|
-
// the binder information hanging from it?
|
|
108
|
-
this.parseTreeNeedsCleaning = false;
|
|
109
105
|
// Reentrancy check for binding and checking.
|
|
110
106
|
this.isBindingInProgress = false;
|
|
111
107
|
this.isCheckingInProgress = false;
|
|
@@ -129,6 +125,7 @@ class WriteableData {
|
|
|
129
125
|
this.isBindingNeeded = true;
|
|
130
126
|
// Do we have valid diagnostic results from a checking pass?
|
|
131
127
|
this.isCheckingNeeded = true;
|
|
128
|
+
this.importInfo = [];
|
|
132
129
|
// True if the file appears to have been deleted.
|
|
133
130
|
this.isFileDeleted = false;
|
|
134
131
|
// Empty
|
|
@@ -143,12 +140,11 @@ class WriteableData {
|
|
|
143
140
|
isCheckingNeeded=${this.isCheckingNeeded},
|
|
144
141
|
isFileDeleted=${this.isFileDeleted},
|
|
145
142
|
hitMaxImportDepth=${this.hitMaxImportDepth},
|
|
146
|
-
parseTreeNeedsCleaning=${this.parseTreeNeedsCleaning},
|
|
147
143
|
fileContentsVersion=${this.fileContentsVersion},
|
|
148
144
|
analyzedFileContentsVersion=${this.analyzedFileContentsVersion},
|
|
149
145
|
clientDocumentVersion=${this.clientDocumentVersion},
|
|
150
146
|
lastFileContentLength=${this.lastFileContentLength},
|
|
151
|
-
lastFileContentHash=${this.lastFileContentHash},
|
|
147
|
+
lastFileContentHash=${JSON.stringify(this.lastFileContentHash)},
|
|
152
148
|
typeIgnoreAll=${this.typeIgnoreAll},
|
|
153
149
|
imports=${this.imports?.length},
|
|
154
150
|
builtinsImport=${this.builtinsImport?.importName},
|
|
@@ -307,7 +303,7 @@ class SourceFile {
|
|
|
307
303
|
if (this._writableData.lastFileContentLength === undefined) {
|
|
308
304
|
return true;
|
|
309
305
|
}
|
|
310
|
-
// Read in the latest file contents and see if the
|
|
306
|
+
// Read in the latest file contents and see if the fingerprint matches
|
|
311
307
|
// that of the previous contents.
|
|
312
308
|
try {
|
|
313
309
|
// Read the file's contents.
|
|
@@ -316,7 +312,9 @@ class SourceFile {
|
|
|
316
312
|
if (fileContents.length !== this._writableData.lastFileContentLength) {
|
|
317
313
|
return true;
|
|
318
314
|
}
|
|
319
|
-
|
|
315
|
+
const contentHash = StringUtils.getStringFingerprint(fileContents);
|
|
316
|
+
if (!this._writableData.lastFileContentHash ||
|
|
317
|
+
!StringUtils.areStringFingerprintsEqual(contentHash, this._writableData.lastFileContentHash)) {
|
|
320
318
|
return true;
|
|
321
319
|
}
|
|
322
320
|
}
|
|
@@ -337,16 +335,19 @@ class SourceFile {
|
|
|
337
335
|
// If we are actively binding or checking this file, we can't
|
|
338
336
|
// safely drop parse and binding info.
|
|
339
337
|
if (this._writableData.isBindingInProgress || this._writableData.isCheckingInProgress) {
|
|
340
|
-
return;
|
|
338
|
+
return undefined;
|
|
341
339
|
}
|
|
342
340
|
this._fireFileDirtyEvent();
|
|
341
|
+
const parseTree = this._writableData.parserOutput?.parseTree;
|
|
343
342
|
this._writableData.parserOutput = undefined;
|
|
344
343
|
this._writableData.tokenizerLines = undefined;
|
|
345
344
|
this._writableData.tokenizerOutput = undefined;
|
|
346
345
|
this._writableData.parsedFileContents = undefined;
|
|
346
|
+
this._writableData.parsedFileContentsHash = undefined;
|
|
347
347
|
this._writableData.moduleSymbolTable = undefined;
|
|
348
348
|
this._writableData.isBindingNeeded = true;
|
|
349
349
|
this._writableData.imports = [];
|
|
350
|
+
return parseTree;
|
|
350
351
|
}
|
|
351
352
|
markDirty() {
|
|
352
353
|
this._writableData.fileContentsVersion++;
|
|
@@ -358,7 +359,7 @@ class SourceFile {
|
|
|
358
359
|
this._writableData.lineCount = undefined;
|
|
359
360
|
this._fireFileDirtyEvent();
|
|
360
361
|
}
|
|
361
|
-
markReanalysisRequired(forceRebinding) {
|
|
362
|
+
markReanalysisRequired(forceRebinding, nodeInfoReader) {
|
|
362
363
|
// Keep the parse info, but reset the analysis to the beginning.
|
|
363
364
|
this._writableData.semanticVersion++;
|
|
364
365
|
this._writableData.isCheckingNeeded = true;
|
|
@@ -367,12 +368,12 @@ class SourceFile {
|
|
|
367
368
|
// we need to rebind because a dependent import may have changed.
|
|
368
369
|
if (this._writableData.parserOutput) {
|
|
369
370
|
if (this._writableData.parserOutput.containsWildcardImport ||
|
|
370
|
-
AnalyzerNodeInfo.getDunderAllInfo(this._writableData.parserOutput.parseTree) !==
|
|
371
|
+
AnalyzerNodeInfo.getDunderAllInfo(this._writableData.parserOutput.parseTree, nodeInfoReader) !==
|
|
372
|
+
undefined ||
|
|
371
373
|
forceRebinding) {
|
|
372
374
|
// We don't need to rebuild index data since wildcard
|
|
373
375
|
// won't affect user file indices. User file indices
|
|
374
376
|
// don't contain import alias info.
|
|
375
|
-
this._writableData.parseTreeNeedsCleaning = true;
|
|
376
377
|
this._writableData.isBindingNeeded = true;
|
|
377
378
|
this._writableData.moduleSymbolTable = undefined;
|
|
378
379
|
}
|
|
@@ -412,7 +413,7 @@ class SourceFile {
|
|
|
412
413
|
`which exceeds the maximum supported file size of ${exports.maxSourceFileSize}`);
|
|
413
414
|
throw new Error('File larger than max');
|
|
414
415
|
}
|
|
415
|
-
return this.
|
|
416
|
+
return this.readFileContents();
|
|
416
417
|
}
|
|
417
418
|
catch (error) {
|
|
418
419
|
return undefined;
|
|
@@ -431,10 +432,11 @@ class SourceFile {
|
|
|
431
432
|
else {
|
|
432
433
|
this._writableData.clientDocumentVersion = version;
|
|
433
434
|
this._writableData.clientDocumentContents = contents;
|
|
434
|
-
const contentsHash = StringUtils.
|
|
435
|
+
const contentsHash = StringUtils.getStringFingerprint(contents);
|
|
435
436
|
// Have the contents of the file changed?
|
|
436
437
|
if (contents.length !== this._writableData.lastFileContentLength ||
|
|
437
|
-
|
|
438
|
+
!this._writableData.lastFileContentHash ||
|
|
439
|
+
!StringUtils.areStringFingerprintsEqual(contentsHash, this._writableData.lastFileContentHash)) {
|
|
438
440
|
this.markDirty();
|
|
439
441
|
}
|
|
440
442
|
this._writableData.lastFileContentLength = contents.length;
|
|
@@ -473,7 +475,8 @@ class SourceFile {
|
|
|
473
475
|
// Otherwise re-tokenize the contents on demand.
|
|
474
476
|
const tokenizeContents = this._tokenizeContents.bind(this);
|
|
475
477
|
const parsedFileContents = this._writableData.parsedFileContents;
|
|
476
|
-
const contentHash = this._writableData.
|
|
478
|
+
const contentHash = this._writableData.parsedFileContentsHash ??
|
|
479
|
+
StringUtils.getStringFingerprint(this._writableData.parsedFileContents);
|
|
477
480
|
let tokenizerOutput = this._writableData.tokenizerOutput;
|
|
478
481
|
return {
|
|
479
482
|
contentHash,
|
|
@@ -531,6 +534,7 @@ class SourceFile {
|
|
|
531
534
|
}
|
|
532
535
|
const diagSink = this.createDiagnosticSink();
|
|
533
536
|
let fileContents = this.getOpenFileContents();
|
|
537
|
+
let contentHash = fileContents !== undefined ? this._writableData.lastFileContentHash : undefined;
|
|
534
538
|
if (fileContents === undefined) {
|
|
535
539
|
try {
|
|
536
540
|
const startTime = timing_1.timingStats.readFileTime.totalTime;
|
|
@@ -540,27 +544,31 @@ class SourceFile {
|
|
|
540
544
|
if (fileContents === undefined) {
|
|
541
545
|
throw new Error("Can't get file content");
|
|
542
546
|
}
|
|
543
|
-
// Remember the length and
|
|
547
|
+
// Remember the length and fingerprint for comparison purposes.
|
|
544
548
|
this._writableData.lastFileContentLength = fileContents.length;
|
|
545
|
-
|
|
549
|
+
contentHash = StringUtils.getStringFingerprint(fileContents);
|
|
550
|
+
this._writableData.lastFileContentHash = contentHash;
|
|
546
551
|
});
|
|
547
552
|
logState.add(`fs read ${timing_1.timingStats.readFileTime.totalTime - startTime}ms`);
|
|
548
553
|
}
|
|
549
554
|
catch (error) {
|
|
550
555
|
diagSink.addError(`Source file could not be read`, (0, textRange_1.getEmptyRange)());
|
|
551
556
|
fileContents = '';
|
|
557
|
+
contentHash = StringUtils.getStringFingerprint(fileContents);
|
|
552
558
|
if (!this.fileSystem.existsSync(this._uri)) {
|
|
553
559
|
this._writableData.isFileDeleted = true;
|
|
554
560
|
}
|
|
555
561
|
}
|
|
556
562
|
}
|
|
557
563
|
try {
|
|
564
|
+
contentHash ?? (contentHash = StringUtils.getStringFingerprint(fileContents));
|
|
558
565
|
// Parse the token stream, building the abstract syntax tree.
|
|
559
|
-
const parseFileResults = this._parseFile(configOptions, this._uri, fileContents, this._ipythonMode !== IPythonMode.None, diagSink);
|
|
566
|
+
const parseFileResults = this._parseFile(configOptions, this._uri, fileContents, this._ipythonMode !== IPythonMode.None, diagSink, contentHash);
|
|
560
567
|
(0, debug_1.assert)(parseFileResults !== undefined && parseFileResults.tokenizerOutput !== undefined);
|
|
561
568
|
this._writableData.parserOutput = parseFileResults.parserOutput;
|
|
562
569
|
this._writableData.tokenizerLines = parseFileResults.tokenizerOutput.lines;
|
|
563
570
|
this._writableData.parsedFileContents = fileContents;
|
|
571
|
+
this._writableData.parsedFileContentsHash = parseFileResults.contentHash;
|
|
564
572
|
this._writableData.typeIgnoreLines = parseFileResults.tokenizerOutput.typeIgnoreLines;
|
|
565
573
|
this._writableData.typeIgnoreAll = parseFileResults.tokenizerOutput.typeIgnoreAll;
|
|
566
574
|
this._writableData.pyrightIgnoreLines = parseFileResults.tokenizerOutput.pyrightIgnoreLines;
|
|
@@ -575,6 +583,7 @@ class SourceFile {
|
|
|
575
583
|
const importResult = this._resolveImports(importResolver, parseFileResults.parserOutput.importedModules, execEnvironment);
|
|
576
584
|
this._writableData.imports = importResult.imports;
|
|
577
585
|
this._writableData.builtinsImport = importResult.builtinsImportResult;
|
|
586
|
+
this._writableData.importInfo = importResult.importInfo;
|
|
578
587
|
this._writableData.parseDiagnostics = diagSink.fetchAndClear();
|
|
579
588
|
this._writableData.taskListDiagnostics = [];
|
|
580
589
|
this._addTaskListDiagnostics(configOptions.taskListTokens, parseFileResults, this._writableData.taskListDiagnostics);
|
|
@@ -599,9 +608,12 @@ class SourceFile {
|
|
|
599
608
|
}));
|
|
600
609
|
// Create dummy parse results.
|
|
601
610
|
this._writableData.parsedFileContents = '';
|
|
611
|
+
this._writableData.parsedFileContentsHash = StringUtils.getStringFingerprint('');
|
|
602
612
|
this._writableData.tokenizerLines = new textRangeCollection_1.TextRangeCollection([]);
|
|
613
|
+
const parseTree = parseNodes_1.ModuleNode.create({ start: 0, length: 0 });
|
|
603
614
|
this._writableData.parserOutput = {
|
|
604
|
-
parseTree
|
|
615
|
+
parseTree,
|
|
616
|
+
stringAnnotations: (0, parseNodes_1.getParserStringAnnotationInfo)(parseTree),
|
|
605
617
|
importedModules: [],
|
|
606
618
|
futureImports: new Set(),
|
|
607
619
|
containsWildcardImport: false,
|
|
@@ -622,6 +634,7 @@ class SourceFile {
|
|
|
622
634
|
};
|
|
623
635
|
this._writableData.imports = undefined;
|
|
624
636
|
this._writableData.builtinsImport = undefined;
|
|
637
|
+
this._writableData.importInfo = [];
|
|
625
638
|
const diagSink = this.createDiagnosticSink();
|
|
626
639
|
diagSink.addError(localize_1.LocMessage.internalParseError().format({
|
|
627
640
|
file: this.getUri().toUserVisibleString(),
|
|
@@ -635,38 +648,44 @@ class SourceFile {
|
|
|
635
648
|
this._writableData.analyzedFileContentsVersion = this._writableData.fileContentsVersion;
|
|
636
649
|
this._writableData.isBindingNeeded = true;
|
|
637
650
|
this._writableData.isCheckingNeeded = true;
|
|
638
|
-
this._writableData.parseTreeNeedsCleaning = false;
|
|
639
651
|
this._writableData.hitMaxImportDepth = undefined;
|
|
640
652
|
this._recomputeDiagnostics(configOptions);
|
|
641
653
|
return true;
|
|
642
654
|
});
|
|
643
655
|
}
|
|
644
|
-
bind(configOptions, importLookup, builtinsScope, futureImports, cellChainIndex) {
|
|
656
|
+
bind(configOptions, importLookup, builtinsScope, futureImports, cellChainIndex, nodeInfoContext) {
|
|
645
657
|
(0, debug_1.assert)(!this.isParseRequired(), 'Bind called before parsing');
|
|
646
658
|
(0, debug_1.assert)(this.isBindingRequired(), 'Bind called unnecessarily');
|
|
647
659
|
(0, debug_1.assert)(!this._writableData.isBindingInProgress, 'Bind called while binding in progress');
|
|
648
660
|
(0, debug_1.assert)(this._writableData.parserOutput !== undefined, 'Parse results not available');
|
|
649
661
|
return this._logTracker.log(`binding: ${this._getPathForLogging(this._uri)}`, () => {
|
|
662
|
+
let bound = false;
|
|
650
663
|
try {
|
|
651
664
|
// Perform name binding.
|
|
652
665
|
timing_1.timingStats.bindTime.timeOperation(() => {
|
|
653
|
-
this.
|
|
666
|
+
const parseTree = this._writableData.parserOutput.parseTree;
|
|
667
|
+
const bindingSession = nodeInfoContext.beginWrite(parseTree);
|
|
668
|
+
const nodeInfo = AnalyzerNodeInfo.createAnalyzerNodeInfoAccessor(bindingSession, bindingSession);
|
|
669
|
+
this._writableData.importInfo.forEach((record) => nodeInfo.setImportInfo(record.node, record.importResult));
|
|
654
670
|
const fileInfo = this._buildFileInfo(configOptions, importLookup, builtinsScope, futureImports);
|
|
655
|
-
|
|
656
|
-
const binder = new binder_1.Binder(fileInfo, configOptions.indexGenerationMode, cellChainIndex);
|
|
671
|
+
nodeInfo.setFileInfo(parseTree, fileInfo);
|
|
672
|
+
const binder = new binder_1.Binder(fileInfo, configOptions.indexGenerationMode, cellChainIndex, nodeInfo);
|
|
657
673
|
this._writableData.isBindingInProgress = true;
|
|
658
|
-
binder.bindModule(
|
|
674
|
+
binder.bindModule(parseTree);
|
|
675
|
+
const bindDiagnostics = fileInfo.diagnosticSink.fetchAndClear();
|
|
676
|
+
const moduleScope = nodeInfo.getScope(parseTree);
|
|
677
|
+
(0, debug_1.assert)(moduleScope !== undefined, 'Module scope not returned by binder');
|
|
678
|
+
nodeInfoContext.publish(bindingSession);
|
|
679
|
+
this._writableData.moduleSymbolTable = moduleScope.symbolTable;
|
|
680
|
+
this._writableData.bindDiagnostics = bindDiagnostics;
|
|
659
681
|
// If we're in "test mode" (used for unit testing), run an additional
|
|
660
682
|
// "test walker" over the parse tree to validate its internal consistency.
|
|
661
683
|
if (configOptions.internalTestMode) {
|
|
662
684
|
const testWalker = new testWalker_1.TestWalker();
|
|
663
685
|
testWalker.walk(this._writableData.parserOutput.parseTree);
|
|
664
686
|
}
|
|
665
|
-
this._writableData.bindDiagnostics = fileInfo.diagnosticSink.fetchAndClear();
|
|
666
|
-
const moduleScope = AnalyzerNodeInfo.getScope(this._writableData.parserOutput.parseTree);
|
|
667
|
-
(0, debug_1.assert)(moduleScope !== undefined, 'Module scope not returned by binder');
|
|
668
|
-
this._writableData.moduleSymbolTable = moduleScope.symbolTable;
|
|
669
687
|
});
|
|
688
|
+
bound = true;
|
|
670
689
|
}
|
|
671
690
|
catch (e) {
|
|
672
691
|
const message = (e.stack ? e.stack.toString() : undefined) ||
|
|
@@ -689,12 +708,13 @@ class SourceFile {
|
|
|
689
708
|
this._writableData.isBindingInProgress = false;
|
|
690
709
|
}
|
|
691
710
|
// Prepare for the next stage of the analysis.
|
|
692
|
-
this._writableData.isCheckingNeeded =
|
|
711
|
+
this._writableData.isCheckingNeeded = bound;
|
|
693
712
|
this._writableData.isBindingNeeded = false;
|
|
694
713
|
this._recomputeDiagnostics(configOptions);
|
|
714
|
+
return bound;
|
|
695
715
|
});
|
|
696
716
|
}
|
|
697
|
-
check(configOptions, importLookup, importResolver, evaluator, dependentFiles) {
|
|
717
|
+
check(configOptions, importLookup, importResolver, evaluator, dependentFiles, nodeInfoReader) {
|
|
698
718
|
(0, debug_1.assert)(!this.isParseRequired(), `Check called before parsing: state=${this._writableData.debugPrint()}`);
|
|
699
719
|
(0, debug_1.assert)(!this.isBindingRequired(), `Check called before binding: state=${this._writableData.debugPrint()}`);
|
|
700
720
|
(0, debug_1.assert)(!this._writableData.isBindingInProgress, 'Check called while binding in progress');
|
|
@@ -705,11 +725,12 @@ class SourceFile {
|
|
|
705
725
|
try {
|
|
706
726
|
timing_1.timingStats.typeCheckerTime.timeOperation(() => {
|
|
707
727
|
const checkDuration = new timing_1.Duration();
|
|
708
|
-
const
|
|
728
|
+
const nodeInfo = AnalyzerNodeInfo.createAnalyzerNodeInfoAccessor(nodeInfoReader);
|
|
729
|
+
const checker = new checker_1.Checker(importResolver, evaluator, this._writableData.parserOutput, dependentFiles, nodeInfo);
|
|
709
730
|
this._writableData.isCheckingInProgress = true;
|
|
710
731
|
checker.check();
|
|
711
732
|
this._writableData.isCheckingNeeded = false;
|
|
712
|
-
const fileInfo =
|
|
733
|
+
const fileInfo = nodeInfo.getFileInfo(this._writableData.parserOutput.parseTree);
|
|
713
734
|
this._writableData.checkerDiagnostics = fileInfo.diagnosticSink.fetchAndClear();
|
|
714
735
|
this._writableData.checkTime = checkDuration.getDurationInMilliseconds();
|
|
715
736
|
});
|
|
@@ -754,6 +775,12 @@ class SourceFile {
|
|
|
754
775
|
createTextRangeDiagnosticSink(lines) {
|
|
755
776
|
return new diagnosticSink_1.TextRangeDiagnosticSink(lines);
|
|
756
777
|
}
|
|
778
|
+
readFileContents() {
|
|
779
|
+
return this.fileSystem.readFileSync(this._uri, 'utf8');
|
|
780
|
+
}
|
|
781
|
+
parseFileContents(fileContents, parseOptions, diagSink, contentHash) {
|
|
782
|
+
return new parser_1.Parser().parseSourceFile(fileContents, parseOptions, diagSink, contentHash);
|
|
783
|
+
}
|
|
757
784
|
// Creates a short string that can be used to uniquely identify
|
|
758
785
|
// this file from all other files. It is used in the type evaluator
|
|
759
786
|
// to distinguish between types that are defined in different files
|
|
@@ -1072,17 +1099,9 @@ class SourceFile {
|
|
|
1072
1099
|
};
|
|
1073
1100
|
return fileInfo;
|
|
1074
1101
|
}
|
|
1075
|
-
_cleanParseTreeIfRequired() {
|
|
1076
|
-
if (this._writableData.parserOutput) {
|
|
1077
|
-
if (this._writableData.parseTreeNeedsCleaning) {
|
|
1078
|
-
const cleanerWalker = new parseTreeCleaner_1.ParseTreeCleanerWalker(this._writableData.parserOutput.parseTree);
|
|
1079
|
-
cleanerWalker.clean();
|
|
1080
|
-
this._writableData.parseTreeNeedsCleaning = false;
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
1102
|
_resolveImports(importResolver, moduleImports, execEnv) {
|
|
1085
1103
|
const imports = [];
|
|
1104
|
+
const importInfo = [];
|
|
1086
1105
|
const resolveAndAddIfNotSelf = (nameParts, skipMissingImport = false) => {
|
|
1087
1106
|
const importResult = importResolver.resolveImport(this._uri, execEnv, {
|
|
1088
1107
|
leadingDots: 0,
|
|
@@ -1121,7 +1140,7 @@ class SourceFile {
|
|
|
1121
1140
|
// name node in the parse tree so we can access it later
|
|
1122
1141
|
// (for hover and definition support).
|
|
1123
1142
|
if (moduleImport.nameParts.length === moduleImport.nameNode.d.nameParts.length) {
|
|
1124
|
-
|
|
1143
|
+
importInfo.push({ node: moduleImport.nameNode, importResult });
|
|
1125
1144
|
}
|
|
1126
1145
|
else {
|
|
1127
1146
|
// For implicit imports of higher-level modules within a multi-part
|
|
@@ -1130,18 +1149,22 @@ class SourceFile {
|
|
|
1130
1149
|
// case, store the import info on the name part node.
|
|
1131
1150
|
(0, debug_1.assert)(moduleImport.nameParts.length > 0);
|
|
1132
1151
|
(0, debug_1.assert)(moduleImport.nameParts.length - 1 < moduleImport.nameNode.d.nameParts.length);
|
|
1133
|
-
|
|
1152
|
+
importInfo.push({
|
|
1153
|
+
node: moduleImport.nameNode.d.nameParts[moduleImport.nameParts.length - 1],
|
|
1154
|
+
importResult,
|
|
1155
|
+
});
|
|
1134
1156
|
}
|
|
1135
1157
|
}
|
|
1136
1158
|
return {
|
|
1137
1159
|
imports,
|
|
1138
1160
|
builtinsImportResult,
|
|
1161
|
+
importInfo,
|
|
1139
1162
|
};
|
|
1140
1163
|
}
|
|
1141
1164
|
_getPathForLogging(fileUri) {
|
|
1142
1165
|
return (0, logTracker_1.getPathForLogging)(this.fileSystem, fileUri);
|
|
1143
1166
|
}
|
|
1144
|
-
_parseFile(configOptions, fileUri, fileContents, useNotebookMode, diagSink) {
|
|
1167
|
+
_parseFile(configOptions, fileUri, fileContents, useNotebookMode, diagSink, contentHash) {
|
|
1145
1168
|
// Use the configuration options to determine the environment zin which
|
|
1146
1169
|
// this source file will be executed.
|
|
1147
1170
|
const execEnvironment = configOptions.findExecEnvironment(fileUri);
|
|
@@ -1153,8 +1176,7 @@ class SourceFile {
|
|
|
1153
1176
|
parseOptions.pythonVersion = execEnvironment.pythonVersion;
|
|
1154
1177
|
parseOptions.skipFunctionAndClassBody = configOptions.indexGenerationMode ?? false;
|
|
1155
1178
|
// Parse the token stream, building the abstract syntax tree.
|
|
1156
|
-
|
|
1157
|
-
return parser.parseSourceFile(fileContents, parseOptions, diagSink);
|
|
1179
|
+
return this.parseFileContents(fileContents, parseOptions, diagSink, contentHash);
|
|
1158
1180
|
}
|
|
1159
1181
|
_tokenizeContents(fileContents, contentHash) {
|
|
1160
1182
|
const tokenizer = new tokenizer_1.Tokenizer();
|
|
@@ -1162,7 +1184,8 @@ class SourceFile {
|
|
|
1162
1184
|
// When the file is open, cache the tokenizer results.
|
|
1163
1185
|
// Because the tokenizer is lazy, ensure that the state remains unchanged before caching its output.
|
|
1164
1186
|
if (this._writableData.clientDocumentContents !== undefined &&
|
|
1165
|
-
this._writableData.lastFileContentHash
|
|
1187
|
+
this._writableData.lastFileContentHash &&
|
|
1188
|
+
StringUtils.areStringFingerprintsEqual(this._writableData.lastFileContentHash, contentHash)) {
|
|
1166
1189
|
this._writableData.tokenizerOutput = output;
|
|
1167
1190
|
// Replace the existing tokenizerLines with the newly-returned
|
|
1168
1191
|
// version. They should have the same contents, but we want to use
|