@zzzen/pyright-internal 1.1.254
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/aliasDeclarationUtils.d.ts +9 -0
- package/dist/analyzer/aliasDeclarationUtils.js +128 -0
- package/dist/analyzer/aliasDeclarationUtils.js.map +1 -0
- package/dist/analyzer/analysis.d.ts +18 -0
- package/dist/analyzer/analysis.js +81 -0
- package/dist/analyzer/analysis.js.map +1 -0
- package/dist/analyzer/analyzerFileInfo.d.ts +39 -0
- package/dist/analyzer/analyzerFileInfo.js +17 -0
- package/dist/analyzer/analyzerFileInfo.js.map +1 -0
- package/dist/analyzer/analyzerNodeInfo.d.ts +32 -0
- package/dist/analyzer/analyzerNodeInfo.js +138 -0
- package/dist/analyzer/analyzerNodeInfo.js.map +1 -0
- package/dist/analyzer/backgroundAnalysisProgram.d.ts +54 -0
- package/dist/analyzer/backgroundAnalysisProgram.js +222 -0
- package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -0
- package/dist/analyzer/binder.d.ts +149 -0
- package/dist/analyzer/binder.js +3195 -0
- package/dist/analyzer/binder.js.map +1 -0
- package/dist/analyzer/checker.d.ts +116 -0
- package/dist/analyzer/checker.js +3828 -0
- package/dist/analyzer/checker.js.map +1 -0
- package/dist/analyzer/circularDependency.d.ts +7 -0
- package/dist/analyzer/circularDependency.js +51 -0
- package/dist/analyzer/circularDependency.js.map +1 -0
- package/dist/analyzer/codeFlowEngine.d.ts +21 -0
- package/dist/analyzer/codeFlowEngine.js +1132 -0
- package/dist/analyzer/codeFlowEngine.js.map +1 -0
- package/dist/analyzer/codeFlowTypes.d.ts +82 -0
- package/dist/analyzer/codeFlowTypes.js +134 -0
- package/dist/analyzer/codeFlowTypes.js.map +1 -0
- package/dist/analyzer/codeFlowUtils.d.ts +2 -0
- package/dist/analyzer/codeFlowUtils.js +348 -0
- package/dist/analyzer/codeFlowUtils.js.map +1 -0
- package/dist/analyzer/commentUtils.d.ts +4 -0
- package/dist/analyzer/commentUtils.js +131 -0
- package/dist/analyzer/commentUtils.js.map +1 -0
- package/dist/analyzer/constraintSolver.d.ts +7 -0
- package/dist/analyzer/constraintSolver.js +605 -0
- package/dist/analyzer/constraintSolver.js.map +1 -0
- package/dist/analyzer/constructorTransform.d.ts +4 -0
- package/dist/analyzer/constructorTransform.js +219 -0
- package/dist/analyzer/constructorTransform.js.map +1 -0
- package/dist/analyzer/dataClasses.d.ts +9 -0
- package/dist/analyzer/dataClasses.js +762 -0
- package/dist/analyzer/dataClasses.js.map +1 -0
- package/dist/analyzer/declaration.d.ts +90 -0
- package/dist/analyzer/declaration.js +42 -0
- package/dist/analyzer/declaration.js.map +1 -0
- package/dist/analyzer/declarationUtils.d.ts +12 -0
- package/dist/analyzer/declarationUtils.js +212 -0
- package/dist/analyzer/declarationUtils.js.map +1 -0
- package/dist/analyzer/docStringConversion.d.ts +2 -0
- package/dist/analyzer/docStringConversion.js +699 -0
- package/dist/analyzer/docStringConversion.js.map +1 -0
- package/dist/analyzer/docStringUtils.d.ts +3 -0
- package/dist/analyzer/docStringUtils.js +103 -0
- package/dist/analyzer/docStringUtils.js.map +1 -0
- package/dist/analyzer/functionTransform.d.ts +4 -0
- package/dist/analyzer/functionTransform.js +96 -0
- package/dist/analyzer/functionTransform.js.map +1 -0
- package/dist/analyzer/importResolver.d.ts +97 -0
- package/dist/analyzer/importResolver.js +1617 -0
- package/dist/analyzer/importResolver.js.map +1 -0
- package/dist/analyzer/importResult.d.ts +33 -0
- package/dist/analyzer/importResult.js +11 -0
- package/dist/analyzer/importResult.js.map +1 -0
- package/dist/analyzer/importStatementUtils.d.ts +46 -0
- package/dist/analyzer/importStatementUtils.js +618 -0
- package/dist/analyzer/importStatementUtils.js.map +1 -0
- package/dist/analyzer/namedTuples.d.ts +5 -0
- package/dist/analyzer/namedTuples.js +342 -0
- package/dist/analyzer/namedTuples.js.map +1 -0
- package/dist/analyzer/packageTypeReport.d.ts +52 -0
- package/dist/analyzer/packageTypeReport.js +45 -0
- package/dist/analyzer/packageTypeReport.js.map +1 -0
- package/dist/analyzer/packageTypeVerifier.d.ts +37 -0
- package/dist/analyzer/packageTypeVerifier.js +908 -0
- package/dist/analyzer/packageTypeVerifier.js.map +1 -0
- package/dist/analyzer/parentDirectoryCache.d.ts +23 -0
- package/dist/analyzer/parentDirectoryCache.js +71 -0
- package/dist/analyzer/parentDirectoryCache.js.map +1 -0
- package/dist/analyzer/parseTreeCleaner.d.ts +8 -0
- package/dist/analyzer/parseTreeCleaner.js +51 -0
- package/dist/analyzer/parseTreeCleaner.js.map +1 -0
- package/dist/analyzer/parseTreeUtils.d.ts +98 -0
- package/dist/analyzer/parseTreeUtils.js +1753 -0
- package/dist/analyzer/parseTreeUtils.js.map +1 -0
- package/dist/analyzer/parseTreeWalker.d.ts +81 -0
- package/dist/analyzer/parseTreeWalker.js +437 -0
- package/dist/analyzer/parseTreeWalker.js.map +1 -0
- package/dist/analyzer/patternMatching.d.ts +6 -0
- package/dist/analyzer/patternMatching.js +866 -0
- package/dist/analyzer/patternMatching.js.map +1 -0
- package/dist/analyzer/program.d.ts +158 -0
- package/dist/analyzer/program.js +1902 -0
- package/dist/analyzer/program.js.map +1 -0
- package/dist/analyzer/properties.d.ts +10 -0
- package/dist/analyzer/properties.js +368 -0
- package/dist/analyzer/properties.js.map +1 -0
- package/dist/analyzer/protocols.d.ts +8 -0
- package/dist/analyzer/protocols.js +409 -0
- package/dist/analyzer/protocols.js.map +1 -0
- package/dist/analyzer/pyTypedUtils.d.ts +6 -0
- package/dist/analyzer/pyTypedUtils.js +42 -0
- package/dist/analyzer/pyTypedUtils.js.map +1 -0
- package/dist/analyzer/pythonPathUtils.d.ts +14 -0
- package/dist/analyzer/pythonPathUtils.js +173 -0
- package/dist/analyzer/pythonPathUtils.js.map +1 -0
- package/dist/analyzer/scope.d.ts +39 -0
- package/dist/analyzer/scope.js +110 -0
- package/dist/analyzer/scope.js.map +1 -0
- package/dist/analyzer/scopeUtils.d.ts +6 -0
- package/dist/analyzer/scopeUtils.js +72 -0
- package/dist/analyzer/scopeUtils.js.map +1 -0
- package/dist/analyzer/service.d.ts +144 -0
- package/dist/analyzer/service.js +1197 -0
- package/dist/analyzer/service.js.map +1 -0
- package/dist/analyzer/sourceFile.d.ts +123 -0
- package/dist/analyzer/sourceFile.js +908 -0
- package/dist/analyzer/sourceFile.js.map +1 -0
- package/dist/analyzer/sourceMapper.d.ts +47 -0
- package/dist/analyzer/sourceMapper.js +543 -0
- package/dist/analyzer/sourceMapper.js.map +1 -0
- package/dist/analyzer/staticExpressions.d.ts +4 -0
- package/dist/analyzer/staticExpressions.js +242 -0
- package/dist/analyzer/staticExpressions.js.map +1 -0
- package/dist/analyzer/symbol.d.ts +50 -0
- package/dist/analyzer/symbol.js +160 -0
- package/dist/analyzer/symbol.js.map +1 -0
- package/dist/analyzer/symbolNameUtils.d.ts +8 -0
- package/dist/analyzer/symbolNameUtils.js +53 -0
- package/dist/analyzer/symbolNameUtils.js.map +1 -0
- package/dist/analyzer/symbolUtils.d.ts +7 -0
- package/dist/analyzer/symbolUtils.js +46 -0
- package/dist/analyzer/symbolUtils.js.map +1 -0
- package/dist/analyzer/testWalker.d.ts +14 -0
- package/dist/analyzer/testWalker.js +92 -0
- package/dist/analyzer/testWalker.js.map +1 -0
- package/dist/analyzer/tracePrinter.d.ts +11 -0
- package/dist/analyzer/tracePrinter.js +222 -0
- package/dist/analyzer/tracePrinter.js.map +1 -0
- package/dist/analyzer/typeCache.d.ts +40 -0
- package/dist/analyzer/typeCache.js +134 -0
- package/dist/analyzer/typeCache.js.map +1 -0
- package/dist/analyzer/typeDocStringUtils.d.ts +12 -0
- package/dist/analyzer/typeDocStringUtils.js +293 -0
- package/dist/analyzer/typeDocStringUtils.js.map +1 -0
- package/dist/analyzer/typeEvaluator.d.ts +18 -0
- package/dist/analyzer/typeEvaluator.js +16598 -0
- package/dist/analyzer/typeEvaluator.js.map +1 -0
- package/dist/analyzer/typeEvaluatorTypes.d.ts +220 -0
- package/dist/analyzer/typeEvaluatorTypes.js +16 -0
- package/dist/analyzer/typeEvaluatorTypes.js.map +1 -0
- package/dist/analyzer/typeEvaluatorWithTracker.d.ts +6 -0
- package/dist/analyzer/typeEvaluatorWithTracker.js +121 -0
- package/dist/analyzer/typeEvaluatorWithTracker.js.map +1 -0
- package/dist/analyzer/typeGuards.d.ts +6 -0
- package/dist/analyzer/typeGuards.js +1293 -0
- package/dist/analyzer/typeGuards.js.map +1 -0
- package/dist/analyzer/typePrinter.d.ts +17 -0
- package/dist/analyzer/typePrinter.js +603 -0
- package/dist/analyzer/typePrinter.js.map +1 -0
- package/dist/analyzer/typeStubWriter.d.ts +48 -0
- package/dist/analyzer/typeStubWriter.js +605 -0
- package/dist/analyzer/typeStubWriter.js.map +1 -0
- package/dist/analyzer/typeUtils.d.ts +134 -0
- package/dist/analyzer/typeUtils.js +2380 -0
- package/dist/analyzer/typeUtils.js.map +1 -0
- package/dist/analyzer/typeVarContext.d.ts +50 -0
- package/dist/analyzer/typeVarContext.js +250 -0
- package/dist/analyzer/typeVarContext.js.map +1 -0
- package/dist/analyzer/typedDicts.d.ts +12 -0
- package/dist/analyzer/typedDicts.js +695 -0
- package/dist/analyzer/typedDicts.js.map +1 -0
- package/dist/analyzer/types.d.ts +484 -0
- package/dist/analyzer/types.js +1844 -0
- package/dist/analyzer/types.js.map +1 -0
- package/dist/backgroundAnalysis.d.ts +14 -0
- package/dist/backgroundAnalysis.js +42 -0
- package/dist/backgroundAnalysis.js.map +1 -0
- package/dist/backgroundAnalysisBase.d.ts +83 -0
- package/dist/backgroundAnalysisBase.js +429 -0
- package/dist/backgroundAnalysisBase.js.map +1 -0
- package/dist/backgroundThreadBase.d.ts +34 -0
- package/dist/backgroundThreadBase.js +134 -0
- package/dist/backgroundThreadBase.js.map +1 -0
- package/dist/commands/commandController.d.ts +13 -0
- package/dist/commands/commandController.js +48 -0
- package/dist/commands/commandController.js.map +1 -0
- package/dist/commands/commandResult.d.ts +9 -0
- package/dist/commands/commandResult.js +19 -0
- package/dist/commands/commandResult.js.map +1 -0
- package/dist/commands/commands.d.ts +7 -0
- package/dist/commands/commands.js +11 -0
- package/dist/commands/commands.js.map +1 -0
- package/dist/commands/createTypeStub.d.ts +8 -0
- package/dist/commands/createTypeStub.js +50 -0
- package/dist/commands/createTypeStub.js.map +1 -0
- package/dist/commands/quickActionCommand.d.ts +8 -0
- package/dist/commands/quickActionCommand.js +31 -0
- package/dist/commands/quickActionCommand.js.map +1 -0
- package/dist/commands/restartServer.d.ts +8 -0
- package/dist/commands/restartServer.js +20 -0
- package/dist/commands/restartServer.js.map +1 -0
- package/dist/common/cancellationUtils.d.ts +16 -0
- package/dist/common/cancellationUtils.js +60 -0
- package/dist/common/cancellationUtils.js.map +1 -0
- package/dist/common/chokidarFileWatcherProvider.d.ts +9 -0
- package/dist/common/chokidarFileWatcherProvider.js +88 -0
- package/dist/common/chokidarFileWatcherProvider.js.map +1 -0
- package/dist/common/collectionUtils.d.ts +114 -0
- package/dist/common/collectionUtils.js +292 -0
- package/dist/common/collectionUtils.js.map +1 -0
- package/dist/common/commandLineOptions.d.ts +41 -0
- package/dist/common/commandLineOptions.js +46 -0
- package/dist/common/commandLineOptions.js.map +1 -0
- package/dist/common/configOptions.d.ts +144 -0
- package/dist/common/configOptions.js +908 -0
- package/dist/common/configOptions.js.map +1 -0
- package/dist/common/console.d.ts +61 -0
- package/dist/common/console.js +191 -0
- package/dist/common/console.js.map +1 -0
- package/dist/common/core.d.ts +67 -0
- package/dist/common/core.js +118 -0
- package/dist/common/core.js.map +1 -0
- package/dist/common/crypto.d.ts +1 -0
- package/dist/common/crypto.js +37 -0
- package/dist/common/crypto.js.map +1 -0
- package/dist/common/debug.d.ts +13 -0
- package/dist/common/debug.js +131 -0
- package/dist/common/debug.js.map +1 -0
- package/dist/common/deferred.d.ts +11 -0
- package/dist/common/deferred.js +62 -0
- package/dist/common/deferred.js.map +1 -0
- package/dist/common/diagnostic.d.ts +59 -0
- package/dist/common/diagnostic.js +134 -0
- package/dist/common/diagnostic.js.map +1 -0
- package/dist/common/diagnosticRules.d.ts +67 -0
- package/dist/common/diagnosticRules.js +83 -0
- package/dist/common/diagnosticRules.js.map +1 -0
- package/dist/common/diagnosticSink.d.ts +34 -0
- package/dist/common/diagnosticSink.js +110 -0
- package/dist/common/diagnosticSink.js.map +1 -0
- package/dist/common/editAction.d.ts +29 -0
- package/dist/common/editAction.js +11 -0
- package/dist/common/editAction.js.map +1 -0
- package/dist/common/extensibility.d.ts +11 -0
- package/dist/common/extensibility.js +10 -0
- package/dist/common/extensibility.js.map +1 -0
- package/dist/common/extensions.d.ts +3 -0
- package/dist/common/extensions.js +15 -0
- package/dist/common/extensions.js.map +1 -0
- package/dist/common/fileBasedCancellationUtils.d.ts +11 -0
- package/dist/common/fileBasedCancellationUtils.js +259 -0
- package/dist/common/fileBasedCancellationUtils.js.map +1 -0
- package/dist/common/fileSystem.d.ts +72 -0
- package/dist/common/fileSystem.js +69 -0
- package/dist/common/fileSystem.js.map +1 -0
- package/dist/common/fullAccessHost.d.ts +19 -0
- package/dist/common/fullAccessHost.js +193 -0
- package/dist/common/fullAccessHost.js.map +1 -0
- package/dist/common/host.d.ts +21 -0
- package/dist/common/host.js +30 -0
- package/dist/common/host.js.map +1 -0
- package/dist/common/logTracker.d.ts +15 -0
- package/dist/common/logTracker.js +129 -0
- package/dist/common/logTracker.js.map +1 -0
- package/dist/common/lspUtils.d.ts +3 -0
- package/dist/common/lspUtils.js +20 -0
- package/dist/common/lspUtils.js.map +1 -0
- package/dist/common/memUtils.d.ts +3 -0
- package/dist/common/memUtils.js +37 -0
- package/dist/common/memUtils.js.map +1 -0
- package/dist/common/pathConsts.d.ts +8 -0
- package/dist/common/pathConsts.js +19 -0
- package/dist/common/pathConsts.js.map +1 -0
- package/dist/common/pathUtils.d.ts +170 -0
- package/dist/common/pathUtils.js +762 -0
- package/dist/common/pathUtils.js.map +1 -0
- package/dist/common/positionUtils.d.ts +7 -0
- package/dist/common/positionUtils.js +71 -0
- package/dist/common/positionUtils.js.map +1 -0
- package/dist/common/progressReporter.d.ts +15 -0
- package/dist/common/progressReporter.js +44 -0
- package/dist/common/progressReporter.js.map +1 -0
- package/dist/common/pythonVersion.d.ts +20 -0
- package/dist/common/pythonVersion.js +71 -0
- package/dist/common/pythonVersion.js.map +1 -0
- package/dist/common/realFileSystem.d.ts +8 -0
- package/dist/common/realFileSystem.js +368 -0
- package/dist/common/realFileSystem.js.map +1 -0
- package/dist/common/stringUtils.d.ts +47 -0
- package/dist/common/stringUtils.js +160 -0
- package/dist/common/stringUtils.js.map +1 -0
- package/dist/common/textEditUtils.d.ts +3 -0
- package/dist/common/textEditUtils.js +29 -0
- package/dist/common/textEditUtils.js.map +1 -0
- package/dist/common/textRange.d.ts +47 -0
- package/dist/common/textRange.js +211 -0
- package/dist/common/textRange.js.map +1 -0
- package/dist/common/textRangeCollection.d.ts +13 -0
- package/dist/common/textRangeCollection.js +108 -0
- package/dist/common/textRangeCollection.js.map +1 -0
- package/dist/common/timing.d.ts +31 -0
- package/dist/common/timing.js +100 -0
- package/dist/common/timing.js.map +1 -0
- package/dist/common/uriParser.d.ts +12 -0
- package/dist/common/uriParser.js +25 -0
- package/dist/common/uriParser.js.map +1 -0
- package/dist/common/workspaceEditUtils.d.ts +7 -0
- package/dist/common/workspaceEditUtils.js +63 -0
- package/dist/common/workspaceEditUtils.js.map +1 -0
- package/dist/languageServerBase.d.ts +211 -0
- package/dist/languageServerBase.js +923 -0
- package/dist/languageServerBase.js.map +1 -0
- package/dist/languageService/analyzerServiceExecutor.d.ts +8 -0
- package/dist/languageService/analyzerServiceExecutor.js +97 -0
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -0
- package/dist/languageService/autoImporter.d.ts +84 -0
- package/dist/languageService/autoImporter.js +635 -0
- package/dist/languageService/autoImporter.js.map +1 -0
- package/dist/languageService/callHierarchyProvider.d.ts +12 -0
- package/dist/languageService/callHierarchyProvider.js +368 -0
- package/dist/languageService/callHierarchyProvider.js.map +1 -0
- package/dist/languageService/codeActionProvider.d.ts +6 -0
- package/dist/languageService/codeActionProvider.js +53 -0
- package/dist/languageService/codeActionProvider.js.map +1 -0
- package/dist/languageService/completionProvider.d.ts +147 -0
- package/dist/languageService/completionProvider.js +2220 -0
- package/dist/languageService/completionProvider.js.map +1 -0
- package/dist/languageService/definitionProvider.d.ts +17 -0
- package/dist/languageService/definitionProvider.js +206 -0
- package/dist/languageService/definitionProvider.js.map +1 -0
- package/dist/languageService/documentHighlightProvider.d.ts +7 -0
- package/dist/languageService/documentHighlightProvider.js +63 -0
- package/dist/languageService/documentHighlightProvider.js.map +1 -0
- package/dist/languageService/documentSymbolCollector.d.ts +37 -0
- package/dist/languageService/documentSymbolCollector.js +344 -0
- package/dist/languageService/documentSymbolCollector.js.map +1 -0
- package/dist/languageService/documentSymbolProvider.d.ts +37 -0
- package/dist/languageService/documentSymbolProvider.js +308 -0
- package/dist/languageService/documentSymbolProvider.js.map +1 -0
- package/dist/languageService/hoverProvider.d.ts +25 -0
- package/dist/languageService/hoverProvider.js +366 -0
- package/dist/languageService/hoverProvider.js.map +1 -0
- package/dist/languageService/importAdder.d.ts +24 -0
- package/dist/languageService/importAdder.js +296 -0
- package/dist/languageService/importAdder.js.map +1 -0
- package/dist/languageService/importSorter.d.ts +15 -0
- package/dist/languageService/importSorter.js +152 -0
- package/dist/languageService/importSorter.js.map +1 -0
- package/dist/languageService/indentationUtils.d.ts +4 -0
- package/dist/languageService/indentationUtils.js +597 -0
- package/dist/languageService/indentationUtils.js.map +1 -0
- package/dist/languageService/quickActions.d.ts +4 -0
- package/dist/languageService/quickActions.js +97 -0
- package/dist/languageService/quickActions.js.map +1 -0
- package/dist/languageService/referencesProvider.d.ts +36 -0
- package/dist/languageService/referencesProvider.js +236 -0
- package/dist/languageService/referencesProvider.js.map +1 -0
- package/dist/languageService/renameModuleProvider.d.ts +58 -0
- package/dist/languageService/renameModuleProvider.js +884 -0
- package/dist/languageService/renameModuleProvider.js.map +1 -0
- package/dist/languageService/signatureHelpProvider.d.ts +26 -0
- package/dist/languageService/signatureHelpProvider.js +180 -0
- package/dist/languageService/signatureHelpProvider.js.map +1 -0
- package/dist/languageService/tooltipUtils.d.ts +9 -0
- package/dist/languageService/tooltipUtils.js +129 -0
- package/dist/languageService/tooltipUtils.js.map +1 -0
- package/dist/localization/localize.d.ts +1324 -0
- package/dist/localization/localize.js +788 -0
- package/dist/localization/localize.js.map +1 -0
- package/dist/localization/package.nls.de.json +1 -0
- package/dist/localization/package.nls.en-us.json +636 -0
- package/dist/localization/package.nls.es.json +1 -0
- package/dist/localization/package.nls.fr.json +1 -0
- package/dist/localization/package.nls.ja.json +1 -0
- package/dist/localization/package.nls.ru.json +1 -0
- package/dist/localization/package.nls.zh-cn.json +1 -0
- package/dist/localization/package.nls.zh-tw.json +1 -0
- package/dist/nodeMain.d.ts +1 -0
- package/dist/nodeMain.js +21 -0
- package/dist/nodeMain.js.map +1 -0
- package/dist/nodeServer.d.ts +3 -0
- package/dist/nodeServer.js +31 -0
- package/dist/nodeServer.js.map +1 -0
- package/dist/parser/characterStream.d.ts +27 -0
- package/dist/parser/characterStream.js +120 -0
- package/dist/parser/characterStream.js.map +1 -0
- package/dist/parser/characters.d.ts +17 -0
- package/dist/parser/characters.js +240 -0
- package/dist/parser/characters.js.map +1 -0
- package/dist/parser/parseNodes.d.ts +750 -0
- package/dist/parser/parseNodes.js +1406 -0
- package/dist/parser/parseNodes.js.map +1 -0
- package/dist/parser/parser.d.ts +191 -0
- package/dist/parser/parser.js +3806 -0
- package/dist/parser/parser.js.map +1 -0
- package/dist/parser/stringTokenUtils.d.ts +25 -0
- package/dist/parser/stringTokenUtils.js +455 -0
- package/dist/parser/stringTokenUtils.js.map +1 -0
- package/dist/parser/tokenizer.d.ts +71 -0
- package/dist/parser/tokenizer.js +1111 -0
- package/dist/parser/tokenizer.js.map +1 -0
- package/dist/parser/tokenizerTypes.d.ts +223 -0
- package/dist/parser/tokenizerTypes.js +164 -0
- package/dist/parser/tokenizerTypes.js.map +1 -0
- package/dist/parser/unicode.d.ts +23 -0
- package/dist/parser/unicode.js +2899 -0
- package/dist/parser/unicode.js.map +1 -0
- package/dist/pyright.d.ts +1 -0
- package/dist/pyright.js +645 -0
- package/dist/pyright.js.map +1 -0
- package/dist/pyrightFileSystem.d.ts +28 -0
- package/dist/pyrightFileSystem.js +196 -0
- package/dist/pyrightFileSystem.js.map +1 -0
- package/dist/readonlyAugmentedFileSystem.d.ts +40 -0
- package/dist/readonlyAugmentedFileSystem.js +155 -0
- package/dist/readonlyAugmentedFileSystem.js.map +1 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.js +232 -0
- package/dist/server.js.map +1 -0
- package/dist/tests/chainedSourceFiles.test.d.ts +1 -0
- package/dist/tests/chainedSourceFiles.test.js +153 -0
- package/dist/tests/chainedSourceFiles.test.js.map +1 -0
- package/dist/tests/checker.test.d.ts +1 -0
- package/dist/tests/checker.test.js +346 -0
- package/dist/tests/checker.test.js.map +1 -0
- package/dist/tests/collectionUtils.test.d.ts +1 -0
- package/dist/tests/collectionUtils.test.js +153 -0
- package/dist/tests/collectionUtils.test.js.map +1 -0
- package/dist/tests/common.test.d.ts +1 -0
- package/dist/tests/common.test.js +125 -0
- package/dist/tests/common.test.js.map +1 -0
- package/dist/tests/config.test.d.ts +1 -0
- package/dist/tests/config.test.js +230 -0
- package/dist/tests/config.test.js.map +1 -0
- package/dist/tests/debug.test.d.ts +1 -0
- package/dist/tests/debug.test.js +102 -0
- package/dist/tests/debug.test.js.map +1 -0
- package/dist/tests/deferred.test.d.ts +1 -0
- package/dist/tests/deferred.test.js +65 -0
- package/dist/tests/deferred.test.js.map +1 -0
- package/dist/tests/diagnosticOverrides.test.d.ts +1 -0
- package/dist/tests/diagnosticOverrides.test.js +108 -0
- package/dist/tests/diagnosticOverrides.test.js.map +1 -0
- package/dist/tests/docStringConversion.test.d.ts +1 -0
- package/dist/tests/docStringConversion.test.js +695 -0
- package/dist/tests/docStringConversion.test.js.map +1 -0
- package/dist/tests/docStringUtils.test.d.ts +1 -0
- package/dist/tests/docStringUtils.test.js +70 -0
- package/dist/tests/docStringUtils.test.js.map +1 -0
- package/dist/tests/documentSymbolCollector.test.d.ts +1 -0
- package/dist/tests/documentSymbolCollector.test.js +635 -0
- package/dist/tests/documentSymbolCollector.test.js.map +1 -0
- package/dist/tests/filesystem.test.d.ts +1 -0
- package/dist/tests/filesystem.test.js +194 -0
- package/dist/tests/filesystem.test.js.map +1 -0
- package/dist/tests/fourSlashParser.test.d.ts +1 -0
- package/dist/tests/fourSlashParser.test.js +281 -0
- package/dist/tests/fourSlashParser.test.js.map +1 -0
- package/dist/tests/fourSlashRunner.test.d.ts +1 -0
- package/dist/tests/fourSlashRunner.test.js +52 -0
- package/dist/tests/fourSlashRunner.test.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.js +30 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.js +42 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.NotFound.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.NotFound.fourslash.js +13 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.NotFound.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.disabled.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.disabled.fourslash.js +23 -0
- package/dist/tests/fourslash/completions.autoimport.disabled.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.js +35 -0
- package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.fourslash.js +27 -0
- package/dist/tests/fourslash/completions.autoimport.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.js +128 -0
- package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.js +27 -0
- package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.js +43 -0
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.js +29 -0
- package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.js +50 -0
- package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.js +116 -0
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.builtinOverride.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.builtinOverride.fourslash.js +21 -0
- package/dist/tests/fourslash/completions.builtinOverride.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.js +54 -0
- package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.js +245 -0
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.js +162 -0
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.js +132 -0
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.classVariable.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.classVariable.fourslash.js +37 -0
- package/dist/tests/fourslash/completions.classVariable.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.comment.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.comment.fourslash.js +27 -0
- package/dist/tests/fourslash/completions.comment.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.class.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.class.fourslash.js +30 -0
- package/dist/tests/fourslash/completions.declNames.class.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.exception.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.exception.fourslash.js +18 -0
- package/dist/tests/fourslash/completions.declNames.exception.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.for.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.for.fourslash.js +26 -0
- package/dist/tests/fourslash/completions.declNames.for.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.importAlias.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.importAlias.fourslash.js +15 -0
- package/dist/tests/fourslash/completions.declNames.importAlias.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.lambda.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.lambda.fourslash.js +36 -0
- package/dist/tests/fourslash/completions.declNames.lambda.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.method.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.method.fourslash.js +68 -0
- package/dist/tests/fourslash/completions.declNames.method.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.overload.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.overload.fourslash.js +147 -0
- package/dist/tests/fourslash/completions.declNames.overload.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.js +131 -0
- package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.js +73 -0
- package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.js +58 -0
- package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.js +154 -0
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.js +143 -0
- package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.js +109 -0
- package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.js +50 -0
- package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.enums.members.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.enums.members.fourslash.js +44 -0
- package/dist/tests/fourslash/completions.enums.members.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.excluded.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.excluded.fourslash.js +12 -0
- package/dist/tests/fourslash/completions.excluded.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.fourslash.js +51 -0
- package/dist/tests/fourslash/completions.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fstring.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.fstring.fourslash.js +32 -0
- package/dist/tests/fourslash/completions.fstring.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.js +96 -0
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fuzzyMatching.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.fuzzyMatching.fourslash.js +30 -0
- package/dist/tests/fourslash/completions.fuzzyMatching.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.importDunderNames.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.importDunderNames.fourslash.js +29 -0
- package/dist/tests/fourslash/completions.importDunderNames.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.importSubmodule.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.importSubmodule.fourslash.js +22 -0
- package/dist/tests/fourslash/completions.importSubmodule.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.importsDuplicates.fourslash.d.ts +0 -0
- package/dist/tests/fourslash/completions.importsDuplicates.fourslash.js +22 -0
- package/dist/tests/fourslash/completions.importsDuplicates.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inList.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inList.fourslash.js +32 -0
- package/dist/tests/fourslash/completions.inList.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.included.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.included.fourslash.js +12 -0
- package/dist/tests/fourslash/completions.included.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.js +54 -0
- package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.function.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.function.docFromStub.fourslash.js +26 -0
- package/dist/tests/fourslash/completions.inherited.function.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.js +49 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.js +50 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromSrc.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromSrc.fourslash.js +101 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromSrc.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromStub.fourslash.js +105 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.js +67 -0
- package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.js +75 -0
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.js +66 -0
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.libStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.libStub.fourslash.js +66 -0
- package/dist/tests/fourslash/completions.libStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.literals.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.literals.fourslash.js +31 -0
- package/dist/tests/fourslash/completions.literals.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.localCode.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.localCode.fourslash.js +71 -0
- package/dist/tests/fourslash/completions.localCode.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownMemberOnInstance.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownMemberOnInstance.fourslash.js +17 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownMemberOnInstance.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownStaticFunctionOnClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownStaticFunctionOnClass.fourslash.js +57 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownStaticFunctionOnClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.moduleContext.libCodeNoStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.moduleContext.libCodeNoStub.fourslash.js +27 -0
- package/dist/tests/fourslash/completions.moduleContext.libCodeNoStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.overloads.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.overloads.fourslash.js +37 -0
- package/dist/tests/fourslash/completions.overloads.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.default.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.default.fourslash.js +47 -0
- package/dist/tests/fourslash/completions.override.default.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.default.importStub.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.default.importStub.js +49 -0
- package/dist/tests/fourslash/completions.override.default.importStub.js.map +1 -0
- package/dist/tests/fourslash/completions.override.default.imported.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.default.imported.fourslash.js +60 -0
- package/dist/tests/fourslash/completions.override.default.imported.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.default.stub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.default.stub.fourslash.js +47 -0
- package/dist/tests/fourslash/completions.override.default.stub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.fourslash.js +47 -0
- package/dist/tests/fourslash/completions.override.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.property.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.property.fourslash.js +31 -0
- package/dist/tests/fourslash/completions.override.property.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.property.stub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.property.stub.fourslash.js +31 -0
- package/dist/tests/fourslash/completions.override.property.stub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.js +63 -0
- package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.stub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.stub.fourslash.js +47 -0
- package/dist/tests/fourslash/completions.override.stub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override2.fourslash.js +66 -0
- package/dist/tests/fourslash/completions.override2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.parameters.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.parameters.fourslash.js +22 -0
- package/dist/tests/fourslash/completions.parameters.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.params.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.params.fourslash.js +23 -0
- package/dist/tests/fourslash/completions.params.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.parentFolder.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.parentFolder.fourslash.js +15 -0
- package/dist/tests/fourslash/completions.parentFolder.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.parentFolders.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.parentFolders.fourslash.js +68 -0
- package/dist/tests/fourslash/completions.parentFolders.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.plainText.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.plainText.fourslash.js +34 -0
- package/dist/tests/fourslash/completions.plainText.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.private.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.private.fourslash.js +61 -0
- package/dist/tests/fourslash/completions.private.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.property.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.property.fourslash.js +28 -0
- package/dist/tests/fourslash/completions.property.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.propertyDocStrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.propertyDocStrings.fourslash.js +64 -0
- package/dist/tests/fourslash/completions.propertyDocStrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.self.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.self.fourslash.js +43 -0
- package/dist/tests/fourslash/completions.self.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.js +71 -0
- package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.js +78 -0
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.typeAlias.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.typeAlias.fourslash.js +29 -0
- package/dist/tests/fourslash/completions.typeAlias.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.typeshed.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.typeshed.fourslash.js +9 -0
- package/dist/tests/fourslash/completions.typeshed.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.vardecls.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.vardecls.fourslash.js +33 -0
- package/dist/tests/fourslash/completions.vardecls.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.variableDocStrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.variableDocStrings.fourslash.js +68 -0
- package/dist/tests/fourslash/completions.variableDocStrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.js +109 -0
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.with.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.with.fourslash.js +25 -0
- package/dist/tests/fourslash/completions.with.fourslash.js.map +1 -0
- package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.js +64 -0
- package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.js +24 -0
- package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.classes.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.classes.fourslash.js +93 -0
- package/dist/tests/fourslash/findDefinitions.classes.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.js +23 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.js +19 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.js +23 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.js +20 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.fields.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.fields.fourslash.js +123 -0
- package/dist/tests/fourslash/findDefinitions.fields.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.functions.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.functions.fourslash.js +79 -0
- package/dist/tests/fourslash/findDefinitions.functions.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.methods.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.methods.fourslash.js +154 -0
- package/dist/tests/fourslash/findDefinitions.methods.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.modules.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.modules.fourslash.js +42 -0
- package/dist/tests/fourslash/findDefinitions.modules.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.js +34 -0
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.overloads.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.overloads.fourslash.js +213 -0
- package/dist/tests/fourslash/findDefinitions.overloads.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.parameters.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.parameters.fourslash.js +154 -0
- package/dist/tests/fourslash/findDefinitions.parameters.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.js +23 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.js +29 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.js +30 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.js +25 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.js +26 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.js +28 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.js +33 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.js +26 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.js +25 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.js +25 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.js +20 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.js +20 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.js +59 -0
- package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.js +59 -0
- package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.js +94 -0
- package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.variables.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.variables.fourslash.js +79 -0
- package/dist/tests/fourslash/findDefinitions.variables.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.js +106 -0
- package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.js +24 -0
- package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.js +66 -0
- package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.js +26 -0
- package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.js +36 -0
- package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.fourslash.js +30 -0
- package/dist/tests/fourslash/findallreferences.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.importalias.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.importalias.fourslash.js +30 -0
- package/dist/tests/fourslash/findallreferences.importalias.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.js +46 -0
- package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.module.nested.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.module.nested.fourslash.js +60 -0
- package/dist/tests/fourslash/findallreferences.module.nested.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.js +54 -0
- package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.modules.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.modules.fourslash.js +41 -0
- package/dist/tests/fourslash/findallreferences.modules.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.js +83 -0
- package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.openFiles.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.openFiles.fourslash.js +32 -0
- package/dist/tests/fourslash/findallreferences.openFiles.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.parameter.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.parameter.fourslash.js +22 -0
- package/dist/tests/fourslash/findallreferences.parameter.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.js +29 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.js +33 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.js +36 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.js +44 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.js +31 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.variable.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.variable.fourslash.js +22 -0
- package/dist/tests/fourslash/findallreferences.variable.fourslash.js.map +1 -0
- package/dist/tests/fourslash/fourslash.d.ts +301 -0
- package/dist/tests/fourslash/fourslash.js +25 -0
- package/dist/tests/fourslash/fourslash.js.map +1 -0
- package/dist/tests/fourslash/highlightreferences.attributes.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/highlightreferences.attributes.fourslash.js +30 -0
- package/dist/tests/fourslash/highlightreferences.attributes.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.js +63 -0
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.classNoInit.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.classNoInit.fourslash.js +14 -0
- package/dist/tests/fourslash/hover.classNoInit.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromScr.stringFormat.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromScr.stringFormat.fourslash.js +47 -0
- package/dist/tests/fourslash/hover.docFromScr.stringFormat.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.js +77 -0
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.js +22 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.js +22 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.js +21 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.js +20 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.js +38 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.js +25 -0
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.js +18 -0
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docstring.links.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docstring.links.fourslash.js +12 -0
- package/dist/tests/fourslash/hover.docstring.links.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docstring.overloads.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docstring.overloads.fourslash.js +38 -0
- package/dist/tests/fourslash/hover.docstring.overloads.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docstring.split.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docstring.split.fourslash.js +24 -0
- package/dist/tests/fourslash/hover.docstring.split.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.fourslash.js +20 -0
- package/dist/tests/fourslash/hover.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.import.django.view.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.import.django.view.fourslash.js +23 -0
- package/dist/tests/fourslash/hover.import.django.view.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.import.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.import.fourslash.js +10 -0
- package/dist/tests/fourslash/hover.import.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.js +61 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.js +51 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.js +40 -0
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.js +43 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.js +44 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromSrcWithStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromSrcWithStub.fourslash.js +84 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromSrcWithStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromStub.fourslash.js +88 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.init.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.init.fourslash.js +38 -0
- package/dist/tests/fourslash/hover.init.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.js +49 -0
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.js +39 -0
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.libStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.libStub.fourslash.js +39 -0
- package/dist/tests/fourslash/hover.libStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.optionalAliasParameter.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.optionalAliasParameter.fourslash.js +14 -0
- package/dist/tests/fourslash/hover.optionalAliasParameter.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.plainText.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.plainText.fourslash.js +20 -0
- package/dist/tests/fourslash/hover.plainText.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.typedDict.key.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.typedDict.key.fourslash.js +50 -0
- package/dist/tests/fourslash/hover.typedDict.key.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.variable.docString.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.variable.docString.fourslash.js +35 -0
- package/dist/tests/fourslash/hover.variable.docString.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.js +73 -0
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.publicSymbols.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.publicSymbols.fourslash.js +63 -0
- package/dist/tests/fourslash/import.publicSymbols.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.pytyped.dunderAll.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.pytyped.dunderAll.fourslash.js +72 -0
- package/dist/tests/fourslash/import.pytyped.dunderAll.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.pytyped.privateSymbols.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.pytyped.privateSymbols.fourslash.js +61 -0
- package/dist/tests/fourslash/import.pytyped.privateSymbols.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.js +35 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.js +35 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.wildcard.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.wildcard.fourslash.js +24 -0
- package/dist/tests/fourslash/import.wildcard.fourslash.js.map +1 -0
- package/dist/tests/fourslash/importnotresolved.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/importnotresolved.fourslash.js +13 -0
- package/dist/tests/fourslash/importnotresolved.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingModuleSource.disablingInStrictMode.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingModuleSource.disablingInStrictMode.fourslash.js +18 -0
- package/dist/tests/fourslash/missingModuleSource.disablingInStrictMode.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingModuleSource.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingModuleSource.fourslash.js +13 -0
- package/dist/tests/fourslash/missingModuleSource.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.codeAction.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingTypeStub.codeAction.fourslash.js +31 -0
- package/dist/tests/fourslash/missingTypeStub.codeAction.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.command.multipart.fourslash.d.ts +7 -0
- package/dist/tests/fourslash/missingTypeStub.command.multipart.fourslash.js +44 -0
- package/dist/tests/fourslash/missingTypeStub.command.multipart.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlefile.fourslash.d.ts +7 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlefile.fourslash.js +35 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlefile.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlepart.fourslash.d.ts +7 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlepart.fourslash.js +35 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlepart.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingTypeStub.fourslash.js +18 -0
- package/dist/tests/fourslash/missingTypeStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.invokeCodeAction.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingTypeStub.invokeCodeAction.fourslash.js +34 -0
- package/dist/tests/fourslash/missingTypeStub.invokeCodeAction.fourslash.js.map +1 -0
- package/dist/tests/fourslash/noerrors.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/noerrors.fourslash.js +9 -0
- package/dist/tests/fourslash/noerrors.fourslash.js.map +1 -0
- package/dist/tests/fourslash/orderImports1.command.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/orderImports1.command.fourslash.js +17 -0
- package/dist/tests/fourslash/orderImports1.command.fourslash.js.map +1 -0
- package/dist/tests/fourslash/orderImports2.command.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/orderImports2.command.fourslash.js +21 -0
- package/dist/tests/fourslash/orderImports2.command.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.externallyHidden.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.externallyHidden.fourslash.js +23 -0
- package/dist/tests/fourslash/rename.externallyHidden.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.externallyHidden.params.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.externallyHidden.params.fourslash.js +23 -0
- package/dist/tests/fourslash/rename.externallyHidden.params.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.fourslash.js +26 -0
- package/dist/tests/fourslash/rename.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.library.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.library.fourslash.js +26 -0
- package/dist/tests/fourslash/rename.library.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.library.sourceAndStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.library.sourceAndStub.fourslash.js +29 -0
- package/dist/tests/fourslash/rename.library.sourceAndStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.multipleDecl.fourslash.d.ts +2 -0
- package/dist/tests/fourslash/rename.multipleDecl.fourslash.js +19 -0
- package/dist/tests/fourslash/rename.multipleDecl.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.sourceAndStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.sourceAndStub.fourslash.js +33 -0
- package/dist/tests/fourslash/rename.sourceAndStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.string.excluded.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.string.excluded.fourslash.js +39 -0
- package/dist/tests/fourslash/rename.string.excluded.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.string.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.string.fourslash.js +25 -0
- package/dist/tests/fourslash/rename.string.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js +62 -0
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.complicated.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.complicated.fourslash.js +97 -0
- package/dist/tests/fourslash/signature.complicated.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.cornercases.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.cornercases.fourslash.js +22 -0
- package/dist/tests/fourslash/signature.cornercases.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.docstrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.docstrings.fourslash.js +42 -0
- package/dist/tests/fourslash/signature.docstrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.js +49 -0
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.js +115 -0
- package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.overload.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.overload.fourslash.js +63 -0
- package/dist/tests/fourslash/signature.overload.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.simple.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.simple.fourslash.js +104 -0
- package/dist/tests/fourslash/signature.simple.fourslash.js.map +1 -0
- package/dist/tests/harness/fourslash/fourSlashParser.d.ts +10 -0
- package/dist/tests/harness/fourslash/fourSlashParser.js +347 -0
- package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -0
- package/dist/tests/harness/fourslash/fourSlashTypes.d.ts +81 -0
- package/dist/tests/harness/fourslash/fourSlashTypes.js +65 -0
- package/dist/tests/harness/fourslash/fourSlashTypes.js.map +1 -0
- package/dist/tests/harness/fourslash/runner.d.ts +20 -0
- package/dist/tests/harness/fourslash/runner.js +93 -0
- package/dist/tests/harness/fourslash/runner.js.map +1 -0
- package/dist/tests/harness/fourslash/testLanguageService.d.ts +40 -0
- package/dist/tests/harness/fourslash/testLanguageService.js +120 -0
- package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -0
- package/dist/tests/harness/fourslash/testState.Consts.d.ts +11 -0
- package/dist/tests/harness/fourslash/testState.Consts.js +50 -0
- package/dist/tests/harness/fourslash/testState.Consts.js.map +1 -0
- package/dist/tests/harness/fourslash/testState.d.ts +232 -0
- package/dist/tests/harness/fourslash/testState.js +1381 -0
- package/dist/tests/harness/fourslash/testState.js.map +1 -0
- package/dist/tests/harness/testAccessHost.d.ts +8 -0
- package/dist/tests/harness/testAccessHost.js +26 -0
- package/dist/tests/harness/testAccessHost.js.map +1 -0
- package/dist/tests/harness/testHost.d.ts +16 -0
- package/dist/tests/harness/testHost.js +161 -0
- package/dist/tests/harness/testHost.js.map +1 -0
- package/dist/tests/harness/utils.d.ts +74 -0
- package/dist/tests/harness/utils.js +328 -0
- package/dist/tests/harness/utils.js.map +1 -0
- package/dist/tests/harness/vfs/factory.d.ts +32 -0
- package/dist/tests/harness/vfs/factory.js +173 -0
- package/dist/tests/harness/vfs/factory.js.map +1 -0
- package/dist/tests/harness/vfs/filesystem.d.ts +430 -0
- package/dist/tests/harness/vfs/filesystem.js +1455 -0
- package/dist/tests/harness/vfs/filesystem.js.map +1 -0
- package/dist/tests/harness/vfs/pathValidation.d.ts +24 -0
- package/dist/tests/harness/vfs/pathValidation.js +123 -0
- package/dist/tests/harness/vfs/pathValidation.js.map +1 -0
- package/dist/tests/importAdder.test.d.ts +1 -0
- package/dist/tests/importAdder.test.js +1192 -0
- package/dist/tests/importAdder.test.js.map +1 -0
- package/dist/tests/importResolver.test.d.ts +1 -0
- package/dist/tests/importResolver.test.js +450 -0
- package/dist/tests/importResolver.test.js.map +1 -0
- package/dist/tests/importStatementUtils.test.d.ts +1 -0
- package/dist/tests/importStatementUtils.test.js +371 -0
- package/dist/tests/importStatementUtils.test.js.map +1 -0
- package/dist/tests/indentationUtils.ptvs.test.d.ts +1 -0
- package/dist/tests/indentationUtils.ptvs.test.js +324 -0
- package/dist/tests/indentationUtils.ptvs.test.js.map +1 -0
- package/dist/tests/indentationUtils.reindent.test.d.ts +1 -0
- package/dist/tests/indentationUtils.reindent.test.js +332 -0
- package/dist/tests/indentationUtils.reindent.test.js.map +1 -0
- package/dist/tests/indentationUtils.test.d.ts +1 -0
- package/dist/tests/indentationUtils.test.js +375 -0
- package/dist/tests/indentationUtils.test.js.map +1 -0
- package/dist/tests/ipythonMode.test.d.ts +1 -0
- package/dist/tests/ipythonMode.test.js +303 -0
- package/dist/tests/ipythonMode.test.js.map +1 -0
- package/dist/tests/localizer.test.d.ts +1 -0
- package/dist/tests/localizer.test.js +64 -0
- package/dist/tests/localizer.test.js.map +1 -0
- package/dist/tests/parseTreeUtils.test.d.ts +1 -0
- package/dist/tests/parseTreeUtils.test.js +228 -0
- package/dist/tests/parseTreeUtils.test.js.map +1 -0
- package/dist/tests/parser.test.d.ts +1 -0
- package/dist/tests/parser.test.js +101 -0
- package/dist/tests/parser.test.js.map +1 -0
- package/dist/tests/pathUtils.test.d.ts +1 -0
- package/dist/tests/pathUtils.test.js +253 -0
- package/dist/tests/pathUtils.test.js.map +1 -0
- package/dist/tests/pyrightFileSystem.test.d.ts +1 -0
- package/dist/tests/pyrightFileSystem.test.js +152 -0
- package/dist/tests/pyrightFileSystem.test.js.map +1 -0
- package/dist/tests/renameModule.folder.test.d.ts +1 -0
- package/dist/tests/renameModule.folder.test.js +229 -0
- package/dist/tests/renameModule.folder.test.js.map +1 -0
- package/dist/tests/renameModule.fromImports.test.d.ts +1 -0
- package/dist/tests/renameModule.fromImports.test.js +790 -0
- package/dist/tests/renameModule.fromImports.test.js.map +1 -0
- package/dist/tests/renameModule.imports.test.d.ts +1 -0
- package/dist/tests/renameModule.imports.test.js +380 -0
- package/dist/tests/renameModule.imports.test.js.map +1 -0
- package/dist/tests/renameModule.misc.test.d.ts +1 -0
- package/dist/tests/renameModule.misc.test.js +615 -0
- package/dist/tests/renameModule.misc.test.js.map +1 -0
- package/dist/tests/renameModule.relativePath.test.d.ts +1 -0
- package/dist/tests/renameModule.relativePath.test.js +231 -0
- package/dist/tests/renameModule.relativePath.test.js.map +1 -0
- package/dist/tests/renameModuleTestUtils.d.ts +4 -0
- package/dist/tests/renameModuleTestUtils.js +148 -0
- package/dist/tests/renameModuleTestUtils.js.map +1 -0
- package/dist/tests/sourceFile.test.d.ts +1 -0
- package/dist/tests/sourceFile.test.js +25 -0
- package/dist/tests/sourceFile.test.js.map +1 -0
- package/dist/tests/stringUtils.test.d.ts +1 -0
- package/dist/tests/stringUtils.test.js +69 -0
- package/dist/tests/stringUtils.test.js.map +1 -0
- package/dist/tests/symbolNameUtils.test.d.ts +1 -0
- package/dist/tests/symbolNameUtils.test.js +83 -0
- package/dist/tests/symbolNameUtils.test.js.map +1 -0
- package/dist/tests/testState.test.d.ts +1 -0
- package/dist/tests/testState.test.js +521 -0
- package/dist/tests/testState.test.js.map +1 -0
- package/dist/tests/testUtils.d.ts +27 -0
- package/dist/tests/testUtils.js +213 -0
- package/dist/tests/testUtils.js.map +1 -0
- package/dist/tests/tokenizer.test.d.ts +1 -0
- package/dist/tests/tokenizer.test.js +1277 -0
- package/dist/tests/tokenizer.test.js.map +1 -0
- package/dist/tests/typeEvaluator1.test.d.ts +1 -0
- package/dist/tests/typeEvaluator1.test.js +1023 -0
- package/dist/tests/typeEvaluator1.test.js.map +1 -0
- package/dist/tests/typeEvaluator2.test.d.ts +1 -0
- package/dist/tests/typeEvaluator2.test.js +869 -0
- package/dist/tests/typeEvaluator2.test.js.map +1 -0
- package/dist/tests/typeEvaluator3.test.d.ts +1 -0
- package/dist/tests/typeEvaluator3.test.js +915 -0
- package/dist/tests/typeEvaluator3.test.js.map +1 -0
- package/dist/tests/typeEvaluator4.test.d.ts +1 -0
- package/dist/tests/typeEvaluator4.test.js +901 -0
- package/dist/tests/typeEvaluator4.test.js.map +1 -0
- package/dist/tests/updateSymbolReference.test.d.ts +1 -0
- package/dist/tests/updateSymbolReference.test.js +980 -0
- package/dist/tests/updateSymbolReference.test.js.map +1 -0
- package/dist/tests/zipfs.test.d.ts +1 -0
- package/dist/tests/zipfs.test.js +112 -0
- package/dist/tests/zipfs.test.js.map +1 -0
- package/dist/workspaceMap.d.ts +6 -0
- package/dist/workspaceMap.js +73 -0
- package/dist/workspaceMap.js.map +1 -0
- package/package.json +45 -0
@@ -0,0 +1,1132 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* codeFlowEngine.ts
|
4
|
+
* Copyright (c) Microsoft Corporation.
|
5
|
+
* Licensed under the MIT license.
|
6
|
+
* Author: Eric Traut
|
7
|
+
*
|
8
|
+
* Code that traverses the code flow graph to determine the (narrowed)
|
9
|
+
* type of a variable or expression or the reachability of a statement.
|
10
|
+
*
|
11
|
+
* This is largely based on the code flow engine in the
|
12
|
+
* TypeScript compiler.
|
13
|
+
*/
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
exports.getCodeFlowEngine = void 0;
|
16
|
+
const debug_1 = require("../common/debug");
|
17
|
+
const positionUtils_1 = require("../common/positionUtils");
|
18
|
+
const analyzerNodeInfo_1 = require("./analyzerNodeInfo");
|
19
|
+
const codeFlowTypes_1 = require("./codeFlowTypes");
|
20
|
+
const codeFlowUtils_1 = require("./codeFlowUtils");
|
21
|
+
const parseTreeUtils_1 = require("./parseTreeUtils");
|
22
|
+
const typeCache_1 = require("./typeCache");
|
23
|
+
const typeGuards_1 = require("./typeGuards");
|
24
|
+
const types_1 = require("./types");
|
25
|
+
const typeUtils_1 = require("./typeUtils");
|
26
|
+
// This debugging option prints the control flow graph when getTypeFromCodeFlow is called.
|
27
|
+
const isPrintControlFlowGraphEnabled = false;
|
28
|
+
// This debugging option prints the results of calls to isCallNoReturn.
|
29
|
+
const isPrintCallNoReturnEnabled = false;
|
30
|
+
function getCodeFlowEngine(evaluator, speculativeTypeTracker) {
|
31
|
+
const isReachableRecursionMap = new Map();
|
32
|
+
const callIsNoReturnCache = new Map();
|
33
|
+
const isExceptionContextManagerCache = new Map();
|
34
|
+
let flowIncompleteGeneration = 1;
|
35
|
+
let noReturnAnalysisDepth = 0;
|
36
|
+
let contextManagerAnalysisDepth = 0;
|
37
|
+
// Creates a new code flow analyzer that can be used to narrow the types
|
38
|
+
// of the expressions within an execution context. Each code flow analyzer
|
39
|
+
// instance maintains a cache of types it has already determined.
|
40
|
+
function createCodeFlowAnalyzer() {
|
41
|
+
const flowNodeTypeCacheSet = new Map();
|
42
|
+
function getFlowNodeTypeCacheForReference(referenceKey) {
|
43
|
+
let flowNodeTypeCache = flowNodeTypeCacheSet.get(referenceKey);
|
44
|
+
if (!flowNodeTypeCache) {
|
45
|
+
flowNodeTypeCache = new Map();
|
46
|
+
flowNodeTypeCacheSet.set(referenceKey, flowNodeTypeCache);
|
47
|
+
}
|
48
|
+
return flowNodeTypeCache;
|
49
|
+
}
|
50
|
+
function getTypeFromCodeFlow(flowNode, reference, targetSymbolId, initialType, isInitialTypeIncomplete, ignoreNoReturn) {
|
51
|
+
if (isPrintControlFlowGraphEnabled) {
|
52
|
+
printControlFlowGraph(flowNode, reference, 'getTypeFromCodeFlow');
|
53
|
+
}
|
54
|
+
const referenceKey = reference !== undefined ? (0, codeFlowTypes_1.createKeyForReference)(reference) : undefined;
|
55
|
+
let subexpressionReferenceKeys;
|
56
|
+
const referenceKeyWithSymbolId = referenceKey !== undefined && targetSymbolId !== undefined
|
57
|
+
? referenceKey + `.${targetSymbolId.toString()}`
|
58
|
+
: '.';
|
59
|
+
const flowNodeTypeCache = getFlowNodeTypeCacheForReference(referenceKeyWithSymbolId);
|
60
|
+
// Caches the type of the flow node in our local cache, keyed by the flow node ID.
|
61
|
+
function setCacheEntry(flowNode, type, isIncomplete, isRecursionSentinel) {
|
62
|
+
if (!isIncomplete) {
|
63
|
+
flowIncompleteGeneration++;
|
64
|
+
}
|
65
|
+
else if (type) {
|
66
|
+
const prevEntry = flowNodeTypeCache.get(flowNode.id);
|
67
|
+
if (prevEntry === undefined) {
|
68
|
+
flowIncompleteGeneration++;
|
69
|
+
}
|
70
|
+
else if (prevEntry.isIncompleteType) {
|
71
|
+
const prevIncompleteType = prevEntry;
|
72
|
+
if (prevIncompleteType.type && !(0, types_1.isTypeSame)(prevIncompleteType.type, type)) {
|
73
|
+
flowIncompleteGeneration++;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
// For speculative or incomplete types, we'll create a separate
|
78
|
+
// object. For non-speculative and complete types, we'll store
|
79
|
+
// the type directly.
|
80
|
+
const entry = isIncomplete
|
81
|
+
? {
|
82
|
+
isIncompleteType: true,
|
83
|
+
type,
|
84
|
+
incompleteSubtypes: [],
|
85
|
+
generationCount: flowIncompleteGeneration,
|
86
|
+
isRecursionSentinel,
|
87
|
+
}
|
88
|
+
: type;
|
89
|
+
flowNodeTypeCache.set(flowNode.id, entry);
|
90
|
+
speculativeTypeTracker.trackEntry(flowNodeTypeCache, flowNode.id);
|
91
|
+
return {
|
92
|
+
type,
|
93
|
+
isIncomplete,
|
94
|
+
isRecursionSentinel,
|
95
|
+
generationCount: flowIncompleteGeneration,
|
96
|
+
incompleteSubtypes: isIncomplete ? [] : undefined,
|
97
|
+
};
|
98
|
+
}
|
99
|
+
function setIncompleteSubtype(flowNode, index, type, isIncomplete, isPending, evaluationCount) {
|
100
|
+
const cachedEntry = flowNodeTypeCache.get(flowNode.id);
|
101
|
+
if (cachedEntry === undefined || !(0, typeCache_1.isIncompleteType)(cachedEntry)) {
|
102
|
+
(0, debug_1.fail)('setIncompleteSubtype can be called only on a valid incomplete cache entry');
|
103
|
+
}
|
104
|
+
const incompleteEntries = cachedEntry.incompleteSubtypes;
|
105
|
+
if (index < incompleteEntries.length) {
|
106
|
+
const oldEntry = incompleteEntries[index];
|
107
|
+
if (oldEntry.isIncomplete !== isIncomplete ||
|
108
|
+
oldEntry.type === undefined ||
|
109
|
+
type === undefined ||
|
110
|
+
!(0, types_1.isTypeSame)(oldEntry.type, type)) {
|
111
|
+
incompleteEntries[index] = { type, isIncomplete, isPending, evaluationCount };
|
112
|
+
flowIncompleteGeneration++;
|
113
|
+
}
|
114
|
+
else if (oldEntry.isPending !== isPending) {
|
115
|
+
incompleteEntries[index] = { type, isIncomplete, isPending, evaluationCount };
|
116
|
+
}
|
117
|
+
}
|
118
|
+
else {
|
119
|
+
(0, debug_1.assert)(incompleteEntries.length === index);
|
120
|
+
incompleteEntries.push({ type, isIncomplete, isPending, evaluationCount });
|
121
|
+
flowIncompleteGeneration++;
|
122
|
+
}
|
123
|
+
return getCacheEntry(flowNode);
|
124
|
+
}
|
125
|
+
function getCacheEntry(flowNode) {
|
126
|
+
if (!flowNodeTypeCache.has(flowNode.id)) {
|
127
|
+
return undefined;
|
128
|
+
}
|
129
|
+
const cachedEntry = flowNodeTypeCache.get(flowNode.id);
|
130
|
+
if (cachedEntry === undefined) {
|
131
|
+
return {
|
132
|
+
type: cachedEntry,
|
133
|
+
isIncomplete: false,
|
134
|
+
};
|
135
|
+
}
|
136
|
+
if (!(0, typeCache_1.isIncompleteType)(cachedEntry)) {
|
137
|
+
return {
|
138
|
+
type: cachedEntry,
|
139
|
+
isIncomplete: false,
|
140
|
+
};
|
141
|
+
}
|
142
|
+
let type = cachedEntry.type;
|
143
|
+
if (cachedEntry.incompleteSubtypes.length > 0) {
|
144
|
+
// Recompute the effective type based on all of the incomplete
|
145
|
+
// types we've accumulated so far.
|
146
|
+
const typesToCombine = [];
|
147
|
+
cachedEntry.incompleteSubtypes.forEach((t) => {
|
148
|
+
if (t.type) {
|
149
|
+
typesToCombine.push(t.type);
|
150
|
+
}
|
151
|
+
});
|
152
|
+
type = typesToCombine.length > 0 ? (0, types_1.combineTypes)(typesToCombine) : undefined;
|
153
|
+
}
|
154
|
+
return {
|
155
|
+
type,
|
156
|
+
isIncomplete: true,
|
157
|
+
incompleteSubtypes: cachedEntry.incompleteSubtypes,
|
158
|
+
generationCount: cachedEntry.generationCount,
|
159
|
+
isRecursionSentinel: cachedEntry.isRecursionSentinel,
|
160
|
+
};
|
161
|
+
}
|
162
|
+
function deleteCacheEntry(flowNode) {
|
163
|
+
flowNodeTypeCache.delete(flowNode.id);
|
164
|
+
}
|
165
|
+
function evaluateAssignmentFlowNode(flowNode) {
|
166
|
+
// For function and class nodes, the reference node is the name
|
167
|
+
// node, but we need to use the parent node (the FunctionNode or ClassNode)
|
168
|
+
// to access the decorated type in the type cache.
|
169
|
+
let nodeForCacheLookup = flowNode.node;
|
170
|
+
const parentNode = flowNode.node.parent;
|
171
|
+
if (parentNode) {
|
172
|
+
if (parentNode.nodeType === 28 /* Function */ || parentNode.nodeType === 10 /* Class */) {
|
173
|
+
nodeForCacheLookup = parentNode;
|
174
|
+
}
|
175
|
+
}
|
176
|
+
return evaluator.evaluateTypeForSubnode(nodeForCacheLookup, () => {
|
177
|
+
evaluator.evaluateTypesForStatement(flowNode.node);
|
178
|
+
});
|
179
|
+
}
|
180
|
+
// If this flow has no knowledge of the target expression, it returns undefined.
|
181
|
+
// If the start flow node for this scope is reachable, the typeAtStart value is
|
182
|
+
// returned.
|
183
|
+
function getTypeFromFlowNode(flowNode) {
|
184
|
+
let curFlowNode = flowNode;
|
185
|
+
// This is a frequently-called routine, so it's a good place to call
|
186
|
+
// the cancellation check. If the operation is canceled, an exception
|
187
|
+
// will be thrown at this point.
|
188
|
+
evaluator.checkForCancellation();
|
189
|
+
while (true) {
|
190
|
+
// Have we already been here? If so, use the cached value.
|
191
|
+
const cachedEntry = getCacheEntry(curFlowNode);
|
192
|
+
if (cachedEntry) {
|
193
|
+
if (!cachedEntry.isIncomplete) {
|
194
|
+
return cachedEntry;
|
195
|
+
}
|
196
|
+
// If the cached entry is incomplete, we can use it only if nothing
|
197
|
+
// has changed that may cause the previously-reported incomplete type to change.
|
198
|
+
if (cachedEntry.generationCount === flowIncompleteGeneration) {
|
199
|
+
return { type: cachedEntry.type, isIncomplete: true };
|
200
|
+
}
|
201
|
+
}
|
202
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.Unreachable) {
|
203
|
+
// We can get here if there are nodes in a compound logical expression
|
204
|
+
// (e.g. "False and x") that are never executed but are evaluated.
|
205
|
+
return setCacheEntry(curFlowNode, types_1.NeverType.createNever(), /* isIncomplete */ false);
|
206
|
+
}
|
207
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.VariableAnnotation) {
|
208
|
+
const varAnnotationNode = curFlowNode;
|
209
|
+
curFlowNode = varAnnotationNode.antecedent;
|
210
|
+
continue;
|
211
|
+
}
|
212
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.Call) {
|
213
|
+
const callFlowNode = curFlowNode;
|
214
|
+
// If this function returns a "NoReturn" type, that means
|
215
|
+
// it always raises an exception or otherwise doesn't return,
|
216
|
+
// so we can assume that the code before this is unreachable.
|
217
|
+
if (!ignoreNoReturn && isCallNoReturn(evaluator, callFlowNode)) {
|
218
|
+
return setCacheEntry(curFlowNode, /* type */ undefined, /* isIncomplete */ false);
|
219
|
+
}
|
220
|
+
curFlowNode = callFlowNode.antecedent;
|
221
|
+
continue;
|
222
|
+
}
|
223
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.Assignment) {
|
224
|
+
const assignmentFlowNode = curFlowNode;
|
225
|
+
// Are we targeting the same symbol? We need to do this extra check because the same
|
226
|
+
// symbol name might refer to different symbols in different scopes (e.g. a list
|
227
|
+
// comprehension introduces a new scope).
|
228
|
+
if (reference) {
|
229
|
+
if (targetSymbolId === assignmentFlowNode.targetSymbolId &&
|
230
|
+
(0, parseTreeUtils_1.isMatchingExpression)(reference, assignmentFlowNode.node)) {
|
231
|
+
// Is this a special "unbind" assignment? If so,
|
232
|
+
// we can handle it immediately without any further evaluation.
|
233
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.Unbind) {
|
234
|
+
return setCacheEntry(curFlowNode, types_1.UnboundType.create(), /* isIncomplete */ false);
|
235
|
+
}
|
236
|
+
// If there was a cache entry already, that means we hit a recursive
|
237
|
+
// case (something like "int: int = 4"). Avoid infinite recursion
|
238
|
+
// by returning an undefined type.
|
239
|
+
if (cachedEntry === null || cachedEntry === void 0 ? void 0 : cachedEntry.isRecursionSentinel) {
|
240
|
+
return { type: undefined, isIncomplete: true };
|
241
|
+
}
|
242
|
+
// Set the cache entry to undefined before evaluating the
|
243
|
+
// expression in case it depends on itself.
|
244
|
+
setCacheEntry(curFlowNode, reference ? undefined : initialType,
|
245
|
+
/* isIncomplete */ true,
|
246
|
+
/* isRecursionSentinel */ true);
|
247
|
+
let flowTypeResult = evaluateAssignmentFlowNode(assignmentFlowNode);
|
248
|
+
if (flowTypeResult) {
|
249
|
+
if ((0, typeUtils_1.isTypeAliasPlaceholder)(flowTypeResult.type)) {
|
250
|
+
flowTypeResult = undefined;
|
251
|
+
}
|
252
|
+
else if (reference.nodeType === 35 /* MemberAccess */ &&
|
253
|
+
evaluator.isAsymmetricDescriptorAssignment(assignmentFlowNode.node)) {
|
254
|
+
flowTypeResult = undefined;
|
255
|
+
}
|
256
|
+
}
|
257
|
+
return setCacheEntry(curFlowNode, flowTypeResult === null || flowTypeResult === void 0 ? void 0 : flowTypeResult.type, !!(flowTypeResult === null || flowTypeResult === void 0 ? void 0 : flowTypeResult.isIncomplete));
|
258
|
+
}
|
259
|
+
else if ((0, parseTreeUtils_1.isPartialMatchingExpression)(reference, assignmentFlowNode.node)) {
|
260
|
+
// If the node partially matches the reference, we need to "kill" any narrowed
|
261
|
+
// types further above this point. For example, if we see the sequence
|
262
|
+
// a.b = 3
|
263
|
+
// a = Foo()
|
264
|
+
// x = a.b
|
265
|
+
// The type of "a.b" can no longer be assumed to be Literal[3].
|
266
|
+
return {
|
267
|
+
type: initialType,
|
268
|
+
isIncomplete: isInitialTypeIncomplete,
|
269
|
+
};
|
270
|
+
}
|
271
|
+
}
|
272
|
+
curFlowNode = assignmentFlowNode.antecedent;
|
273
|
+
continue;
|
274
|
+
}
|
275
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.BranchLabel) {
|
276
|
+
const branchFlowNode = curFlowNode;
|
277
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.PostContextManager) {
|
278
|
+
// Determine whether any of the context managers support exception
|
279
|
+
// suppression. If not, none of its antecedents are reachable.
|
280
|
+
const contextMgrNode = curFlowNode;
|
281
|
+
const contextManagerSwallowsExceptions = contextMgrNode.expressions.some((expr) => isExceptionContextManager(evaluator, expr, contextMgrNode.isAsync));
|
282
|
+
if (contextManagerSwallowsExceptions === contextMgrNode.blockIfSwallowsExceptions) {
|
283
|
+
// Do not explore any further along this code flow path.
|
284
|
+
return setCacheEntry(curFlowNode, /* type */ undefined, /* isIncomplete */ false);
|
285
|
+
}
|
286
|
+
}
|
287
|
+
// Is the current symbol modified in any way within the scope of the branch?
|
288
|
+
// If not, we can skip all processing within the branch scope.
|
289
|
+
if (reference && branchFlowNode.preBranchAntecedent && branchFlowNode.affectedExpressions) {
|
290
|
+
if (!subexpressionReferenceKeys) {
|
291
|
+
subexpressionReferenceKeys = (0, codeFlowTypes_1.createKeysForReferenceSubexpressions)(reference);
|
292
|
+
}
|
293
|
+
if (!subexpressionReferenceKeys.some((key) => branchFlowNode.affectedExpressions.has(key)) &&
|
294
|
+
isFlowNodeReachable(curFlowNode, branchFlowNode.preBranchAntecedent)) {
|
295
|
+
curFlowNode = branchFlowNode.preBranchAntecedent;
|
296
|
+
continue;
|
297
|
+
}
|
298
|
+
}
|
299
|
+
return getTypeFromBranchFlowNode(curFlowNode);
|
300
|
+
}
|
301
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.LoopLabel) {
|
302
|
+
const loopNode = curFlowNode;
|
303
|
+
// Is the current symbol modified in any way within the loop? If not, we can skip all
|
304
|
+
// processing within the loop and assume that the type comes from the first antecedent,
|
305
|
+
// which feeds the loop.
|
306
|
+
if (reference) {
|
307
|
+
if (!subexpressionReferenceKeys) {
|
308
|
+
subexpressionReferenceKeys = (0, codeFlowTypes_1.createKeysForReferenceSubexpressions)(reference);
|
309
|
+
}
|
310
|
+
if (!subexpressionReferenceKeys.some((key) => loopNode.affectedExpressions.has(key))) {
|
311
|
+
curFlowNode = loopNode.antecedents[0];
|
312
|
+
continue;
|
313
|
+
}
|
314
|
+
}
|
315
|
+
return getTypeFromLoopFlowNode(loopNode);
|
316
|
+
}
|
317
|
+
if (curFlowNode.flags & (codeFlowTypes_1.FlowFlags.TrueCondition | codeFlowTypes_1.FlowFlags.FalseCondition)) {
|
318
|
+
const conditionalFlowNode = curFlowNode;
|
319
|
+
if (reference) {
|
320
|
+
// Was an incomplete entry added to prevent recursion?
|
321
|
+
if (cachedEntry === null || cachedEntry === void 0 ? void 0 : cachedEntry.isRecursionSentinel) {
|
322
|
+
return cachedEntry;
|
323
|
+
}
|
324
|
+
// Before calling getTypeNarrowingCallback, set the type
|
325
|
+
// of this flow node in the cache to prevent recursion.
|
326
|
+
setCacheEntry(curFlowNode,
|
327
|
+
/* type */ undefined,
|
328
|
+
/* isIncomplete */ true,
|
329
|
+
/* isRecursionSentinel */ true);
|
330
|
+
try {
|
331
|
+
const typeNarrowingCallback = (0, typeGuards_1.getTypeNarrowingCallback)(evaluator, reference, conditionalFlowNode.expression, !!(conditionalFlowNode.flags &
|
332
|
+
(codeFlowTypes_1.FlowFlags.TrueCondition | codeFlowTypes_1.FlowFlags.TrueNeverCondition)));
|
333
|
+
if (typeNarrowingCallback) {
|
334
|
+
const flowTypeResult = getTypeFromFlowNode(conditionalFlowNode.antecedent);
|
335
|
+
let flowType = flowTypeResult.type;
|
336
|
+
if (flowType) {
|
337
|
+
flowType = typeNarrowingCallback(flowType);
|
338
|
+
}
|
339
|
+
return setCacheEntry(curFlowNode, flowType, flowTypeResult.isIncomplete);
|
340
|
+
}
|
341
|
+
deleteCacheEntry(curFlowNode);
|
342
|
+
}
|
343
|
+
catch (e) {
|
344
|
+
// We don't use finally here because the debugger
|
345
|
+
// doesn't handle it well during single stepping.
|
346
|
+
deleteCacheEntry(curFlowNode);
|
347
|
+
throw e;
|
348
|
+
}
|
349
|
+
}
|
350
|
+
curFlowNode = conditionalFlowNode.antecedent;
|
351
|
+
continue;
|
352
|
+
}
|
353
|
+
if (curFlowNode.flags & (codeFlowTypes_1.FlowFlags.TrueNeverCondition | codeFlowTypes_1.FlowFlags.FalseNeverCondition)) {
|
354
|
+
const conditionalFlowNode = curFlowNode;
|
355
|
+
if (conditionalFlowNode.reference) {
|
356
|
+
// Don't allow apply if the conditional expression references the expression
|
357
|
+
// we're already narrowing. This case will be handled by the TrueCondition
|
358
|
+
// or FalseCondition node.
|
359
|
+
if ((0, codeFlowTypes_1.createKeyForReference)(conditionalFlowNode.reference) !== referenceKey) {
|
360
|
+
// Make sure the reference type has a declared type. If not,
|
361
|
+
// don't bother trying to infer its type because that would be
|
362
|
+
// too expensive.
|
363
|
+
const symbolWithScope = evaluator.lookUpSymbolRecursive(conditionalFlowNode.reference, conditionalFlowNode.reference.value,
|
364
|
+
/* honorCodeFlow */ false);
|
365
|
+
if (symbolWithScope && symbolWithScope.symbol.getTypedDeclarations().length > 0) {
|
366
|
+
// Before calling getTypeNarrowingCallback, set the type
|
367
|
+
// of this flow node in the cache to prevent recursion.
|
368
|
+
setCacheEntry(curFlowNode, reference ? undefined : initialType,
|
369
|
+
/* isIncomplete */ true,
|
370
|
+
/* isRecursionSentinel */ true);
|
371
|
+
try {
|
372
|
+
const typeNarrowingCallback = (0, typeGuards_1.getTypeNarrowingCallback)(evaluator, conditionalFlowNode.reference, conditionalFlowNode.expression, !!(conditionalFlowNode.flags &
|
373
|
+
(codeFlowTypes_1.FlowFlags.TrueCondition | codeFlowTypes_1.FlowFlags.TrueNeverCondition)));
|
374
|
+
if (typeNarrowingCallback) {
|
375
|
+
const refTypeInfo = evaluator.getTypeOfExpression(conditionalFlowNode.reference);
|
376
|
+
const narrowedType = typeNarrowingCallback(refTypeInfo.type) || refTypeInfo.type;
|
377
|
+
// If the narrowed type is "never", don't allow further exploration.
|
378
|
+
if ((0, types_1.isNever)(narrowedType)) {
|
379
|
+
return setCacheEntry(curFlowNode, undefined, !!refTypeInfo.isIncomplete);
|
380
|
+
}
|
381
|
+
}
|
382
|
+
deleteCacheEntry(curFlowNode);
|
383
|
+
}
|
384
|
+
catch (e) {
|
385
|
+
// We don't use finally here because the debugger
|
386
|
+
// doesn't handle it well during single stepping.
|
387
|
+
deleteCacheEntry(curFlowNode);
|
388
|
+
throw e;
|
389
|
+
}
|
390
|
+
}
|
391
|
+
}
|
392
|
+
}
|
393
|
+
curFlowNode = conditionalFlowNode.antecedent;
|
394
|
+
continue;
|
395
|
+
}
|
396
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.ExhaustedMatch) {
|
397
|
+
const exhaustedMatchFlowNode = curFlowNode;
|
398
|
+
const narrowedTypeResult = evaluator.evaluateTypeForSubnode(exhaustedMatchFlowNode.node, () => {
|
399
|
+
evaluator.evaluateTypesForMatchStatement(exhaustedMatchFlowNode.node);
|
400
|
+
});
|
401
|
+
// If the narrowed type is "never", don't allow further exploration.
|
402
|
+
if (narrowedTypeResult && (0, types_1.isNever)(narrowedTypeResult.type)) {
|
403
|
+
return setCacheEntry(curFlowNode, /* type */ undefined, !!narrowedTypeResult.isIncomplete);
|
404
|
+
}
|
405
|
+
curFlowNode = exhaustedMatchFlowNode.antecedent;
|
406
|
+
continue;
|
407
|
+
}
|
408
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.NarrowForPattern) {
|
409
|
+
const patternFlowNode = curFlowNode;
|
410
|
+
if (!reference || (0, parseTreeUtils_1.isMatchingExpression)(reference, patternFlowNode.subjectExpression)) {
|
411
|
+
const typeResult = evaluator.evaluateTypeForSubnode(patternFlowNode.statement, () => {
|
412
|
+
if (patternFlowNode.statement.nodeType === 64 /* Case */) {
|
413
|
+
evaluator.evaluateTypesForCaseStatement(patternFlowNode.statement);
|
414
|
+
}
|
415
|
+
else {
|
416
|
+
evaluator.evaluateTypesForMatchStatement(patternFlowNode.statement);
|
417
|
+
}
|
418
|
+
});
|
419
|
+
if (typeResult) {
|
420
|
+
if (!reference) {
|
421
|
+
if ((0, types_1.isNever)(typeResult.type)) {
|
422
|
+
return setCacheEntry(curFlowNode,
|
423
|
+
/* type */ undefined, !!typeResult.isIncomplete);
|
424
|
+
}
|
425
|
+
}
|
426
|
+
else {
|
427
|
+
return setCacheEntry(curFlowNode, typeResult.type, !!typeResult.isIncomplete);
|
428
|
+
}
|
429
|
+
}
|
430
|
+
}
|
431
|
+
curFlowNode = patternFlowNode.antecedent;
|
432
|
+
continue;
|
433
|
+
}
|
434
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.PreFinallyGate) {
|
435
|
+
return getTypeFromPreFinallyGateFlowNode(curFlowNode);
|
436
|
+
}
|
437
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.PostFinally) {
|
438
|
+
return getTypeFromPostFinallyFlowNode(curFlowNode);
|
439
|
+
}
|
440
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.Start) {
|
441
|
+
return setCacheEntry(curFlowNode, initialType, isInitialTypeIncomplete);
|
442
|
+
}
|
443
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.WildcardImport) {
|
444
|
+
const wildcardImportFlowNode = curFlowNode;
|
445
|
+
if (reference && reference.nodeType === 38 /* Name */) {
|
446
|
+
const nameValue = reference.value;
|
447
|
+
if (wildcardImportFlowNode.names.some((name) => name === nameValue)) {
|
448
|
+
// Before calling getTypeFromWildcardImport, set the cache entry to prevent infinite recursion.
|
449
|
+
setCacheEntry(curFlowNode,
|
450
|
+
/* type */ undefined,
|
451
|
+
/* isIncomplete */ true,
|
452
|
+
/* isRecursionSentinel */ true);
|
453
|
+
try {
|
454
|
+
const type = getTypeFromWildcardImport(wildcardImportFlowNode, nameValue);
|
455
|
+
return setCacheEntry(curFlowNode, type, /* isIncomplete */ false);
|
456
|
+
}
|
457
|
+
catch (e) {
|
458
|
+
deleteCacheEntry(curFlowNode);
|
459
|
+
throw e;
|
460
|
+
}
|
461
|
+
}
|
462
|
+
}
|
463
|
+
curFlowNode = wildcardImportFlowNode.antecedent;
|
464
|
+
continue;
|
465
|
+
}
|
466
|
+
// We shouldn't get here.
|
467
|
+
(0, debug_1.fail)('Unexpected flow node flags');
|
468
|
+
return setCacheEntry(curFlowNode, /* type */ undefined, /* isIncomplete */ false);
|
469
|
+
}
|
470
|
+
}
|
471
|
+
function getTypeFromBranchFlowNode(branchNode) {
|
472
|
+
const typesToCombine = [];
|
473
|
+
let sawIncomplete = false;
|
474
|
+
let isProvenReachable = false;
|
475
|
+
// Set the cache entry to undefined before evaluating the
|
476
|
+
// expression in case it depends on itself.
|
477
|
+
setCacheEntry(branchNode, reference ? undefined : initialType,
|
478
|
+
/* isIncomplete */ true,
|
479
|
+
/* isRecursionSentinel */ true);
|
480
|
+
branchNode.antecedents.forEach((antecedent) => {
|
481
|
+
// If we're solving for "reachability", and we have now proven
|
482
|
+
// reachability, there's no reason to do more work.
|
483
|
+
if (reference === undefined && isProvenReachable) {
|
484
|
+
return;
|
485
|
+
}
|
486
|
+
const flowTypeResult = getTypeFromFlowNode(antecedent);
|
487
|
+
if (flowTypeResult.isIncomplete) {
|
488
|
+
sawIncomplete = true;
|
489
|
+
}
|
490
|
+
if (reference === undefined && flowTypeResult.type !== undefined) {
|
491
|
+
isProvenReachable = true;
|
492
|
+
}
|
493
|
+
if (flowTypeResult.type) {
|
494
|
+
typesToCombine.push(flowTypeResult.type);
|
495
|
+
}
|
496
|
+
});
|
497
|
+
if (isProvenReachable) {
|
498
|
+
return setCacheEntry(branchNode, initialType, /* isIncomplete */ false);
|
499
|
+
}
|
500
|
+
const effectiveType = typesToCombine.length > 0 ? (0, types_1.combineTypes)(typesToCombine) : undefined;
|
501
|
+
return setCacheEntry(branchNode, effectiveType, sawIncomplete);
|
502
|
+
}
|
503
|
+
function getTypeFromLoopFlowNode(loopNode) {
|
504
|
+
var _a, _b;
|
505
|
+
// See if we've been here before. If so, there will be an incomplete cache entry.
|
506
|
+
let cacheEntry = getCacheEntry(loopNode);
|
507
|
+
// The type result from one antecedent may depend on the type
|
508
|
+
// result from another, so loop up to one time for each
|
509
|
+
// antecedent in the loop.
|
510
|
+
const maxAttemptCount = loopNode.antecedents.length;
|
511
|
+
if (cacheEntry === undefined) {
|
512
|
+
// We haven't been here before, so create a new incomplete cache entry.
|
513
|
+
cacheEntry = setCacheEntry(loopNode, reference ? undefined : initialType,
|
514
|
+
/* isIncomplete */ true,
|
515
|
+
/* isRecursionSentinel */ true);
|
516
|
+
}
|
517
|
+
else if ((_a = cacheEntry.incompleteSubtypes) === null || _a === void 0 ? void 0 : _a.some((subtype) => subtype.isPending)) {
|
518
|
+
// If there are pending entries that have not been evaluated even once,
|
519
|
+
// treat it as incomplete.
|
520
|
+
const isIncomplete = cacheEntry.incompleteSubtypes.length < loopNode.antecedents.length ||
|
521
|
+
cacheEntry.incompleteSubtypes.some((subtype) => subtype.isPending && subtype.evaluationCount < maxAttemptCount);
|
522
|
+
return { type: cacheEntry.type, isIncomplete };
|
523
|
+
}
|
524
|
+
let attemptCount = 0;
|
525
|
+
while (true) {
|
526
|
+
let sawIncomplete = false;
|
527
|
+
let isProvenReachable = reference === undefined &&
|
528
|
+
((_b = cacheEntry.incompleteSubtypes) === null || _b === void 0 ? void 0 : _b.some((subtype) => subtype.type !== undefined));
|
529
|
+
loopNode.antecedents.forEach((antecedent, index) => {
|
530
|
+
var _a;
|
531
|
+
// If we've trying to determine reachability and we've already proven
|
532
|
+
// reachability, then we're done.
|
533
|
+
if (reference === undefined && isProvenReachable) {
|
534
|
+
return;
|
535
|
+
}
|
536
|
+
cacheEntry = getCacheEntry(loopNode);
|
537
|
+
// Have we already been here (i.e. does the entry exist and is
|
538
|
+
// not marked "pending")? If so, we can use the type that was already
|
539
|
+
// computed if it is complete.
|
540
|
+
const subtypeEntry = cacheEntry.incompleteSubtypes !== undefined && index < cacheEntry.incompleteSubtypes.length
|
541
|
+
? cacheEntry.incompleteSubtypes[index]
|
542
|
+
: undefined;
|
543
|
+
if (subtypeEntry === undefined || (!(subtypeEntry === null || subtypeEntry === void 0 ? void 0 : subtypeEntry.isPending) && (subtypeEntry === null || subtypeEntry === void 0 ? void 0 : subtypeEntry.isIncomplete))) {
|
544
|
+
const entryEvaluationCount = subtypeEntry === undefined ? 0 : subtypeEntry.evaluationCount;
|
545
|
+
// Set this entry to "pending" to prevent infinite recursion.
|
546
|
+
// We'll mark it "not pending" below.
|
547
|
+
cacheEntry = setIncompleteSubtype(loopNode, index, (_a = subtypeEntry === null || subtypeEntry === void 0 ? void 0 : subtypeEntry.type) !== null && _a !== void 0 ? _a : (reference ? undefined : initialType),
|
548
|
+
/* isIncomplete */ true,
|
549
|
+
/* isPending */ true, entryEvaluationCount);
|
550
|
+
try {
|
551
|
+
const flowTypeResult = getTypeFromFlowNode(antecedent);
|
552
|
+
if (flowTypeResult.isIncomplete) {
|
553
|
+
sawIncomplete = true;
|
554
|
+
}
|
555
|
+
cacheEntry = setIncompleteSubtype(loopNode, index, flowTypeResult.type, flowTypeResult.isIncomplete,
|
556
|
+
/* isPending */ false, entryEvaluationCount + 1);
|
557
|
+
}
|
558
|
+
catch (e) {
|
559
|
+
setIncompleteSubtype(loopNode, index, undefined,
|
560
|
+
/* isIncomplete */ true,
|
561
|
+
/* isPending */ false, entryEvaluationCount + 1);
|
562
|
+
throw e;
|
563
|
+
}
|
564
|
+
}
|
565
|
+
if (reference === undefined && (cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.type) !== undefined) {
|
566
|
+
isProvenReachable = true;
|
567
|
+
}
|
568
|
+
});
|
569
|
+
if (isProvenReachable) {
|
570
|
+
return setCacheEntry(loopNode, initialType, /* isIncomplete */ false);
|
571
|
+
}
|
572
|
+
let effectiveType = cacheEntry.type;
|
573
|
+
if (sawIncomplete) {
|
574
|
+
// If there is an incomplete "Unknown" type within a union type, remove
|
575
|
+
// it. Otherwise we might end up resolving the cycle with a type
|
576
|
+
// that includes an undesirable unknown.
|
577
|
+
if (effectiveType) {
|
578
|
+
const typeWithoutUnknown = (0, types_1.removeIncompleteUnknownFromUnion)(effectiveType);
|
579
|
+
if (!(0, types_1.isNever)(typeWithoutUnknown)) {
|
580
|
+
effectiveType = typeWithoutUnknown;
|
581
|
+
}
|
582
|
+
}
|
583
|
+
}
|
584
|
+
if (!sawIncomplete || attemptCount >= maxAttemptCount) {
|
585
|
+
return setCacheEntry(loopNode, effectiveType, /* isIncomplete */ false);
|
586
|
+
}
|
587
|
+
attemptCount++;
|
588
|
+
}
|
589
|
+
}
|
590
|
+
function getTypeFromPreFinallyGateFlowNode(preFinallyFlowNode) {
|
591
|
+
if (preFinallyFlowNode.isGateClosed) {
|
592
|
+
return { type: undefined, isIncomplete: false };
|
593
|
+
}
|
594
|
+
// Before recursively calling, set the cache entry to prevent infinite recursion.
|
595
|
+
setCacheEntry(preFinallyFlowNode, reference ? undefined : initialType,
|
596
|
+
/* isIncomplete */ true,
|
597
|
+
/* isRecursionSentinel */ true);
|
598
|
+
try {
|
599
|
+
const flowTypeResult = getTypeFromFlowNode(preFinallyFlowNode.antecedent);
|
600
|
+
// We want to cache the type only if we're evaluating the "gate closed" path.
|
601
|
+
deleteCacheEntry(preFinallyFlowNode);
|
602
|
+
return {
|
603
|
+
type: flowTypeResult.type,
|
604
|
+
isIncomplete: flowTypeResult.isIncomplete,
|
605
|
+
};
|
606
|
+
}
|
607
|
+
catch (e) {
|
608
|
+
deleteCacheEntry(preFinallyFlowNode);
|
609
|
+
throw e;
|
610
|
+
}
|
611
|
+
}
|
612
|
+
function getTypeFromPostFinallyFlowNode(postFinallyFlowNode) {
|
613
|
+
const wasGateClosed = postFinallyFlowNode.preFinallyGate.isGateClosed;
|
614
|
+
try {
|
615
|
+
postFinallyFlowNode.preFinallyGate.isGateClosed = true;
|
616
|
+
let flowTypeResult;
|
617
|
+
// Use speculative mode for the remainder of the finally suite
|
618
|
+
// because the final types within this parse node block should be
|
619
|
+
// evaluated when the gate is open.
|
620
|
+
evaluator.useSpeculativeMode(postFinallyFlowNode.finallyNode, () => {
|
621
|
+
flowTypeResult = getTypeFromFlowNode(postFinallyFlowNode.antecedent);
|
622
|
+
});
|
623
|
+
// If the type is incomplete, don't write back to the cache.
|
624
|
+
return flowTypeResult.isIncomplete
|
625
|
+
? flowTypeResult
|
626
|
+
: setCacheEntry(postFinallyFlowNode, flowTypeResult.type, /* isIncomplete */ false);
|
627
|
+
}
|
628
|
+
finally {
|
629
|
+
postFinallyFlowNode.preFinallyGate.isGateClosed = wasGateClosed;
|
630
|
+
}
|
631
|
+
}
|
632
|
+
if (!flowNode) {
|
633
|
+
// This should happen only in cases where we're evaluating
|
634
|
+
// parse nodes that are created after the initial parse
|
635
|
+
// (namely, string literals that are used for forward
|
636
|
+
// referenced types).
|
637
|
+
return {
|
638
|
+
type: initialType,
|
639
|
+
isIncomplete: isInitialTypeIncomplete,
|
640
|
+
};
|
641
|
+
}
|
642
|
+
return getTypeFromFlowNode(flowNode);
|
643
|
+
}
|
644
|
+
return {
|
645
|
+
getTypeFromCodeFlow,
|
646
|
+
};
|
647
|
+
}
|
648
|
+
// Determines whether the specified flowNode can be reached by any
|
649
|
+
// control flow path within the execution context. If sourceFlowNode
|
650
|
+
// is specified, it returns true only if at least one control flow
|
651
|
+
// path passes through sourceFlowNode.
|
652
|
+
function isFlowNodeReachable(flowNode, sourceFlowNode, ignoreNoReturn = false) {
|
653
|
+
const visitedFlowNodeMap = new Set();
|
654
|
+
if (isPrintControlFlowGraphEnabled) {
|
655
|
+
printControlFlowGraph(flowNode, /* reference */ undefined, 'isFlowNodeReachable');
|
656
|
+
}
|
657
|
+
function isFlowNodeReachableRecursive(flowNode, sourceFlowNode, recursionCount = 0) {
|
658
|
+
// Cut off the recursion at some point to prevent a stack overflow.
|
659
|
+
const maxFlowNodeReachableRecursionCount = 64;
|
660
|
+
if (recursionCount > maxFlowNodeReachableRecursionCount) {
|
661
|
+
return true;
|
662
|
+
}
|
663
|
+
recursionCount++;
|
664
|
+
let curFlowNode = flowNode;
|
665
|
+
while (true) {
|
666
|
+
// If we've already visited this node, we can assume
|
667
|
+
// it wasn't reachable.
|
668
|
+
if (visitedFlowNodeMap.has(curFlowNode.id)) {
|
669
|
+
return false;
|
670
|
+
}
|
671
|
+
// Note that we've been here before.
|
672
|
+
visitedFlowNodeMap.add(curFlowNode.id);
|
673
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.Unreachable) {
|
674
|
+
return false;
|
675
|
+
}
|
676
|
+
if (curFlowNode === sourceFlowNode) {
|
677
|
+
return true;
|
678
|
+
}
|
679
|
+
if (curFlowNode.flags &
|
680
|
+
(codeFlowTypes_1.FlowFlags.VariableAnnotation |
|
681
|
+
codeFlowTypes_1.FlowFlags.Assignment |
|
682
|
+
codeFlowTypes_1.FlowFlags.TrueCondition |
|
683
|
+
codeFlowTypes_1.FlowFlags.FalseCondition |
|
684
|
+
codeFlowTypes_1.FlowFlags.WildcardImport |
|
685
|
+
codeFlowTypes_1.FlowFlags.TrueNeverCondition |
|
686
|
+
codeFlowTypes_1.FlowFlags.FalseNeverCondition |
|
687
|
+
codeFlowTypes_1.FlowFlags.NarrowForPattern |
|
688
|
+
codeFlowTypes_1.FlowFlags.ExhaustedMatch)) {
|
689
|
+
const typedFlowNode = curFlowNode;
|
690
|
+
curFlowNode = typedFlowNode.antecedent;
|
691
|
+
continue;
|
692
|
+
}
|
693
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.Call) {
|
694
|
+
const callFlowNode = curFlowNode;
|
695
|
+
// If this function returns a "NoReturn" type, that means
|
696
|
+
// it always raises an exception or otherwise doesn't return,
|
697
|
+
// so we can assume that the code before this is unreachable.
|
698
|
+
if (!ignoreNoReturn && isCallNoReturn(evaluator, callFlowNode)) {
|
699
|
+
return false;
|
700
|
+
}
|
701
|
+
curFlowNode = callFlowNode.antecedent;
|
702
|
+
continue;
|
703
|
+
}
|
704
|
+
if (curFlowNode.flags & (codeFlowTypes_1.FlowFlags.BranchLabel | codeFlowTypes_1.FlowFlags.LoopLabel)) {
|
705
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.PostContextManager) {
|
706
|
+
// Determine whether any of the context managers support exception
|
707
|
+
// suppression. If not, none of its antecedents are reachable.
|
708
|
+
const contextMgrNode = curFlowNode;
|
709
|
+
if (!contextMgrNode.expressions.some((expr) => isExceptionContextManager(evaluator, expr, contextMgrNode.isAsync))) {
|
710
|
+
return false;
|
711
|
+
}
|
712
|
+
}
|
713
|
+
const labelNode = curFlowNode;
|
714
|
+
for (const antecedent of labelNode.antecedents) {
|
715
|
+
if (isFlowNodeReachableRecursive(antecedent, sourceFlowNode, recursionCount)) {
|
716
|
+
return true;
|
717
|
+
}
|
718
|
+
}
|
719
|
+
return false;
|
720
|
+
}
|
721
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.Start) {
|
722
|
+
// If we hit the start but were looking for a particular source flow
|
723
|
+
// node, return false. Otherwise, the start is what we're looking for.
|
724
|
+
return sourceFlowNode ? false : true;
|
725
|
+
}
|
726
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.PreFinallyGate) {
|
727
|
+
const preFinallyFlowNode = curFlowNode;
|
728
|
+
if (preFinallyFlowNode.isGateClosed) {
|
729
|
+
return false;
|
730
|
+
}
|
731
|
+
curFlowNode = preFinallyFlowNode.antecedent;
|
732
|
+
continue;
|
733
|
+
}
|
734
|
+
if (curFlowNode.flags & codeFlowTypes_1.FlowFlags.PostFinally) {
|
735
|
+
const postFinallyFlowNode = curFlowNode;
|
736
|
+
const wasGateClosed = postFinallyFlowNode.preFinallyGate.isGateClosed;
|
737
|
+
try {
|
738
|
+
postFinallyFlowNode.preFinallyGate.isGateClosed = true;
|
739
|
+
return isFlowNodeReachableRecursive(postFinallyFlowNode.antecedent, sourceFlowNode, recursionCount);
|
740
|
+
}
|
741
|
+
finally {
|
742
|
+
postFinallyFlowNode.preFinallyGate.isGateClosed = wasGateClosed;
|
743
|
+
}
|
744
|
+
}
|
745
|
+
// We shouldn't get here.
|
746
|
+
(0, debug_1.fail)('Unexpected flow node flags');
|
747
|
+
return false;
|
748
|
+
}
|
749
|
+
}
|
750
|
+
// Protect against infinite recursion.
|
751
|
+
if (isReachableRecursionMap.has(flowNode.id)) {
|
752
|
+
return true;
|
753
|
+
}
|
754
|
+
isReachableRecursionMap.set(flowNode.id, true);
|
755
|
+
try {
|
756
|
+
return isFlowNodeReachableRecursive(flowNode, sourceFlowNode);
|
757
|
+
}
|
758
|
+
finally {
|
759
|
+
isReachableRecursionMap.delete(flowNode.id);
|
760
|
+
}
|
761
|
+
}
|
762
|
+
// Determines whether the specified typeVar, which is assumed to be constrained,
|
763
|
+
// can be narrowed to one of its constrained types based on isinstance type
|
764
|
+
// guard checks.
|
765
|
+
function narrowConstrainedTypeVar(flowNode, typeVar) {
|
766
|
+
(0, debug_1.assert)(!typeVar.details.isParamSpec);
|
767
|
+
(0, debug_1.assert)(!typeVar.details.isVariadic);
|
768
|
+
(0, debug_1.assert)(!typeVar.details.boundType);
|
769
|
+
(0, debug_1.assert)(typeVar.details.constraints.length > 0);
|
770
|
+
const visitedFlowNodeMap = new Set();
|
771
|
+
const startingConstraints = [];
|
772
|
+
for (const constraint of typeVar.details.constraints) {
|
773
|
+
if ((0, types_1.isClassInstance)(constraint)) {
|
774
|
+
startingConstraints.push(constraint);
|
775
|
+
}
|
776
|
+
else {
|
777
|
+
// If one or more constraints are Unknown, Any, union types, etc.,
|
778
|
+
// we can't narrow them.
|
779
|
+
return undefined;
|
780
|
+
}
|
781
|
+
}
|
782
|
+
function narrowConstrainedTypeVarRecursive(flowNode, typeVar) {
|
783
|
+
let curFlowNode = flowNode;
|
784
|
+
while (true) {
|
785
|
+
if (visitedFlowNodeMap.has(curFlowNode.id)) {
|
786
|
+
return startingConstraints;
|
787
|
+
}
|
788
|
+
if (curFlowNode.flags & (codeFlowTypes_1.FlowFlags.Unreachable | codeFlowTypes_1.FlowFlags.Start)) {
|
789
|
+
return startingConstraints;
|
790
|
+
}
|
791
|
+
if (curFlowNode.flags &
|
792
|
+
(codeFlowTypes_1.FlowFlags.VariableAnnotation |
|
793
|
+
codeFlowTypes_1.FlowFlags.Assignment |
|
794
|
+
codeFlowTypes_1.FlowFlags.WildcardImport |
|
795
|
+
codeFlowTypes_1.FlowFlags.TrueNeverCondition |
|
796
|
+
codeFlowTypes_1.FlowFlags.FalseNeverCondition |
|
797
|
+
codeFlowTypes_1.FlowFlags.NarrowForPattern |
|
798
|
+
codeFlowTypes_1.FlowFlags.ExhaustedMatch |
|
799
|
+
codeFlowTypes_1.FlowFlags.PostFinally |
|
800
|
+
codeFlowTypes_1.FlowFlags.PreFinallyGate |
|
801
|
+
codeFlowTypes_1.FlowFlags.Call)) {
|
802
|
+
const typedFlowNode = curFlowNode;
|
803
|
+
curFlowNode = typedFlowNode.antecedent;
|
804
|
+
continue;
|
805
|
+
}
|
806
|
+
if (curFlowNode.flags & (codeFlowTypes_1.FlowFlags.TrueCondition | codeFlowTypes_1.FlowFlags.FalseCondition)) {
|
807
|
+
const conditionFlowNode = curFlowNode;
|
808
|
+
const testExpression = conditionFlowNode.expression;
|
809
|
+
const isPositiveTest = (curFlowNode.flags & codeFlowTypes_1.FlowFlags.TrueCondition) !== 0;
|
810
|
+
if (testExpression.nodeType === 9 /* Call */ &&
|
811
|
+
testExpression.leftExpression.nodeType === 38 /* Name */ &&
|
812
|
+
testExpression.leftExpression.value === 'isinstance' &&
|
813
|
+
testExpression.arguments.length === 2) {
|
814
|
+
const arg0Expr = testExpression.arguments[0].valueExpression;
|
815
|
+
const arg0Type = evaluator.getTypeOfExpression(arg0Expr).type;
|
816
|
+
if (isCompatibleWithConstrainedTypeVar(arg0Type, typeVar)) {
|
817
|
+
// Prevent infinite recursion by noting that we've been here before.
|
818
|
+
visitedFlowNodeMap.add(curFlowNode.id);
|
819
|
+
const priorRemainingConstraints = narrowConstrainedTypeVarRecursive(conditionFlowNode.antecedent, typeVar);
|
820
|
+
visitedFlowNodeMap.delete(curFlowNode.id);
|
821
|
+
const arg1Expr = testExpression.arguments[1].valueExpression;
|
822
|
+
const arg1Type = evaluator.getTypeOfExpression(arg1Expr, 8 /* EvaluateStringLiteralAsType */ |
|
823
|
+
32 /* ParamSpecDisallowed */ |
|
824
|
+
128 /* TypeVarTupleDisallowed */).type;
|
825
|
+
if ((0, types_1.isInstantiableClass)(arg1Type)) {
|
826
|
+
return priorRemainingConstraints.filter((subtype) => {
|
827
|
+
if (types_1.ClassType.isSameGenericClass(subtype, arg1Type)) {
|
828
|
+
return isPositiveTest;
|
829
|
+
}
|
830
|
+
else {
|
831
|
+
return !isPositiveTest;
|
832
|
+
}
|
833
|
+
});
|
834
|
+
}
|
835
|
+
}
|
836
|
+
}
|
837
|
+
curFlowNode = conditionFlowNode.antecedent;
|
838
|
+
continue;
|
839
|
+
}
|
840
|
+
if (curFlowNode.flags & (codeFlowTypes_1.FlowFlags.BranchLabel | codeFlowTypes_1.FlowFlags.LoopLabel)) {
|
841
|
+
const labelNode = curFlowNode;
|
842
|
+
const newConstraints = [];
|
843
|
+
// Prevent infinite recursion by noting that we've been here before.
|
844
|
+
visitedFlowNodeMap.add(curFlowNode.id);
|
845
|
+
for (const antecedent of labelNode.antecedents) {
|
846
|
+
const constraintsToAdd = narrowConstrainedTypeVarRecursive(antecedent, typeVar);
|
847
|
+
for (const constraint of constraintsToAdd) {
|
848
|
+
if (!newConstraints.some((t) => (0, types_1.isTypeSame)(t, constraint))) {
|
849
|
+
newConstraints.push(constraint);
|
850
|
+
}
|
851
|
+
}
|
852
|
+
}
|
853
|
+
visitedFlowNodeMap.delete(curFlowNode.id);
|
854
|
+
return newConstraints;
|
855
|
+
}
|
856
|
+
// We shouldn't get here.
|
857
|
+
(0, debug_1.fail)('Unexpected flow node flags');
|
858
|
+
return startingConstraints;
|
859
|
+
}
|
860
|
+
}
|
861
|
+
const narrowedConstrainedType = narrowConstrainedTypeVarRecursive(flowNode, typeVar);
|
862
|
+
// Have we narrowed the typeVar to a single constraint?
|
863
|
+
return narrowedConstrainedType.length === 1 ? narrowedConstrainedType[0] : undefined;
|
864
|
+
}
|
865
|
+
// Determines whether a specified type is the same as a constrained
|
866
|
+
// TypeVar or is conditioned on that same TypeVar or is some union of
|
867
|
+
// the above.
|
868
|
+
function isCompatibleWithConstrainedTypeVar(type, typeVar) {
|
869
|
+
let isCompatible = true;
|
870
|
+
(0, typeUtils_1.doForEachSubtype)(type, (subtype) => {
|
871
|
+
if ((0, types_1.isTypeVar)(subtype)) {
|
872
|
+
if (!(0, types_1.isTypeSame)(subtype, typeVar)) {
|
873
|
+
isCompatible = false;
|
874
|
+
}
|
875
|
+
}
|
876
|
+
else if (subtype.condition) {
|
877
|
+
if (!subtype.condition.some((condition) => condition.isConstrainedTypeVar && condition.typeVarName === typeVar.nameWithScope)) {
|
878
|
+
isCompatible = false;
|
879
|
+
}
|
880
|
+
}
|
881
|
+
else {
|
882
|
+
isCompatible = false;
|
883
|
+
}
|
884
|
+
});
|
885
|
+
return isCompatible;
|
886
|
+
}
|
887
|
+
// Determines whether a call associated with this flow node returns a NoReturn
|
888
|
+
// type, thus preventing further traversal of the code flow graph.
|
889
|
+
function isCallNoReturn(evaluator, flowNode) {
|
890
|
+
const node = flowNode.node;
|
891
|
+
if (isPrintCallNoReturnEnabled) {
|
892
|
+
console.log(`isCallNoReturn@${flowNode.id} Pre depth ${noReturnAnalysisDepth}`);
|
893
|
+
}
|
894
|
+
// See if this information is cached already.
|
895
|
+
if (callIsNoReturnCache.has(node.id)) {
|
896
|
+
const result = callIsNoReturnCache.get(node.id);
|
897
|
+
if (isPrintCallNoReturnEnabled) {
|
898
|
+
console.log(`isCallNoReturn@${flowNode.id} Post: ${result ? 'true' : 'false'} (cached)`);
|
899
|
+
}
|
900
|
+
return result;
|
901
|
+
}
|
902
|
+
// See if we've exceeded the max recursion depth.
|
903
|
+
if (noReturnAnalysisDepth > types_1.maxTypeRecursionCount) {
|
904
|
+
return false;
|
905
|
+
}
|
906
|
+
// Initially set to false to avoid recursion.
|
907
|
+
callIsNoReturnCache.set(node.id, false);
|
908
|
+
noReturnAnalysisDepth++;
|
909
|
+
try {
|
910
|
+
let noReturnTypeCount = 0;
|
911
|
+
let subtypeCount = 0;
|
912
|
+
// Evaluate the call base type.
|
913
|
+
const callType = evaluator.getTypeOfExpression(node.leftExpression, 2 /* DoNotSpecialize */).type;
|
914
|
+
(0, typeUtils_1.doForEachSubtype)(callType, (callSubtype) => {
|
915
|
+
var _a;
|
916
|
+
// Track the number of subtypes we've examined.
|
917
|
+
subtypeCount++;
|
918
|
+
if ((0, types_1.isInstantiableClass)(callSubtype)) {
|
919
|
+
// Does the class have a custom metaclass that implements a `__call__` method?
|
920
|
+
// If so, it will be called instead of `__init__` or `__new__`. We'll assume
|
921
|
+
// in this case that the __call__ method is not a NoReturn type.
|
922
|
+
if (callSubtype.details.effectiveMetaclass &&
|
923
|
+
(0, types_1.isClass)(callSubtype.details.effectiveMetaclass) &&
|
924
|
+
!types_1.ClassType.isBuiltIn(callSubtype.details.effectiveMetaclass, 'type')) {
|
925
|
+
const metaclassCallMember = (0, typeUtils_1.lookUpClassMember)(callSubtype.details.effectiveMetaclass, '__call__', 8 /* SkipInstanceVariables */ | 4 /* SkipObjectBaseClass */);
|
926
|
+
if (metaclassCallMember) {
|
927
|
+
return;
|
928
|
+
}
|
929
|
+
}
|
930
|
+
let constructorMember = (0, typeUtils_1.lookUpClassMember)(callSubtype, '__init__', 8 /* SkipInstanceVariables */ | 4 /* SkipObjectBaseClass */);
|
931
|
+
if (constructorMember === undefined) {
|
932
|
+
constructorMember = (0, typeUtils_1.lookUpClassMember)(callSubtype, '__new__', 8 /* SkipInstanceVariables */ | 4 /* SkipObjectBaseClass */);
|
933
|
+
}
|
934
|
+
if (constructorMember) {
|
935
|
+
const constructorType = evaluator.getTypeOfMember(constructorMember);
|
936
|
+
if (constructorType) {
|
937
|
+
if ((0, types_1.isFunction)(constructorType) || (0, types_1.isOverloadedFunction)(constructorType)) {
|
938
|
+
const boundConstructorType = evaluator.bindFunctionToClassOrObject(undefined, constructorType);
|
939
|
+
if (boundConstructorType) {
|
940
|
+
callSubtype = boundConstructorType;
|
941
|
+
}
|
942
|
+
}
|
943
|
+
}
|
944
|
+
}
|
945
|
+
}
|
946
|
+
else if ((0, types_1.isClassInstance)(callSubtype)) {
|
947
|
+
const callMember = (0, typeUtils_1.lookUpClassMember)(callSubtype, '__call__', 8 /* SkipInstanceVariables */);
|
948
|
+
if (callMember) {
|
949
|
+
const callMemberType = evaluator.getTypeOfMember(callMember);
|
950
|
+
if (callMemberType) {
|
951
|
+
if ((0, types_1.isFunction)(callMemberType) || (0, types_1.isOverloadedFunction)(callMemberType)) {
|
952
|
+
const boundCallType = evaluator.bindFunctionToClassOrObject(undefined, callMemberType);
|
953
|
+
if (boundCallType) {
|
954
|
+
callSubtype = boundCallType;
|
955
|
+
}
|
956
|
+
}
|
957
|
+
}
|
958
|
+
}
|
959
|
+
}
|
960
|
+
const isCallAwaited = ((_a = node.parent) === null || _a === void 0 ? void 0 : _a.nodeType) === 6 /* Await */;
|
961
|
+
if ((0, types_1.isFunction)(callSubtype)) {
|
962
|
+
if (isFunctionNoReturn(callSubtype, isCallAwaited)) {
|
963
|
+
noReturnTypeCount++;
|
964
|
+
}
|
965
|
+
}
|
966
|
+
else if ((0, types_1.isOverloadedFunction)(callSubtype)) {
|
967
|
+
let overloadCount = 0;
|
968
|
+
let noReturnOverloadCount = 0;
|
969
|
+
callSubtype.overloads.forEach((overload) => {
|
970
|
+
if (types_1.FunctionType.isOverloaded(overload)) {
|
971
|
+
overloadCount++;
|
972
|
+
if (isFunctionNoReturn(overload, isCallAwaited)) {
|
973
|
+
noReturnOverloadCount++;
|
974
|
+
}
|
975
|
+
}
|
976
|
+
});
|
977
|
+
// Was at least one of the overloaded return types NoReturn?
|
978
|
+
if (noReturnOverloadCount > 0) {
|
979
|
+
if (noReturnOverloadCount === overloadCount) {
|
980
|
+
noReturnTypeCount++;
|
981
|
+
}
|
982
|
+
// For now, assume that if some (but not all) overloads return
|
983
|
+
// NoReturn that the call is not a NoReturn.
|
984
|
+
}
|
985
|
+
}
|
986
|
+
});
|
987
|
+
// The call is considered NoReturn if all subtypes evaluate to NoReturn.
|
988
|
+
const callIsNoReturn = subtypeCount > 0 && noReturnTypeCount === subtypeCount;
|
989
|
+
// Cache the value for next time.
|
990
|
+
callIsNoReturnCache.set(node.id, callIsNoReturn);
|
991
|
+
if (isPrintCallNoReturnEnabled) {
|
992
|
+
console.log(`isCallNoReturn@${flowNode.id} Post: ${callIsNoReturn ? 'true' : 'false'}`);
|
993
|
+
}
|
994
|
+
return callIsNoReturn;
|
995
|
+
}
|
996
|
+
finally {
|
997
|
+
noReturnAnalysisDepth--;
|
998
|
+
}
|
999
|
+
}
|
1000
|
+
function isFunctionNoReturn(functionType, isCallAwaited) {
|
1001
|
+
const returnType = functionType.details.declaredReturnType;
|
1002
|
+
if (types_1.FunctionType.isAsync(functionType)) {
|
1003
|
+
if (returnType &&
|
1004
|
+
(0, types_1.isClassInstance)(returnType) &&
|
1005
|
+
types_1.ClassType.isBuiltIn(returnType, 'Coroutine') &&
|
1006
|
+
returnType.typeArguments &&
|
1007
|
+
returnType.typeArguments.length >= 3) {
|
1008
|
+
if ((0, types_1.isNever)(returnType.typeArguments[2]) && isCallAwaited) {
|
1009
|
+
return true;
|
1010
|
+
}
|
1011
|
+
}
|
1012
|
+
}
|
1013
|
+
else if (returnType) {
|
1014
|
+
return (0, types_1.isNever)(returnType);
|
1015
|
+
}
|
1016
|
+
else if (functionType.details.declaration) {
|
1017
|
+
// If the function has yield expressions, it's a generator, and
|
1018
|
+
// we'll assume the yield statements are reachable. Also, don't
|
1019
|
+
// infer a "no return" type for abstract methods.
|
1020
|
+
if (!functionType.details.declaration.yieldStatements &&
|
1021
|
+
!types_1.FunctionType.isAbstractMethod(functionType) &&
|
1022
|
+
!types_1.FunctionType.isStubDefinition(functionType) &&
|
1023
|
+
!types_1.FunctionType.isPyTypedDefinition(functionType)) {
|
1024
|
+
// Check specifically for a common idiom where the only statement
|
1025
|
+
// (other than a possible docstring) is a "raise NotImplementedError".
|
1026
|
+
const functionStatements = functionType.details.declaration.node.suite.statements;
|
1027
|
+
let foundRaiseNotImplemented = false;
|
1028
|
+
for (const statement of functionStatements) {
|
1029
|
+
if (statement.nodeType !== 47 /* StatementList */ || statement.statements.length !== 1) {
|
1030
|
+
break;
|
1031
|
+
}
|
1032
|
+
const simpleStatement = statement.statements[0];
|
1033
|
+
if (simpleStatement.nodeType === 48 /* StringList */) {
|
1034
|
+
continue;
|
1035
|
+
}
|
1036
|
+
if (simpleStatement.nodeType === 43 /* Raise */ && simpleStatement.typeExpression) {
|
1037
|
+
// Check for "raise NotImplementedError" or "raise NotImplementedError()"
|
1038
|
+
const isNotImplementedName = (node) => {
|
1039
|
+
return (node === null || node === void 0 ? void 0 : node.nodeType) === 38 /* Name */ && node.value === 'NotImplementedError';
|
1040
|
+
};
|
1041
|
+
if (isNotImplementedName(simpleStatement.typeExpression)) {
|
1042
|
+
foundRaiseNotImplemented = true;
|
1043
|
+
}
|
1044
|
+
else if (simpleStatement.typeExpression.nodeType === 9 /* Call */ &&
|
1045
|
+
isNotImplementedName(simpleStatement.typeExpression.leftExpression)) {
|
1046
|
+
foundRaiseNotImplemented = true;
|
1047
|
+
}
|
1048
|
+
}
|
1049
|
+
break;
|
1050
|
+
}
|
1051
|
+
if (!foundRaiseNotImplemented && !isAfterNodeReachable(evaluator, functionType)) {
|
1052
|
+
return true;
|
1053
|
+
}
|
1054
|
+
}
|
1055
|
+
}
|
1056
|
+
return false;
|
1057
|
+
}
|
1058
|
+
function isAfterNodeReachable(evaluator, functionType) {
|
1059
|
+
if (!functionType.details.declaration) {
|
1060
|
+
return true;
|
1061
|
+
}
|
1062
|
+
return evaluator.isAfterNodeReachable(functionType.details.declaration.node);
|
1063
|
+
}
|
1064
|
+
// Performs a cursory analysis to determine whether the expression
|
1065
|
+
// corresponds to a context manager object that supports the swallowing
|
1066
|
+
// of exceptions. By convention, these objects have an "__exit__" method
|
1067
|
+
// that returns a bool response (as opposed to a None). This function is
|
1068
|
+
// called during code flow, so it can't rely on full type evaluation. It
|
1069
|
+
// makes some simplifying assumptions that work in most cases.
|
1070
|
+
function isExceptionContextManager(evaluator, node, isAsync) {
|
1071
|
+
var _a;
|
1072
|
+
// See if this information is cached already.
|
1073
|
+
if (isExceptionContextManagerCache.has(node.id)) {
|
1074
|
+
return isExceptionContextManagerCache.get(node.id);
|
1075
|
+
}
|
1076
|
+
// Initially set to false to avoid infinite recursion.
|
1077
|
+
isExceptionContextManagerCache.set(node.id, false);
|
1078
|
+
// See if we've exceeded the max recursion depth.
|
1079
|
+
if (contextManagerAnalysisDepth > types_1.maxTypeRecursionCount) {
|
1080
|
+
return false;
|
1081
|
+
}
|
1082
|
+
contextManagerAnalysisDepth++;
|
1083
|
+
let cmSwallowsExceptions = false;
|
1084
|
+
try {
|
1085
|
+
const cmType = evaluator.getTypeOfExpression(node).type;
|
1086
|
+
if (cmType && (0, types_1.isClassInstance)(cmType)) {
|
1087
|
+
const exitMethodName = isAsync ? '__aexit__' : '__exit__';
|
1088
|
+
const exitType = (_a = evaluator.getTypeOfObjectMember(node, cmType, exitMethodName)) === null || _a === void 0 ? void 0 : _a.type;
|
1089
|
+
if (exitType && (0, types_1.isFunction)(exitType) && exitType.details.declaredReturnType) {
|
1090
|
+
const returnType = exitType.details.declaredReturnType;
|
1091
|
+
cmSwallowsExceptions = (0, types_1.isClassInstance)(returnType) && types_1.ClassType.isBuiltIn(returnType, 'bool');
|
1092
|
+
}
|
1093
|
+
}
|
1094
|
+
}
|
1095
|
+
finally {
|
1096
|
+
contextManagerAnalysisDepth--;
|
1097
|
+
}
|
1098
|
+
// Cache the value for next time.
|
1099
|
+
isExceptionContextManagerCache.set(node.id, cmSwallowsExceptions);
|
1100
|
+
return cmSwallowsExceptions;
|
1101
|
+
}
|
1102
|
+
function getTypeFromWildcardImport(flowNode, name) {
|
1103
|
+
const importInfo = (0, analyzerNodeInfo_1.getImportInfo)(flowNode.node.module);
|
1104
|
+
(0, debug_1.assert)(importInfo !== undefined && importInfo.isImportFound);
|
1105
|
+
(0, debug_1.assert)(flowNode.node.isWildcardImport);
|
1106
|
+
const symbolWithScope = evaluator.lookUpSymbolRecursive(flowNode.node, name, /* honorCodeFlow */ false);
|
1107
|
+
(0, debug_1.assert)(symbolWithScope !== undefined);
|
1108
|
+
const decls = symbolWithScope.symbol.getDeclarations();
|
1109
|
+
const wildcardDecl = decls.find((decl) => decl.node === flowNode.node);
|
1110
|
+
if (!wildcardDecl) {
|
1111
|
+
return types_1.UnknownType.create();
|
1112
|
+
}
|
1113
|
+
return evaluator.getInferredTypeOfDeclaration(symbolWithScope.symbol, wildcardDecl) || types_1.UnknownType.create();
|
1114
|
+
}
|
1115
|
+
function printControlFlowGraph(flowNode, reference, callName) {
|
1116
|
+
let referenceText = '';
|
1117
|
+
if (reference) {
|
1118
|
+
const fileInfo = (0, analyzerNodeInfo_1.getFileInfo)(reference);
|
1119
|
+
const pos = (0, positionUtils_1.convertOffsetToPosition)(reference.start, fileInfo.lines);
|
1120
|
+
referenceText = `${(0, parseTreeUtils_1.printExpression)(reference)}[${pos.line + 1}:${pos.character + 1}]`;
|
1121
|
+
}
|
1122
|
+
console.log(`${callName}@${flowNode.id}: ${referenceText || '(none)'}`);
|
1123
|
+
console.log((0, codeFlowUtils_1.formatControlFlowGraph)(flowNode));
|
1124
|
+
}
|
1125
|
+
return {
|
1126
|
+
createCodeFlowAnalyzer,
|
1127
|
+
isFlowNodeReachable,
|
1128
|
+
narrowConstrainedTypeVar,
|
1129
|
+
};
|
1130
|
+
}
|
1131
|
+
exports.getCodeFlowEngine = getCodeFlowEngine;
|
1132
|
+
//# sourceMappingURL=codeFlowEngine.js.map
|