@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,866 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* patternMatching.ts
|
4
|
+
* Copyright (c) Microsoft Corporation.
|
5
|
+
* Licensed under the MIT license.
|
6
|
+
* Author: Eric Traut
|
7
|
+
*
|
8
|
+
* Type evaluation logic for evaluating and narrowing types
|
9
|
+
* related to "match" and "case" statements as documented in
|
10
|
+
* PEP 634.
|
11
|
+
*/
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
+
exports.validateClassPattern = exports.assignTypeToPatternTargets = exports.narrowTypeBasedOnPattern = void 0;
|
14
|
+
const collectionUtils_1 = require("../common/collectionUtils");
|
15
|
+
const debug_1 = require("../common/debug");
|
16
|
+
const diagnosticRules_1 = require("../common/diagnosticRules");
|
17
|
+
const localize_1 = require("../localization/localize");
|
18
|
+
const analyzerNodeInfo_1 = require("./analyzerNodeInfo");
|
19
|
+
const constraintSolver_1 = require("./constraintSolver");
|
20
|
+
const typedDicts_1 = require("./typedDicts");
|
21
|
+
const typeGuards_1 = require("./typeGuards");
|
22
|
+
const types_1 = require("./types");
|
23
|
+
const typeUtils_1 = require("./typeUtils");
|
24
|
+
const typeVarContext_1 = require("./typeVarContext");
|
25
|
+
// PEP 634 indicates that several built-in classes are handled differently
|
26
|
+
// when used with class pattern matching.
|
27
|
+
const classPatternSpecialCases = [
|
28
|
+
'builtins.bool',
|
29
|
+
'builtins.bytearray',
|
30
|
+
'builtins.bytes',
|
31
|
+
'builtins.dict',
|
32
|
+
'builtins.float',
|
33
|
+
'builtins.frozenset',
|
34
|
+
'builtins.int',
|
35
|
+
'builtins.list',
|
36
|
+
'builtins.set',
|
37
|
+
'builtins.str',
|
38
|
+
'builtins.tuple',
|
39
|
+
];
|
40
|
+
function narrowTypeBasedOnPattern(evaluator, type, pattern, isPositiveTest) {
|
41
|
+
switch (pattern.nodeType) {
|
42
|
+
case 65 /* PatternSequence */: {
|
43
|
+
return narrowTypeBasedOnSequencePattern(evaluator, type, pattern, isPositiveTest);
|
44
|
+
}
|
45
|
+
case 67 /* PatternLiteral */: {
|
46
|
+
return narrowTypeBasedOnLiteralPattern(evaluator, type, pattern, isPositiveTest);
|
47
|
+
}
|
48
|
+
case 68 /* PatternClass */: {
|
49
|
+
return narrowTypeBasedOnClassPattern(evaluator, type, pattern, isPositiveTest);
|
50
|
+
}
|
51
|
+
case 66 /* PatternAs */: {
|
52
|
+
return narrowTypeBasedOnAsPattern(evaluator, type, pattern, isPositiveTest);
|
53
|
+
}
|
54
|
+
case 70 /* PatternMapping */: {
|
55
|
+
return narrowTypeBasedOnMappingPattern(evaluator, type, pattern, isPositiveTest);
|
56
|
+
}
|
57
|
+
case 73 /* PatternValue */: {
|
58
|
+
return narrowTypeBasedOnValuePattern(evaluator, type, pattern, isPositiveTest);
|
59
|
+
}
|
60
|
+
case 69 /* PatternCapture */: {
|
61
|
+
// A capture captures everything, so nothing remains in the negative case.
|
62
|
+
return isPositiveTest ? type : types_1.NeverType.createNever();
|
63
|
+
}
|
64
|
+
case 0 /* Error */: {
|
65
|
+
return type;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
exports.narrowTypeBasedOnPattern = narrowTypeBasedOnPattern;
|
70
|
+
function narrowTypeBasedOnSequencePattern(evaluator, type, pattern, isPositiveTest) {
|
71
|
+
let sequenceInfo = getSequencePatternInfo(evaluator, type, pattern.entries.length, pattern.starEntryIndex);
|
72
|
+
// Further narrow based on pattern entry types.
|
73
|
+
sequenceInfo = sequenceInfo.filter((entry) => {
|
74
|
+
if (entry.definiteNoMatch) {
|
75
|
+
if (isPositiveTest) {
|
76
|
+
return false;
|
77
|
+
}
|
78
|
+
else {
|
79
|
+
return true;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
let isPlausibleMatch = true;
|
83
|
+
let isDefiniteMatch = true;
|
84
|
+
const narrowedEntryTypes = [];
|
85
|
+
let canNarrowTuple = entry.isTuple;
|
86
|
+
// If the subject has an indeterminate length but the pattern does not accept
|
87
|
+
// an arbitrary number of entries or accepts at least one non-star entry,
|
88
|
+
// we can't prove that it's a definite match.
|
89
|
+
if (entry.isIndeterminateLength) {
|
90
|
+
if (pattern.entries.length !== 1 || pattern.starEntryIndex !== 0) {
|
91
|
+
isDefiniteMatch = false;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
pattern.entries.forEach((sequenceEntry, index) => {
|
95
|
+
const entryType = getTypeOfPatternSequenceEntry(evaluator, pattern, entry, index, pattern.entries.length, pattern.starEntryIndex,
|
96
|
+
/* unpackStarEntry */ true,
|
97
|
+
/* isSubjectObject */ false);
|
98
|
+
const narrowedEntryType = narrowTypeBasedOnPattern(evaluator, entryType, sequenceEntry, isPositiveTest);
|
99
|
+
if (isPositiveTest) {
|
100
|
+
if (index === pattern.starEntryIndex) {
|
101
|
+
if ((0, types_1.isClassInstance)(narrowedEntryType) &&
|
102
|
+
narrowedEntryType.tupleTypeArguments &&
|
103
|
+
!(0, typeUtils_1.isUnboundedTupleClass)(narrowedEntryType) &&
|
104
|
+
narrowedEntryType.tupleTypeArguments) {
|
105
|
+
(0, collectionUtils_1.appendArray)(narrowedEntryTypes, narrowedEntryType.tupleTypeArguments.map((t) => t.type));
|
106
|
+
}
|
107
|
+
else {
|
108
|
+
narrowedEntryTypes.push(narrowedEntryType);
|
109
|
+
canNarrowTuple = false;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
else {
|
113
|
+
narrowedEntryTypes.push(narrowedEntryType);
|
114
|
+
if ((0, types_1.isNever)(narrowedEntryType)) {
|
115
|
+
isPlausibleMatch = false;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
else {
|
120
|
+
if (!(0, types_1.isNever)(narrowedEntryType) || (0, types_1.isAnyOrUnknown)(entryType)) {
|
121
|
+
isDefiniteMatch = false;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
});
|
125
|
+
if (!isPositiveTest) {
|
126
|
+
return !isDefiniteMatch;
|
127
|
+
}
|
128
|
+
if (isPlausibleMatch) {
|
129
|
+
// If this is a tuple, we can narrow it to a specific tuple type.
|
130
|
+
// Other sequences cannot be narrowed because we don't know if they
|
131
|
+
// are immutable (covariant).
|
132
|
+
if (canNarrowTuple) {
|
133
|
+
const tupleClassType = evaluator.getBuiltInType(pattern, 'tuple');
|
134
|
+
if (tupleClassType && (0, types_1.isInstantiableClass)(tupleClassType)) {
|
135
|
+
entry.subtype = types_1.ClassType.cloneAsInstance((0, typeUtils_1.specializeTupleClass)(tupleClassType, narrowedEntryTypes.map((t) => {
|
136
|
+
return { type: t, isUnbounded: false };
|
137
|
+
})));
|
138
|
+
}
|
139
|
+
}
|
140
|
+
// If this is an object, we can narrow it to a specific Sequence type.
|
141
|
+
if (entry.isObject) {
|
142
|
+
const sequenceType = evaluator.getTypingType(pattern, 'Sequence');
|
143
|
+
if (sequenceType && (0, types_1.isInstantiableClass)(sequenceType)) {
|
144
|
+
entry.subtype = types_1.ClassType.cloneAsInstance(types_1.ClassType.cloneForSpecialization(sequenceType, [(0, typeUtils_1.stripLiteralValue)((0, types_1.combineTypes)(narrowedEntryTypes))],
|
145
|
+
/* isTypeArgumentExplicit */ true));
|
146
|
+
}
|
147
|
+
}
|
148
|
+
}
|
149
|
+
return isPlausibleMatch;
|
150
|
+
});
|
151
|
+
return (0, types_1.combineTypes)(sequenceInfo.map((entry) => entry.subtype));
|
152
|
+
}
|
153
|
+
function narrowTypeBasedOnAsPattern(evaluator, type, pattern, isPositiveTest) {
|
154
|
+
let remainingType = type;
|
155
|
+
if (!isPositiveTest) {
|
156
|
+
pattern.orPatterns.forEach((subpattern) => {
|
157
|
+
remainingType = narrowTypeBasedOnPattern(evaluator, remainingType, subpattern, /* isPositiveTest */ false);
|
158
|
+
});
|
159
|
+
return remainingType;
|
160
|
+
}
|
161
|
+
const narrowedTypes = pattern.orPatterns.map((subpattern) => {
|
162
|
+
const narrowedSubtype = narrowTypeBasedOnPattern(evaluator, remainingType, subpattern,
|
163
|
+
/* isPositiveTest */ true);
|
164
|
+
remainingType = narrowTypeBasedOnPattern(evaluator, remainingType, subpattern, /* isPositiveTest */ false);
|
165
|
+
return narrowedSubtype;
|
166
|
+
});
|
167
|
+
return (0, types_1.combineTypes)(narrowedTypes);
|
168
|
+
}
|
169
|
+
function narrowTypeBasedOnMappingPattern(evaluator, type, pattern, isPositiveTest) {
|
170
|
+
if (!isPositiveTest) {
|
171
|
+
// Never narrow in negative case.
|
172
|
+
return type;
|
173
|
+
}
|
174
|
+
let mappingInfo = getMappingPatternInfo(evaluator, type);
|
175
|
+
// Further narrow based on pattern entry types.
|
176
|
+
mappingInfo = mappingInfo.filter((mappingSubtypeInfo) => {
|
177
|
+
let isPlausibleMatch = true;
|
178
|
+
pattern.entries.forEach((mappingEntry) => {
|
179
|
+
if (mappingSubtypeInfo.typedDict) {
|
180
|
+
if (mappingEntry.nodeType === 71 /* PatternMappingKeyEntry */) {
|
181
|
+
const narrowedKeyType = narrowTypeBasedOnPattern(evaluator, evaluator.getBuiltInObject(pattern, 'str'), mappingEntry.keyPattern, isPositiveTest);
|
182
|
+
if ((0, types_1.isNever)(narrowedKeyType)) {
|
183
|
+
isPlausibleMatch = false;
|
184
|
+
}
|
185
|
+
const valueType = (0, typeUtils_1.mapSubtypes)(narrowedKeyType, (keySubtype) => {
|
186
|
+
if ((0, types_1.isAnyOrUnknown)(keySubtype)) {
|
187
|
+
return keySubtype;
|
188
|
+
}
|
189
|
+
if ((0, types_1.isClassInstance)(keySubtype) && types_1.ClassType.isBuiltIn(keySubtype, 'str')) {
|
190
|
+
if (!(0, typeUtils_1.isLiteralType)(keySubtype)) {
|
191
|
+
return types_1.UnknownType.create();
|
192
|
+
}
|
193
|
+
const tdEntries = (0, typedDicts_1.getTypedDictMembersForClass)(evaluator, mappingSubtypeInfo.typedDict);
|
194
|
+
const valueEntry = tdEntries.get(keySubtype.literalValue);
|
195
|
+
if (valueEntry) {
|
196
|
+
const narrowedValueType = narrowTypeBasedOnPattern(evaluator, valueEntry.valueType, mappingEntry.valuePattern,
|
197
|
+
/* isPositiveTest */ true);
|
198
|
+
if (!(0, types_1.isNever)(narrowedValueType)) {
|
199
|
+
return narrowedValueType;
|
200
|
+
}
|
201
|
+
}
|
202
|
+
}
|
203
|
+
return undefined;
|
204
|
+
});
|
205
|
+
if ((0, types_1.isNever)(valueType)) {
|
206
|
+
isPlausibleMatch = false;
|
207
|
+
}
|
208
|
+
}
|
209
|
+
}
|
210
|
+
else if (mappingSubtypeInfo.dictTypeArgs) {
|
211
|
+
if (mappingEntry.nodeType === 71 /* PatternMappingKeyEntry */) {
|
212
|
+
const narrowedKeyType = narrowTypeBasedOnPattern(evaluator, mappingSubtypeInfo.dictTypeArgs.key, mappingEntry.keyPattern, isPositiveTest);
|
213
|
+
const narrowedValueType = narrowTypeBasedOnPattern(evaluator, mappingSubtypeInfo.dictTypeArgs.value, mappingEntry.valuePattern, isPositiveTest);
|
214
|
+
if ((0, types_1.isNever)(narrowedKeyType) || (0, types_1.isNever)(narrowedValueType)) {
|
215
|
+
isPlausibleMatch = false;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
}
|
219
|
+
});
|
220
|
+
return isPlausibleMatch;
|
221
|
+
});
|
222
|
+
return (0, types_1.combineTypes)(mappingInfo.map((entry) => entry.subtype));
|
223
|
+
}
|
224
|
+
// Looks up the "__match_args__" class member to determine the names of
|
225
|
+
// the attributes used for class pattern matching.
|
226
|
+
function getPositionalMatchArgNames(evaluator, type) {
|
227
|
+
const matchArgsMemberInfo = (0, typeUtils_1.lookUpClassMember)(type, '__match_args__');
|
228
|
+
if (matchArgsMemberInfo) {
|
229
|
+
const matchArgsType = evaluator.getTypeOfMember(matchArgsMemberInfo);
|
230
|
+
if ((0, types_1.isClassInstance)(matchArgsType) &&
|
231
|
+
(0, typeUtils_1.isTupleClass)(matchArgsType) &&
|
232
|
+
!(0, typeUtils_1.isUnboundedTupleClass)(matchArgsType) &&
|
233
|
+
matchArgsType.tupleTypeArguments) {
|
234
|
+
const tupleArgs = matchArgsType.tupleTypeArguments;
|
235
|
+
// Are all the args string literals?
|
236
|
+
if (tupleArgs.every((arg) => (0, types_1.isClassInstance)(arg.type) && types_1.ClassType.isBuiltIn(arg.type, 'str') && (0, typeUtils_1.isLiteralType)(arg.type))) {
|
237
|
+
return tupleArgs.map((arg) => arg.type.literalValue);
|
238
|
+
}
|
239
|
+
}
|
240
|
+
}
|
241
|
+
return [];
|
242
|
+
}
|
243
|
+
function narrowTypeBasedOnLiteralPattern(evaluator, type, pattern, isPositiveTest) {
|
244
|
+
const literalType = evaluator.getTypeOfExpression(pattern.expression).type;
|
245
|
+
if (!isPositiveTest) {
|
246
|
+
return (0, typeUtils_1.mapSubtypes)(type, (subtype) => {
|
247
|
+
if ((0, types_1.isClassInstance)(literalType) &&
|
248
|
+
(0, typeUtils_1.isLiteralType)(literalType) &&
|
249
|
+
(0, types_1.isClassInstance)(subtype) &&
|
250
|
+
(0, typeUtils_1.isLiteralType)(subtype) &&
|
251
|
+
evaluator.assignType(literalType, subtype)) {
|
252
|
+
return undefined;
|
253
|
+
}
|
254
|
+
if ((0, types_1.isNoneInstance)(subtype) && (0, types_1.isNoneInstance)(literalType)) {
|
255
|
+
return undefined;
|
256
|
+
}
|
257
|
+
// Narrow a non-literal bool based on a literal bool pattern.
|
258
|
+
if ((0, types_1.isClassInstance)(subtype) &&
|
259
|
+
types_1.ClassType.isBuiltIn(subtype, 'bool') &&
|
260
|
+
subtype.literalValue === undefined &&
|
261
|
+
(0, types_1.isClassInstance)(literalType) &&
|
262
|
+
types_1.ClassType.isBuiltIn(literalType, 'bool') &&
|
263
|
+
literalType.literalValue !== undefined) {
|
264
|
+
return types_1.ClassType.cloneWithLiteral(literalType, !literalType.literalValue);
|
265
|
+
}
|
266
|
+
return subtype;
|
267
|
+
});
|
268
|
+
}
|
269
|
+
return (0, typeUtils_1.mapSubtypes)(type, (subtype) => {
|
270
|
+
if (evaluator.assignType(subtype, literalType)) {
|
271
|
+
return literalType;
|
272
|
+
}
|
273
|
+
return undefined;
|
274
|
+
});
|
275
|
+
}
|
276
|
+
function narrowTypeBasedOnClassPattern(evaluator, type, pattern, isPositiveTest) {
|
277
|
+
let exprType = evaluator.getTypeOfExpression(pattern.className, 2 /* DoNotSpecialize */).type;
|
278
|
+
// If this is a class (but not a type alias that refers to a class),
|
279
|
+
// specialize it with Unknown type arguments.
|
280
|
+
if ((0, types_1.isClass)(exprType) && !exprType.typeAliasInfo) {
|
281
|
+
exprType = (0, typeUtils_1.specializeClassType)(exprType);
|
282
|
+
}
|
283
|
+
if (!isPositiveTest) {
|
284
|
+
// Don't attempt to narrow if the class type is a more complex type (e.g. a TypeVar or union).
|
285
|
+
if (!(0, types_1.isInstantiableClass)(exprType)) {
|
286
|
+
return type;
|
287
|
+
}
|
288
|
+
let classType = exprType;
|
289
|
+
if (classType.details.typeParameters.length > 0) {
|
290
|
+
classType = types_1.ClassType.cloneForSpecialization(classType,
|
291
|
+
/* typeArguments */ undefined,
|
292
|
+
/* isTypeArgumentExplicit */ false);
|
293
|
+
}
|
294
|
+
const classInstance = (0, typeUtils_1.convertToInstance)(classType);
|
295
|
+
return evaluator.mapSubtypesExpandTypeVars(type,
|
296
|
+
/* conditionFilter */ undefined, (subjectSubtypeExpanded, subjectSubtypeUnexpanded) => {
|
297
|
+
if (!(0, types_1.isClassInstance)(subjectSubtypeExpanded)) {
|
298
|
+
return subjectSubtypeUnexpanded;
|
299
|
+
}
|
300
|
+
if (!evaluator.assignType(classInstance, subjectSubtypeExpanded)) {
|
301
|
+
return subjectSubtypeExpanded;
|
302
|
+
}
|
303
|
+
// If there are no arguments, we're done. We know that this match
|
304
|
+
// will never succeed.
|
305
|
+
if (pattern.arguments.length === 0) {
|
306
|
+
return undefined;
|
307
|
+
}
|
308
|
+
// We might be able to narrow further based on arguments, but only
|
309
|
+
// if the types match exactly or the subtype is a final class and
|
310
|
+
// therefore cannot be subclassed.
|
311
|
+
if (!evaluator.assignType(subjectSubtypeExpanded, classInstance)) {
|
312
|
+
if (!types_1.ClassType.isFinal(subjectSubtypeExpanded)) {
|
313
|
+
return subjectSubtypeExpanded;
|
314
|
+
}
|
315
|
+
}
|
316
|
+
// Are there any positional arguments? If so, try to get the mappings for
|
317
|
+
// these arguments by fetching the __match_args__ symbol from the class.
|
318
|
+
let positionalArgNames = [];
|
319
|
+
if (pattern.arguments.some((arg) => !arg.name)) {
|
320
|
+
if ((0, types_1.isClass)(subjectSubtypeExpanded)) {
|
321
|
+
positionalArgNames = getPositionalMatchArgNames(evaluator, subjectSubtypeExpanded);
|
322
|
+
}
|
323
|
+
}
|
324
|
+
for (let index = 0; index < pattern.arguments.length; index++) {
|
325
|
+
const narrowedArgType = narrowTypeOfClassPatternArgument(evaluator, pattern.arguments[index], index, positionalArgNames, subjectSubtypeExpanded, isPositiveTest);
|
326
|
+
if (!(0, types_1.isNever)(narrowedArgType)) {
|
327
|
+
return subjectSubtypeUnexpanded;
|
328
|
+
}
|
329
|
+
}
|
330
|
+
// We've completely eliminated the type based on the arguments.
|
331
|
+
return undefined;
|
332
|
+
});
|
333
|
+
}
|
334
|
+
if (!types_1.TypeBase.isInstantiable(exprType) && !(0, types_1.isNever)(exprType)) {
|
335
|
+
evaluator.addDiagnostic((0, analyzerNodeInfo_1.getFileInfo)(pattern).diagnosticRuleSet.reportGeneralTypeIssues, diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.Localizer.DiagnosticAddendum.typeNotClass().format({ type: evaluator.printType(exprType) }), pattern.className);
|
336
|
+
return types_1.NeverType.createNever();
|
337
|
+
}
|
338
|
+
return evaluator.mapSubtypesExpandTypeVars(exprType,
|
339
|
+
/* conditionFilter */ undefined, (expandedSubtype, unexpandedSubtype) => {
|
340
|
+
if ((0, types_1.isAnyOrUnknown)(expandedSubtype)) {
|
341
|
+
return unexpandedSubtype;
|
342
|
+
}
|
343
|
+
if ((0, types_1.isInstantiableClass)(expandedSubtype)) {
|
344
|
+
return evaluator.mapSubtypesExpandTypeVars(type,
|
345
|
+
/* conditionFilter */ undefined, (subjectSubtypeExpanded) => {
|
346
|
+
if ((0, types_1.isAnyOrUnknown)(subjectSubtypeExpanded)) {
|
347
|
+
return (0, typeUtils_1.convertToInstance)(unexpandedSubtype);
|
348
|
+
}
|
349
|
+
if ((0, types_1.isClassInstance)(subjectSubtypeExpanded)) {
|
350
|
+
let resultType;
|
351
|
+
if (evaluator.assignType(expandedSubtype, types_1.ClassType.cloneAsInstantiable(subjectSubtypeExpanded))) {
|
352
|
+
resultType = subjectSubtypeExpanded;
|
353
|
+
}
|
354
|
+
else if (evaluator.assignType(types_1.ClassType.cloneAsInstantiable(subjectSubtypeExpanded), expandedSubtype)) {
|
355
|
+
resultType = (0, typeUtils_1.addConditionToType)((0, typeUtils_1.convertToInstance)(unexpandedSubtype), (0, typeUtils_1.getTypeCondition)(subjectSubtypeExpanded));
|
356
|
+
// Try to retain the type arguments for the pattern class type.
|
357
|
+
if ((0, types_1.isInstantiableClass)(unexpandedSubtype) && (0, types_1.isClassInstance)(subjectSubtypeExpanded)) {
|
358
|
+
if (types_1.ClassType.isSpecialBuiltIn(unexpandedSubtype) ||
|
359
|
+
unexpandedSubtype.details.typeParameters.length > 0) {
|
360
|
+
const typeVarContext = new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(unexpandedSubtype));
|
361
|
+
const unspecializedMatchType = types_1.ClassType.cloneForSpecialization(unexpandedSubtype,
|
362
|
+
/* typeArguments */ undefined,
|
363
|
+
/* isTypeArgumentExplicit */ false);
|
364
|
+
const matchTypeInstance = types_1.ClassType.cloneAsInstance(unspecializedMatchType);
|
365
|
+
if ((0, constraintSolver_1.populateTypeVarContextBasedOnExpectedType)(evaluator, matchTypeInstance, subjectSubtypeExpanded, typeVarContext, [])) {
|
366
|
+
resultType = (0, typeUtils_1.applySolvedTypeVars)(matchTypeInstance, typeVarContext,
|
367
|
+
/* unknownIfNotFound */ true);
|
368
|
+
}
|
369
|
+
}
|
370
|
+
}
|
371
|
+
}
|
372
|
+
else {
|
373
|
+
return undefined;
|
374
|
+
}
|
375
|
+
// Are there any positional arguments? If so, try to get the mappings for
|
376
|
+
// these arguments by fetching the __match_args__ symbol from the class.
|
377
|
+
let positionalArgNames = [];
|
378
|
+
if (pattern.arguments.some((arg) => !arg.name)) {
|
379
|
+
positionalArgNames = getPositionalMatchArgNames(evaluator, expandedSubtype);
|
380
|
+
}
|
381
|
+
let isMatchValid = true;
|
382
|
+
pattern.arguments.forEach((arg, index) => {
|
383
|
+
// Narrow the arg pattern. It's possible that the actual type of the object
|
384
|
+
// being matched is a subtype of the resultType, so it might contain additional
|
385
|
+
// attributes that we don't know about.
|
386
|
+
const narrowedArgType = narrowTypeOfClassPatternArgument(evaluator, arg, index, positionalArgNames, resultType, isPositiveTest);
|
387
|
+
if ((0, types_1.isNever)(narrowedArgType)) {
|
388
|
+
isMatchValid = false;
|
389
|
+
}
|
390
|
+
});
|
391
|
+
if (isMatchValid) {
|
392
|
+
return resultType;
|
393
|
+
}
|
394
|
+
}
|
395
|
+
return undefined;
|
396
|
+
});
|
397
|
+
}
|
398
|
+
return undefined;
|
399
|
+
});
|
400
|
+
}
|
401
|
+
// Narrows the pattern provided for a class pattern argument.
|
402
|
+
function narrowTypeOfClassPatternArgument(evaluator, arg, argIndex, positionalArgNames, matchType, isPositiveTest) {
|
403
|
+
var _a;
|
404
|
+
let argName;
|
405
|
+
if (arg.name) {
|
406
|
+
argName = arg.name.value;
|
407
|
+
}
|
408
|
+
else if (argIndex < positionalArgNames.length) {
|
409
|
+
argName = positionalArgNames[argIndex];
|
410
|
+
}
|
411
|
+
if ((0, types_1.isAnyOrUnknown)(matchType)) {
|
412
|
+
return matchType;
|
413
|
+
}
|
414
|
+
if (!(0, types_1.isClass)(matchType)) {
|
415
|
+
return types_1.UnknownType.create();
|
416
|
+
}
|
417
|
+
const useSelfForPattern = (0, types_1.isClass)(matchType) &&
|
418
|
+
classPatternSpecialCases.some((className) => matchType.details.fullName === className) &&
|
419
|
+
argIndex === 0 &&
|
420
|
+
!arg.name;
|
421
|
+
let argType;
|
422
|
+
if (useSelfForPattern) {
|
423
|
+
argType = types_1.ClassType.cloneAsInstance(matchType);
|
424
|
+
}
|
425
|
+
else {
|
426
|
+
if (argName) {
|
427
|
+
argType = (_a = evaluator.useSpeculativeMode(arg, () =>
|
428
|
+
// We need to apply a rather ugly cast here because PatternClassArgumentNode is
|
429
|
+
// not technically an ExpressionNode, but it is OK to use it in this context.
|
430
|
+
evaluator.getTypeOfObjectMember(arg, types_1.ClassType.cloneAsInstance(matchType), argName))) === null || _a === void 0 ? void 0 : _a.type;
|
431
|
+
}
|
432
|
+
if (!argType) {
|
433
|
+
if (!isPositiveTest) {
|
434
|
+
return matchType;
|
435
|
+
}
|
436
|
+
// If the class type in question is "final", we know that no additional
|
437
|
+
// attributes can be added by subtypes, so it's safe to eliminate this
|
438
|
+
// type entirely.
|
439
|
+
if (types_1.ClassType.isFinal(matchType)) {
|
440
|
+
return types_1.NeverType.createNever();
|
441
|
+
}
|
442
|
+
argType = types_1.UnknownType.create();
|
443
|
+
}
|
444
|
+
}
|
445
|
+
return narrowTypeBasedOnPattern(evaluator, argType, arg.pattern, isPositiveTest);
|
446
|
+
}
|
447
|
+
function narrowTypeBasedOnValuePattern(evaluator, subjectType, pattern, isPositiveTest) {
|
448
|
+
const valueType = evaluator.getTypeOfExpression(pattern.expression).type;
|
449
|
+
const narrowedSubtypes = [];
|
450
|
+
evaluator.mapSubtypesExpandTypeVars(valueType,
|
451
|
+
/* conditionFilter */ undefined, (valueSubtypeExpanded, valueSubtypeUnexpanded) => {
|
452
|
+
narrowedSubtypes.push(evaluator.mapSubtypesExpandTypeVars(subjectType, (0, typeUtils_1.getTypeCondition)(valueSubtypeExpanded), (subjectSubtypeExpanded) => {
|
453
|
+
// If this is a negative test, see if it's an enum value.
|
454
|
+
if (!isPositiveTest) {
|
455
|
+
if ((0, types_1.isClassInstance)(subjectSubtypeExpanded) &&
|
456
|
+
types_1.ClassType.isEnumClass(subjectSubtypeExpanded) &&
|
457
|
+
!(0, typeUtils_1.isLiteralType)(subjectSubtypeExpanded) &&
|
458
|
+
(0, types_1.isClassInstance)(valueSubtypeExpanded) &&
|
459
|
+
(0, types_1.isSameWithoutLiteralValue)(subjectSubtypeExpanded, valueSubtypeExpanded) &&
|
460
|
+
(0, typeUtils_1.isLiteralType)(valueSubtypeExpanded)) {
|
461
|
+
const allEnumTypes = (0, typeGuards_1.enumerateLiteralsForType)(evaluator, subjectSubtypeExpanded);
|
462
|
+
if (allEnumTypes) {
|
463
|
+
return (0, types_1.combineTypes)(allEnumTypes.filter((enumType) => !types_1.ClassType.isLiteralValueSame(valueSubtypeExpanded, enumType)));
|
464
|
+
}
|
465
|
+
}
|
466
|
+
else if ((0, types_1.isClassInstance)(subjectSubtypeExpanded) &&
|
467
|
+
(0, types_1.isClassInstance)(valueSubtypeExpanded) &&
|
468
|
+
types_1.ClassType.isLiteralValueSame(valueSubtypeExpanded, subjectSubtypeExpanded)) {
|
469
|
+
return undefined;
|
470
|
+
}
|
471
|
+
return subjectSubtypeExpanded;
|
472
|
+
}
|
473
|
+
if ((0, types_1.isNever)(valueSubtypeExpanded) || (0, types_1.isNever)(subjectSubtypeExpanded)) {
|
474
|
+
return types_1.NeverType.createNever();
|
475
|
+
}
|
476
|
+
if ((0, types_1.isAnyOrUnknown)(valueSubtypeExpanded) || (0, types_1.isAnyOrUnknown)(subjectSubtypeExpanded)) {
|
477
|
+
// If either type is "Unknown" (versus Any), propagate the Unknown.
|
478
|
+
return (0, types_1.isUnknown)(valueSubtypeExpanded) || (0, types_1.isUnknown)(subjectSubtypeExpanded)
|
479
|
+
? types_1.UnknownType.create()
|
480
|
+
: types_1.AnyType.create();
|
481
|
+
}
|
482
|
+
// Determine if we assignment is supported for this combination of
|
483
|
+
// value subtype and matching subtype.
|
484
|
+
const returnType = evaluator.useSpeculativeMode(pattern.expression, () => evaluator.getTypeOfMagicMethodReturn(valueSubtypeExpanded, [subjectSubtypeExpanded], '__eq__', pattern.expression,
|
485
|
+
/* expectedType */ undefined));
|
486
|
+
return returnType ? valueSubtypeUnexpanded : undefined;
|
487
|
+
}));
|
488
|
+
return undefined;
|
489
|
+
});
|
490
|
+
return (0, types_1.combineTypes)(narrowedSubtypes);
|
491
|
+
}
|
492
|
+
// Returns information about all subtypes that match the definition of a "mapping" as
|
493
|
+
// specified in PEP 634.
|
494
|
+
function getMappingPatternInfo(evaluator, type) {
|
495
|
+
const mappingInfo = [];
|
496
|
+
(0, typeUtils_1.doForEachSubtype)(type, (subtype) => {
|
497
|
+
const concreteSubtype = evaluator.makeTopLevelTypeVarsConcrete(subtype);
|
498
|
+
if ((0, types_1.isAnyOrUnknown)(concreteSubtype)) {
|
499
|
+
mappingInfo.push({
|
500
|
+
subtype,
|
501
|
+
dictTypeArgs: {
|
502
|
+
key: concreteSubtype,
|
503
|
+
value: concreteSubtype,
|
504
|
+
},
|
505
|
+
});
|
506
|
+
}
|
507
|
+
else if ((0, types_1.isClassInstance)(concreteSubtype)) {
|
508
|
+
if (types_1.ClassType.isTypedDictClass(concreteSubtype)) {
|
509
|
+
mappingInfo.push({
|
510
|
+
subtype,
|
511
|
+
typedDict: concreteSubtype,
|
512
|
+
});
|
513
|
+
}
|
514
|
+
else {
|
515
|
+
let mroClassToSpecialize;
|
516
|
+
for (const mroClass of concreteSubtype.details.mro) {
|
517
|
+
if ((0, types_1.isInstantiableClass)(mroClass) && types_1.ClassType.isBuiltIn(mroClass, 'Mapping')) {
|
518
|
+
mroClassToSpecialize = mroClass;
|
519
|
+
break;
|
520
|
+
}
|
521
|
+
}
|
522
|
+
if (mroClassToSpecialize) {
|
523
|
+
const specializedMapping = (0, typeUtils_1.partiallySpecializeType)(mroClassToSpecialize, concreteSubtype);
|
524
|
+
if (specializedMapping.typeArguments && specializedMapping.typeArguments.length >= 2) {
|
525
|
+
mappingInfo.push({
|
526
|
+
subtype,
|
527
|
+
dictTypeArgs: {
|
528
|
+
key: specializedMapping.typeArguments[0],
|
529
|
+
value: specializedMapping.typeArguments[1],
|
530
|
+
},
|
531
|
+
});
|
532
|
+
}
|
533
|
+
}
|
534
|
+
}
|
535
|
+
}
|
536
|
+
});
|
537
|
+
return mappingInfo;
|
538
|
+
}
|
539
|
+
// Returns information about all subtypes that match the definition of a "sequence" as
|
540
|
+
// specified in PEP 634. For types that are not sequences or sequences that are not of
|
541
|
+
// sufficient length, it sets definiteNoMatch to true.
|
542
|
+
function getSequencePatternInfo(evaluator, type, entryCount, starEntryIndex) {
|
543
|
+
const sequenceInfo = [];
|
544
|
+
const minEntryCount = starEntryIndex === undefined ? entryCount : entryCount - 1;
|
545
|
+
(0, typeUtils_1.doForEachSubtype)(type, (subtype) => {
|
546
|
+
const concreteSubtype = evaluator.makeTopLevelTypeVarsConcrete(subtype);
|
547
|
+
let mroClassToSpecialize;
|
548
|
+
let pushedEntry = false;
|
549
|
+
if ((0, types_1.isAnyOrUnknown)(concreteSubtype)) {
|
550
|
+
sequenceInfo.push({
|
551
|
+
subtype,
|
552
|
+
entryTypes: [concreteSubtype],
|
553
|
+
isIndeterminateLength: true,
|
554
|
+
definiteNoMatch: false,
|
555
|
+
});
|
556
|
+
return;
|
557
|
+
}
|
558
|
+
if ((0, types_1.isClassInstance)(concreteSubtype)) {
|
559
|
+
if (types_1.ClassType.isBuiltIn(concreteSubtype, 'object')) {
|
560
|
+
sequenceInfo.push({
|
561
|
+
subtype,
|
562
|
+
entryTypes: [(0, typeUtils_1.convertToInstance)(concreteSubtype)],
|
563
|
+
isIndeterminateLength: true,
|
564
|
+
isObject: true,
|
565
|
+
definiteNoMatch: false,
|
566
|
+
});
|
567
|
+
return;
|
568
|
+
}
|
569
|
+
for (const mroClass of concreteSubtype.details.mro) {
|
570
|
+
if (!(0, types_1.isInstantiableClass)(mroClass)) {
|
571
|
+
break;
|
572
|
+
}
|
573
|
+
// Strings, bytes, and bytearray are explicitly excluded.
|
574
|
+
if (types_1.ClassType.isBuiltIn(mroClass, 'str') ||
|
575
|
+
types_1.ClassType.isBuiltIn(mroClass, 'bytes') ||
|
576
|
+
types_1.ClassType.isBuiltIn(mroClass, 'bytearray')) {
|
577
|
+
break;
|
578
|
+
}
|
579
|
+
if (types_1.ClassType.isBuiltIn(mroClass, 'Sequence')) {
|
580
|
+
mroClassToSpecialize = mroClass;
|
581
|
+
break;
|
582
|
+
}
|
583
|
+
if ((0, typeUtils_1.isTupleClass)(mroClass)) {
|
584
|
+
mroClassToSpecialize = mroClass;
|
585
|
+
break;
|
586
|
+
}
|
587
|
+
}
|
588
|
+
if (mroClassToSpecialize) {
|
589
|
+
const specializedSequence = (0, typeUtils_1.partiallySpecializeType)(mroClassToSpecialize, concreteSubtype);
|
590
|
+
if ((0, typeUtils_1.isTupleClass)(specializedSequence)) {
|
591
|
+
if (specializedSequence.tupleTypeArguments) {
|
592
|
+
if ((0, typeUtils_1.isUnboundedTupleClass)(specializedSequence)) {
|
593
|
+
sequenceInfo.push({
|
594
|
+
subtype,
|
595
|
+
entryTypes: [(0, types_1.combineTypes)(specializedSequence.tupleTypeArguments.map((t) => t.type))],
|
596
|
+
isIndeterminateLength: true,
|
597
|
+
isTuple: true,
|
598
|
+
definiteNoMatch: false,
|
599
|
+
});
|
600
|
+
pushedEntry = true;
|
601
|
+
}
|
602
|
+
else {
|
603
|
+
if (specializedSequence.tupleTypeArguments.length >= minEntryCount &&
|
604
|
+
(starEntryIndex !== undefined ||
|
605
|
+
specializedSequence.tupleTypeArguments.length === minEntryCount)) {
|
606
|
+
sequenceInfo.push({
|
607
|
+
subtype,
|
608
|
+
entryTypes: specializedSequence.tupleTypeArguments.map((t) => t.type),
|
609
|
+
isIndeterminateLength: false,
|
610
|
+
isTuple: true,
|
611
|
+
definiteNoMatch: false,
|
612
|
+
});
|
613
|
+
pushedEntry = true;
|
614
|
+
}
|
615
|
+
}
|
616
|
+
}
|
617
|
+
}
|
618
|
+
else {
|
619
|
+
sequenceInfo.push({
|
620
|
+
subtype,
|
621
|
+
entryTypes: [
|
622
|
+
specializedSequence.typeArguments && specializedSequence.typeArguments.length > 0
|
623
|
+
? specializedSequence.typeArguments[0]
|
624
|
+
: types_1.UnknownType.create(),
|
625
|
+
],
|
626
|
+
isIndeterminateLength: true,
|
627
|
+
definiteNoMatch: false,
|
628
|
+
});
|
629
|
+
pushedEntry = true;
|
630
|
+
}
|
631
|
+
}
|
632
|
+
}
|
633
|
+
// Push an entry that indicates that this is definitely not a match.
|
634
|
+
if (!pushedEntry) {
|
635
|
+
sequenceInfo.push({
|
636
|
+
subtype,
|
637
|
+
entryTypes: [],
|
638
|
+
isIndeterminateLength: true,
|
639
|
+
definiteNoMatch: true,
|
640
|
+
});
|
641
|
+
}
|
642
|
+
});
|
643
|
+
return sequenceInfo;
|
644
|
+
}
|
645
|
+
function getTypeOfPatternSequenceEntry(evaluator, node, sequenceInfo, entryIndex, entryCount, starEntryIndex, unpackStarEntry, isSubjectObject) {
|
646
|
+
if (sequenceInfo.isIndeterminateLength) {
|
647
|
+
let entryType = sequenceInfo.entryTypes[0];
|
648
|
+
// If the subject is typed as an "object", then the star entry
|
649
|
+
// is simply a list[object]. Without this special case, the list
|
650
|
+
// will be typed based on the union of all elements in the sequence.
|
651
|
+
if (isSubjectObject) {
|
652
|
+
const objectType = evaluator.getBuiltInObject(node, 'object');
|
653
|
+
if (objectType && (0, types_1.isClassInstance)(objectType)) {
|
654
|
+
entryType = objectType;
|
655
|
+
}
|
656
|
+
}
|
657
|
+
if (!unpackStarEntry && entryIndex === starEntryIndex && !(0, types_1.isNever)(entryType)) {
|
658
|
+
entryType = wrapTypeInList(evaluator, node, entryType);
|
659
|
+
}
|
660
|
+
return entryType;
|
661
|
+
}
|
662
|
+
if (starEntryIndex === undefined || entryIndex < starEntryIndex) {
|
663
|
+
return sequenceInfo.entryTypes[entryIndex];
|
664
|
+
}
|
665
|
+
if (entryIndex === starEntryIndex) {
|
666
|
+
// Create a list out of the entries that map to the star entry.
|
667
|
+
// Note that we strip literal types here.
|
668
|
+
const starEntryTypes = sequenceInfo.entryTypes
|
669
|
+
.slice(starEntryIndex, starEntryIndex + sequenceInfo.entryTypes.length - entryCount + 1)
|
670
|
+
.map((type) => (0, typeUtils_1.stripLiteralValue)(type));
|
671
|
+
let entryType = (0, types_1.combineTypes)(starEntryTypes);
|
672
|
+
if (!unpackStarEntry) {
|
673
|
+
entryType = wrapTypeInList(evaluator, node, entryType);
|
674
|
+
}
|
675
|
+
return entryType;
|
676
|
+
}
|
677
|
+
// The entry index is past the index of the star entry, so we need
|
678
|
+
// to index from the end of the sequence rather than the start.
|
679
|
+
const itemIndex = sequenceInfo.entryTypes.length - (entryCount - entryIndex);
|
680
|
+
(0, debug_1.assert)(itemIndex >= 0 && itemIndex < sequenceInfo.entryTypes.length);
|
681
|
+
return sequenceInfo.entryTypes[itemIndex];
|
682
|
+
}
|
683
|
+
// Recursively assigns the specified type to the pattern and any capture
|
684
|
+
// nodes within it
|
685
|
+
function assignTypeToPatternTargets(evaluator, type, isTypeIncomplete, isSubjectObject, pattern) {
|
686
|
+
// Further narrow the type based on this pattern.
|
687
|
+
type = narrowTypeBasedOnPattern(evaluator, type, pattern, /* positiveTest */ true);
|
688
|
+
switch (pattern.nodeType) {
|
689
|
+
case 65 /* PatternSequence */: {
|
690
|
+
const sequenceInfo = getSequencePatternInfo(evaluator, type, pattern.entries.length, pattern.starEntryIndex).filter((seqInfo) => !seqInfo.definiteNoMatch);
|
691
|
+
pattern.entries.forEach((entry, index) => {
|
692
|
+
const entryType = (0, types_1.combineTypes)(sequenceInfo.map((info) => getTypeOfPatternSequenceEntry(evaluator, pattern, info, index, pattern.entries.length, pattern.starEntryIndex,
|
693
|
+
/* unpackStarEntry */ false, isSubjectObject)));
|
694
|
+
assignTypeToPatternTargets(evaluator, entryType, isTypeIncomplete, /* isSubjectObject */ false, entry);
|
695
|
+
});
|
696
|
+
break;
|
697
|
+
}
|
698
|
+
case 66 /* PatternAs */: {
|
699
|
+
if (pattern.target) {
|
700
|
+
evaluator.assignTypeToExpression(pattern.target, type, isTypeIncomplete, pattern.target);
|
701
|
+
}
|
702
|
+
pattern.orPatterns.forEach((orPattern) => {
|
703
|
+
assignTypeToPatternTargets(evaluator, type, isTypeIncomplete, isSubjectObject, orPattern);
|
704
|
+
// OR patterns are evaluated left to right, so we can narrow
|
705
|
+
// the type as we go.
|
706
|
+
type = narrowTypeBasedOnPattern(evaluator, type, orPattern, /* positiveTest */ false);
|
707
|
+
});
|
708
|
+
break;
|
709
|
+
}
|
710
|
+
case 69 /* PatternCapture */: {
|
711
|
+
evaluator.assignTypeToExpression(pattern.target, pattern.isWildcard ? types_1.AnyType.create() : type, isTypeIncomplete, pattern.target);
|
712
|
+
break;
|
713
|
+
}
|
714
|
+
case 70 /* PatternMapping */: {
|
715
|
+
const mappingInfo = getMappingPatternInfo(evaluator, type);
|
716
|
+
pattern.entries.forEach((mappingEntry) => {
|
717
|
+
const keyTypes = [];
|
718
|
+
const valueTypes = [];
|
719
|
+
mappingInfo.forEach((mappingSubtypeInfo) => {
|
720
|
+
if (mappingSubtypeInfo.typedDict) {
|
721
|
+
if (mappingEntry.nodeType === 71 /* PatternMappingKeyEntry */) {
|
722
|
+
const keyType = narrowTypeBasedOnPattern(evaluator, evaluator.getBuiltInObject(pattern, 'str'), mappingEntry.keyPattern,
|
723
|
+
/* isPositiveTest */ true);
|
724
|
+
keyTypes.push(keyType);
|
725
|
+
(0, typeUtils_1.doForEachSubtype)(keyType, (keySubtype) => {
|
726
|
+
if ((0, types_1.isClassInstance)(keySubtype) &&
|
727
|
+
types_1.ClassType.isBuiltIn(keySubtype, 'str') &&
|
728
|
+
(0, typeUtils_1.isLiteralType)(keySubtype)) {
|
729
|
+
const tdEntries = (0, typedDicts_1.getTypedDictMembersForClass)(evaluator, mappingSubtypeInfo.typedDict);
|
730
|
+
const valueInfo = tdEntries.get(keySubtype.literalValue);
|
731
|
+
valueTypes.push(valueInfo ? valueInfo.valueType : types_1.UnknownType.create());
|
732
|
+
}
|
733
|
+
else {
|
734
|
+
valueTypes.push(types_1.UnknownType.create());
|
735
|
+
}
|
736
|
+
});
|
737
|
+
}
|
738
|
+
else if (mappingEntry.nodeType === 72 /* PatternMappingExpandEntry */) {
|
739
|
+
keyTypes.push(evaluator.getBuiltInObject(pattern, 'str'));
|
740
|
+
valueTypes.push(types_1.UnknownType.create());
|
741
|
+
}
|
742
|
+
}
|
743
|
+
else if (mappingSubtypeInfo.dictTypeArgs) {
|
744
|
+
if (mappingEntry.nodeType === 71 /* PatternMappingKeyEntry */) {
|
745
|
+
const keyType = narrowTypeBasedOnPattern(evaluator, mappingSubtypeInfo.dictTypeArgs.key, mappingEntry.keyPattern,
|
746
|
+
/* isPositiveTest */ true);
|
747
|
+
keyTypes.push(keyType);
|
748
|
+
valueTypes.push(narrowTypeBasedOnPattern(evaluator, mappingSubtypeInfo.dictTypeArgs.value, mappingEntry.valuePattern,
|
749
|
+
/* isPositiveTest */ true));
|
750
|
+
}
|
751
|
+
else if (mappingEntry.nodeType === 72 /* PatternMappingExpandEntry */) {
|
752
|
+
keyTypes.push(mappingSubtypeInfo.dictTypeArgs.key);
|
753
|
+
valueTypes.push(mappingSubtypeInfo.dictTypeArgs.value);
|
754
|
+
}
|
755
|
+
}
|
756
|
+
});
|
757
|
+
const keyType = (0, types_1.combineTypes)(keyTypes);
|
758
|
+
const valueType = (0, types_1.combineTypes)(valueTypes);
|
759
|
+
if (mappingEntry.nodeType === 71 /* PatternMappingKeyEntry */) {
|
760
|
+
assignTypeToPatternTargets(evaluator, keyType, isTypeIncomplete,
|
761
|
+
/* isSubjectObject */ false, mappingEntry.keyPattern);
|
762
|
+
assignTypeToPatternTargets(evaluator, valueType, isTypeIncomplete,
|
763
|
+
/* isSubjectObject */ false, mappingEntry.valuePattern);
|
764
|
+
}
|
765
|
+
else if (mappingEntry.nodeType === 72 /* PatternMappingExpandEntry */) {
|
766
|
+
const dictClass = evaluator.getBuiltInType(pattern, 'dict');
|
767
|
+
const strType = evaluator.getBuiltInObject(pattern, 'str');
|
768
|
+
const dictType = dictClass && (0, types_1.isInstantiableClass)(dictClass) && (0, types_1.isClassInstance)(strType)
|
769
|
+
? types_1.ClassType.cloneAsInstance(types_1.ClassType.cloneForSpecialization(dictClass, [keyType, valueType],
|
770
|
+
/* isTypeArgumentExplicit */ true))
|
771
|
+
: types_1.UnknownType.create();
|
772
|
+
evaluator.assignTypeToExpression(mappingEntry.target, dictType, isTypeIncomplete, mappingEntry.target);
|
773
|
+
}
|
774
|
+
});
|
775
|
+
break;
|
776
|
+
}
|
777
|
+
case 68 /* PatternClass */: {
|
778
|
+
const argTypes = pattern.arguments.map((arg) => []);
|
779
|
+
evaluator.mapSubtypesExpandTypeVars(type, /* conditionFilter */ undefined, (expandedSubtype) => {
|
780
|
+
if ((0, types_1.isClassInstance)(expandedSubtype)) {
|
781
|
+
(0, typeUtils_1.doForEachSubtype)(type, (subjectSubtype) => {
|
782
|
+
const concreteSubtype = evaluator.makeTopLevelTypeVarsConcrete(subjectSubtype);
|
783
|
+
if ((0, types_1.isAnyOrUnknown)(concreteSubtype)) {
|
784
|
+
pattern.arguments.forEach((arg, index) => {
|
785
|
+
argTypes[index].push(concreteSubtype);
|
786
|
+
});
|
787
|
+
}
|
788
|
+
else if ((0, types_1.isClassInstance)(concreteSubtype)) {
|
789
|
+
// Are there any positional arguments? If so, try to get the mappings for
|
790
|
+
// these arguments by fetching the __match_args__ symbol from the class.
|
791
|
+
let positionalArgNames = [];
|
792
|
+
if (pattern.arguments.some((arg) => !arg.name)) {
|
793
|
+
positionalArgNames = getPositionalMatchArgNames(evaluator, types_1.ClassType.cloneAsInstantiable(expandedSubtype));
|
794
|
+
}
|
795
|
+
pattern.arguments.forEach((arg, index) => {
|
796
|
+
const narrowedArgType = narrowTypeOfClassPatternArgument(evaluator, arg, index, positionalArgNames, types_1.ClassType.cloneAsInstantiable(expandedSubtype),
|
797
|
+
/* isPositiveTest */ true);
|
798
|
+
argTypes[index].push(narrowedArgType);
|
799
|
+
});
|
800
|
+
}
|
801
|
+
});
|
802
|
+
}
|
803
|
+
else {
|
804
|
+
pattern.arguments.forEach((arg, index) => {
|
805
|
+
argTypes[index].push(types_1.UnknownType.create());
|
806
|
+
});
|
807
|
+
}
|
808
|
+
return undefined;
|
809
|
+
});
|
810
|
+
pattern.arguments.forEach((arg, index) => {
|
811
|
+
assignTypeToPatternTargets(evaluator, (0, types_1.combineTypes)(argTypes[index]), isTypeIncomplete,
|
812
|
+
/* isSubjectObject */ false, arg.pattern);
|
813
|
+
});
|
814
|
+
break;
|
815
|
+
}
|
816
|
+
case 67 /* PatternLiteral */:
|
817
|
+
case 73 /* PatternValue */:
|
818
|
+
case 0 /* Error */: {
|
819
|
+
// Nothing to do here.
|
820
|
+
break;
|
821
|
+
}
|
822
|
+
}
|
823
|
+
}
|
824
|
+
exports.assignTypeToPatternTargets = assignTypeToPatternTargets;
|
825
|
+
function wrapTypeInList(evaluator, node, type) {
|
826
|
+
if ((0, types_1.isNever)(type)) {
|
827
|
+
return type;
|
828
|
+
}
|
829
|
+
const listObjectType = (0, typeUtils_1.convertToInstance)(evaluator.getBuiltInObject(node, 'list'));
|
830
|
+
if (listObjectType && (0, types_1.isClassInstance)(listObjectType)) {
|
831
|
+
return types_1.ClassType.cloneForSpecialization(listObjectType, [type], /* isTypeArgumentExplicit */ true);
|
832
|
+
}
|
833
|
+
return types_1.UnknownType.create();
|
834
|
+
}
|
835
|
+
function validateClassPattern(evaluator, pattern) {
|
836
|
+
const exprType = evaluator.getTypeOfExpression(pattern.className, 2 /* DoNotSpecialize */).type;
|
837
|
+
if ((0, types_1.isAnyOrUnknown)(exprType)) {
|
838
|
+
return;
|
839
|
+
}
|
840
|
+
// Check for certain uses of type aliases that generate runtime exceptions.
|
841
|
+
if (exprType.typeAliasInfo &&
|
842
|
+
(0, types_1.isInstantiableClass)(exprType) &&
|
843
|
+
exprType.typeArguments &&
|
844
|
+
exprType.isTypeArgumentExplicit) {
|
845
|
+
evaluator.addDiagnostic((0, analyzerNodeInfo_1.getFileInfo)(pattern).diagnosticRuleSet.reportGeneralTypeIssues, diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.Localizer.Diagnostic.classPatternTypeAlias().format({ type: evaluator.printType(exprType) }), pattern.className);
|
846
|
+
}
|
847
|
+
else if (!(0, types_1.isInstantiableClass)(exprType)) {
|
848
|
+
if (!(0, types_1.isNever)(exprType)) {
|
849
|
+
evaluator.addDiagnostic((0, analyzerNodeInfo_1.getFileInfo)(pattern).diagnosticRuleSet.reportGeneralTypeIssues, diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.Localizer.DiagnosticAddendum.typeNotClass().format({ type: evaluator.printType(exprType) }), pattern.className);
|
850
|
+
}
|
851
|
+
}
|
852
|
+
else {
|
853
|
+
const isBuiltIn = classPatternSpecialCases.some((className) => exprType.details.fullName === className);
|
854
|
+
// If it's a special-case builtin class, only one positional argument is allowed.
|
855
|
+
if (isBuiltIn) {
|
856
|
+
if (pattern.arguments.length > 1) {
|
857
|
+
evaluator.addDiagnostic((0, analyzerNodeInfo_1.getFileInfo)(pattern).diagnosticRuleSet.reportGeneralTypeIssues, diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.Localizer.Diagnostic.classPatternBuiltInArgCount(), pattern.arguments[1]);
|
858
|
+
}
|
859
|
+
else if (pattern.arguments.length === 1 && pattern.arguments[0].name) {
|
860
|
+
evaluator.addDiagnostic((0, analyzerNodeInfo_1.getFileInfo)(pattern).diagnosticRuleSet.reportGeneralTypeIssues, diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.Localizer.Diagnostic.classPatternBuiltInArgPositional(), pattern.arguments[0].name);
|
861
|
+
}
|
862
|
+
}
|
863
|
+
}
|
864
|
+
}
|
865
|
+
exports.validateClassPattern = validateClassPattern;
|
866
|
+
//# sourceMappingURL=patternMatching.js.map
|