@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,1381 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* testState.ts
|
4
|
+
* Copyright (c) Microsoft Corporation.
|
5
|
+
* Licensed under the MIT license.
|
6
|
+
*
|
7
|
+
* TestState wraps currently test states and provides a way to query and manipulate
|
8
|
+
* the test states.
|
9
|
+
*/
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
11
|
+
if (k2 === undefined) k2 = k;
|
12
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
13
|
+
}) : (function(o, m, k, k2) {
|
14
|
+
if (k2 === undefined) k2 = k;
|
15
|
+
o[k2] = m[k];
|
16
|
+
}));
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
19
|
+
}) : function(o, v) {
|
20
|
+
o["default"] = v;
|
21
|
+
});
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
23
|
+
if (mod && mod.__esModule) return mod;
|
24
|
+
var result = {};
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
26
|
+
__setModuleDefault(result, mod);
|
27
|
+
return result;
|
28
|
+
};
|
29
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
30
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
31
|
+
};
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
33
|
+
exports.getNodeAtMarker = exports.getNodeForRange = exports.parseAndGetTestState = exports.TestState = void 0;
|
34
|
+
const assert_1 = __importDefault(require("assert"));
|
35
|
+
const JSONC = __importStar(require("jsonc-parser"));
|
36
|
+
const vscode_languageserver_1 = require("vscode-languageserver");
|
37
|
+
const parseTreeUtils_1 = require("../../../analyzer/parseTreeUtils");
|
38
|
+
const service_1 = require("../../../analyzer/service");
|
39
|
+
const collectionUtils_1 = require("../../../common/collectionUtils");
|
40
|
+
const configOptions_1 = require("../../../common/configOptions");
|
41
|
+
const console_1 = require("../../../common/console");
|
42
|
+
const core_1 = require("../../../common/core");
|
43
|
+
const debug = __importStar(require("../../../common/debug"));
|
44
|
+
const deferred_1 = require("../../../common/deferred");
|
45
|
+
const pathUtils_1 = require("../../../common/pathUtils");
|
46
|
+
const positionUtils_1 = require("../../../common/positionUtils");
|
47
|
+
const stringUtils_1 = require("../../../common/stringUtils");
|
48
|
+
const textRange_1 = require("../../../common/textRange");
|
49
|
+
const definitionProvider_1 = require("../../../languageService/definitionProvider");
|
50
|
+
const hoverProvider_1 = require("../../../languageService/hoverProvider");
|
51
|
+
const tokenizer_1 = require("../../../parser/tokenizer");
|
52
|
+
const pyrightFileSystem_1 = require("../../../pyrightFileSystem");
|
53
|
+
const testAccessHost_1 = require("../testAccessHost");
|
54
|
+
const host = __importStar(require("../testHost"));
|
55
|
+
const utils_1 = require("../utils");
|
56
|
+
const factory_1 = require("../vfs/factory");
|
57
|
+
const vfs = __importStar(require("../vfs/filesystem"));
|
58
|
+
const fourSlashParser_1 = require("./fourSlashParser");
|
59
|
+
const fourSlashTypes_1 = require("./fourSlashTypes");
|
60
|
+
const testLanguageService_1 = require("./testLanguageService");
|
61
|
+
const testAccessHost = new testAccessHost_1.TestAccessHost(vfs.MODULE_PATH, [factory_1.libFolder, factory_1.distlibFolder]);
|
62
|
+
class TestState {
|
63
|
+
constructor(basePath, testData, mountPaths, hostSpecificFeatures) {
|
64
|
+
var _a, _b;
|
65
|
+
this.testData = testData;
|
66
|
+
this._files = [];
|
67
|
+
// The current caret position in the active file
|
68
|
+
this.currentCaretPosition = 0;
|
69
|
+
// The position of the end of the current selection, or -1 if nothing is selected
|
70
|
+
this.selectionEnd = -1;
|
71
|
+
this.lastKnownMarker = '';
|
72
|
+
this._hostSpecificFeatures = hostSpecificFeatures !== null && hostSpecificFeatures !== void 0 ? hostSpecificFeatures : new testLanguageService_1.TestFeatures();
|
73
|
+
const nullConsole = new console_1.NullConsole();
|
74
|
+
const ignoreCase = (0, core_1.toBoolean)(testData.globalOptions["ignorecase" /* ignoreCase */]);
|
75
|
+
this._cancellationToken = new fourSlashTypes_1.TestCancellationToken();
|
76
|
+
const sourceFiles = [];
|
77
|
+
const files = {};
|
78
|
+
for (const file of testData.files) {
|
79
|
+
// if one of file is configuration file, set config options from the given json
|
80
|
+
if (this._isConfig(file, ignoreCase)) {
|
81
|
+
try {
|
82
|
+
this.rawConfigJson = JSONC.parse(file.content);
|
83
|
+
}
|
84
|
+
catch (e) {
|
85
|
+
throw new Error(`Failed to parse test ${file.fileName}: ${e.message}`);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
else {
|
89
|
+
files[file.fileName] = new vfs.File(file.content, { meta: file.fileOptions, encoding: 'utf8' });
|
90
|
+
if (!(0, core_1.toBoolean)(file.fileOptions["library" /* library */])) {
|
91
|
+
sourceFiles.push(file.fileName);
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
this.console = nullConsole;
|
96
|
+
this.testFS = (0, factory_1.createFromFileSystem)(host.HOST, ignoreCase, { cwd: basePath, files, meta: testData.globalOptions }, mountPaths);
|
97
|
+
this.fs = new pyrightFileSystem_1.PyrightFileSystem(this.testFS);
|
98
|
+
this._files = sourceFiles;
|
99
|
+
const configOptions = this._convertGlobalOptionsToConfigOptions(this.testData.globalOptions, mountPaths);
|
100
|
+
if (this.rawConfigJson) {
|
101
|
+
configOptions.initializeFromJson(this.rawConfigJson, 'basic', nullConsole, this.fs, testAccessHost);
|
102
|
+
this._applyTestConfigOptions(configOptions);
|
103
|
+
}
|
104
|
+
const service = this._createAnalysisService(nullConsole, this._hostSpecificFeatures.importResolverFactory, configOptions);
|
105
|
+
this.workspace = {
|
106
|
+
workspaceName: 'test workspace',
|
107
|
+
rootPath: this.fs.getModulePath(),
|
108
|
+
rootUri: (0, pathUtils_1.convertPathToUri)(this.fs, this.fs.getModulePath()),
|
109
|
+
serviceInstance: service,
|
110
|
+
disableLanguageServices: false,
|
111
|
+
disableOrganizeImports: false,
|
112
|
+
isInitialized: (0, deferred_1.createDeferred)(),
|
113
|
+
searchPathsToWatch: [],
|
114
|
+
};
|
115
|
+
const indexer = (0, core_1.toBoolean)(testData.globalOptions["indexer" /* indexer */]);
|
116
|
+
const indexerWithoutStdLib = (0, core_1.toBoolean)(testData.globalOptions["indexerwithoutstdlib" /* indexerWithoutStdLib */]);
|
117
|
+
if (indexer || indexerWithoutStdLib) {
|
118
|
+
const indexerOptions = testData.globalOptions["indexeroptions" /* indexerOptions */];
|
119
|
+
configOptions.indexing = true;
|
120
|
+
this._hostSpecificFeatures.runIndexer(this.workspace, indexerWithoutStdLib, indexerOptions);
|
121
|
+
}
|
122
|
+
if (this._files.length > 0) {
|
123
|
+
// Open the first file by default
|
124
|
+
this.openFile(this._files[0]);
|
125
|
+
}
|
126
|
+
for (const filePath of this._files) {
|
127
|
+
const file = files[filePath];
|
128
|
+
if ((_a = file.meta) === null || _a === void 0 ? void 0 : _a["ipythonmode" /* ipythonMode */]) {
|
129
|
+
(_b = this.program.getSourceFile(filePath)) === null || _b === void 0 ? void 0 : _b.test_enableIPythonMode(true);
|
130
|
+
}
|
131
|
+
}
|
132
|
+
}
|
133
|
+
get importResolver() {
|
134
|
+
return this.workspace.serviceInstance.getImportResolver();
|
135
|
+
}
|
136
|
+
get configOptions() {
|
137
|
+
return this.workspace.serviceInstance.getConfigOptions();
|
138
|
+
}
|
139
|
+
get program() {
|
140
|
+
return this.workspace.serviceInstance.test_program;
|
141
|
+
}
|
142
|
+
cwd() {
|
143
|
+
return this.testFS.cwd();
|
144
|
+
}
|
145
|
+
// Entry points from fourslash.ts
|
146
|
+
goToMarker(nameOrMarker = '') {
|
147
|
+
const marker = (0, core_1.isString)(nameOrMarker) ? this.getMarkerByName(nameOrMarker) : nameOrMarker;
|
148
|
+
if (this.activeFile.fileName !== marker.fileName) {
|
149
|
+
this.openFile(marker.fileName);
|
150
|
+
}
|
151
|
+
const content = this._getFileContent(marker.fileName);
|
152
|
+
if (marker.position === -1 || marker.position > content.length) {
|
153
|
+
throw new Error(`Marker "${nameOrMarker}" has been invalidated by unrecoverable edits to the file.`);
|
154
|
+
}
|
155
|
+
const mName = (0, core_1.isString)(nameOrMarker) ? nameOrMarker : this.getMarkerName(marker);
|
156
|
+
this.lastKnownMarker = mName;
|
157
|
+
this.goToPosition(marker.position);
|
158
|
+
}
|
159
|
+
goToEachMarker(markers, action) {
|
160
|
+
assert_1.default.ok(markers.length > 0);
|
161
|
+
for (let i = 0; i < markers.length; i++) {
|
162
|
+
this.goToMarker(markers[i]);
|
163
|
+
action(markers[i], i);
|
164
|
+
}
|
165
|
+
}
|
166
|
+
getMappedFilePath(path) {
|
167
|
+
this.importResolver.ensurePartialStubPackages(this.configOptions.findExecEnvironment(path));
|
168
|
+
return this.fs.getMappedFilePath(path);
|
169
|
+
}
|
170
|
+
getMarkerName(m) {
|
171
|
+
let found;
|
172
|
+
this.testData.markerPositions.forEach((marker, name) => {
|
173
|
+
if (marker === m) {
|
174
|
+
found = name;
|
175
|
+
}
|
176
|
+
});
|
177
|
+
assert_1.default.ok(found);
|
178
|
+
return found;
|
179
|
+
}
|
180
|
+
getMarkerByName(markerName) {
|
181
|
+
const markerPos = this.testData.markerPositions.get(markerName);
|
182
|
+
if (markerPos === undefined) {
|
183
|
+
throw new Error(`Unknown marker "${markerName}" Available markers: ${this.getMarkerNames()
|
184
|
+
.map((m) => '"' + m + '"')
|
185
|
+
.join(', ')}`);
|
186
|
+
}
|
187
|
+
else {
|
188
|
+
return markerPos;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
getMarkers() {
|
192
|
+
// Return a copy of the list
|
193
|
+
return this.testData.markers.slice(0);
|
194
|
+
}
|
195
|
+
getMarkerNames() {
|
196
|
+
return [...this.testData.markerPositions.keys()];
|
197
|
+
}
|
198
|
+
getPositionRange(markerString) {
|
199
|
+
const marker = this.getMarkerByName(markerString);
|
200
|
+
const ranges = this.getRanges().filter((r) => r.marker === marker);
|
201
|
+
if (ranges.length !== 1) {
|
202
|
+
this.raiseError(`no matching range for ${markerString}`);
|
203
|
+
}
|
204
|
+
const range = ranges[0];
|
205
|
+
return this.convertPositionRange(range);
|
206
|
+
}
|
207
|
+
expandPositionRange(range, start, end) {
|
208
|
+
return {
|
209
|
+
start: { line: range.start.line, character: range.start.character - start },
|
210
|
+
end: { line: range.end.line, character: range.end.character + end },
|
211
|
+
};
|
212
|
+
}
|
213
|
+
convertPositionRange(range) {
|
214
|
+
return this.convertOffsetsToRange(range.fileName, range.pos, range.end);
|
215
|
+
}
|
216
|
+
convertPathToUri(path) {
|
217
|
+
return (0, pathUtils_1.convertPathToUri)(this.fs, path);
|
218
|
+
}
|
219
|
+
getDirectoryPath(path) {
|
220
|
+
return (0, pathUtils_1.getDirectoryPath)(path);
|
221
|
+
}
|
222
|
+
goToPosition(positionOrLineAndColumn) {
|
223
|
+
const pos = (0, core_1.isNumber)(positionOrLineAndColumn)
|
224
|
+
? positionOrLineAndColumn
|
225
|
+
: this.convertPositionToOffset(this.activeFile.fileName, positionOrLineAndColumn);
|
226
|
+
this.currentCaretPosition = pos;
|
227
|
+
this.selectionEnd = -1;
|
228
|
+
}
|
229
|
+
select(startMarker, endMarker) {
|
230
|
+
const start = this.getMarkerByName(startMarker);
|
231
|
+
const end = this.getMarkerByName(endMarker);
|
232
|
+
assert_1.default.ok(start.fileName === end.fileName);
|
233
|
+
if (this.activeFile.fileName !== start.fileName) {
|
234
|
+
this.openFile(start.fileName);
|
235
|
+
}
|
236
|
+
this.goToPosition(start.position);
|
237
|
+
this.selectionEnd = end.position;
|
238
|
+
}
|
239
|
+
selectAllInFile(fileName) {
|
240
|
+
this.openFile(fileName);
|
241
|
+
this.goToPosition(0);
|
242
|
+
this.selectionEnd = this.activeFile.content.length;
|
243
|
+
}
|
244
|
+
selectRange(range) {
|
245
|
+
this.goToRangeStart(range);
|
246
|
+
this.selectionEnd = range.end;
|
247
|
+
}
|
248
|
+
selectLine(index) {
|
249
|
+
const lineStart = this.convertPositionToOffset(this.activeFile.fileName, { line: index, character: 0 });
|
250
|
+
const lineEnd = lineStart + this._getLineContent(index).length;
|
251
|
+
this.selectRange({ fileName: this.activeFile.fileName, pos: lineStart, end: lineEnd });
|
252
|
+
}
|
253
|
+
goToEachRange(action) {
|
254
|
+
const ranges = this.getRanges();
|
255
|
+
assert_1.default.ok(ranges.length > 0);
|
256
|
+
for (const range of ranges) {
|
257
|
+
this.selectRange(range);
|
258
|
+
action(range);
|
259
|
+
}
|
260
|
+
}
|
261
|
+
goToRangeStart({ fileName, pos }) {
|
262
|
+
this.openFile(fileName);
|
263
|
+
this.goToPosition(pos);
|
264
|
+
}
|
265
|
+
getRanges() {
|
266
|
+
return this.testData.ranges;
|
267
|
+
}
|
268
|
+
getRangesInFile(fileName = this.activeFile.fileName) {
|
269
|
+
return this.getRanges().filter((r) => r.fileName === fileName);
|
270
|
+
}
|
271
|
+
getRangesByText() {
|
272
|
+
if (this.testData.rangesByText) {
|
273
|
+
return this.testData.rangesByText;
|
274
|
+
}
|
275
|
+
const result = this.createMultiMap(this.getRanges(), (r) => this._rangeText(r));
|
276
|
+
this.testData.rangesByText = result;
|
277
|
+
return result;
|
278
|
+
}
|
279
|
+
getFilteredRanges(predicate) {
|
280
|
+
return this.getRanges().filter((r) => { var _a; return predicate(r.marker, (_a = r.marker) === null || _a === void 0 ? void 0 : _a.data, this._rangeText(r)); });
|
281
|
+
}
|
282
|
+
getRangeByMarkerName(markerName) {
|
283
|
+
const marker = this.getMarkerByName(markerName);
|
284
|
+
return this.getRanges().find((r) => r.marker === marker);
|
285
|
+
}
|
286
|
+
goToBOF() {
|
287
|
+
this.goToPosition(0);
|
288
|
+
}
|
289
|
+
goToEOF() {
|
290
|
+
const len = this._getFileContent(this.activeFile.fileName).length;
|
291
|
+
this.goToPosition(len);
|
292
|
+
}
|
293
|
+
moveCaretRight(count = 1) {
|
294
|
+
this.currentCaretPosition += count;
|
295
|
+
this.currentCaretPosition = Math.min(this.currentCaretPosition, this._getFileContent(this.activeFile.fileName).length);
|
296
|
+
this.selectionEnd = -1;
|
297
|
+
}
|
298
|
+
// Opens a file given its 0-based index or fileName
|
299
|
+
openFile(indexOrName) {
|
300
|
+
const fileToOpen = this._findFile(indexOrName);
|
301
|
+
fileToOpen.fileName = (0, pathUtils_1.normalizeSlashes)(fileToOpen.fileName);
|
302
|
+
this.activeFile = fileToOpen;
|
303
|
+
this.program.setFileOpened(this.activeFile.fileName, 1, [{ text: fileToOpen.content }]);
|
304
|
+
}
|
305
|
+
openFiles(indexOrNames) {
|
306
|
+
for (const indexOrName of indexOrNames) {
|
307
|
+
this.openFile(indexOrName);
|
308
|
+
}
|
309
|
+
}
|
310
|
+
printCurrentFileState(showWhitespace, makeCaretVisible) {
|
311
|
+
for (const file of this.testData.files) {
|
312
|
+
const active = this.activeFile === file;
|
313
|
+
host.HOST.log(`=== Script (${file.fileName}) ${active ? '(active, cursor at |)' : ''} ===`);
|
314
|
+
let content = this._getFileContent(file.fileName);
|
315
|
+
if (active) {
|
316
|
+
content =
|
317
|
+
content.substr(0, this.currentCaretPosition) +
|
318
|
+
(makeCaretVisible ? '|' : '') +
|
319
|
+
content.substr(this.currentCaretPosition);
|
320
|
+
}
|
321
|
+
if (showWhitespace) {
|
322
|
+
content = this._makeWhitespaceVisible(content);
|
323
|
+
}
|
324
|
+
host.HOST.log(content);
|
325
|
+
}
|
326
|
+
}
|
327
|
+
deleteChar(count = 1) {
|
328
|
+
const offset = this.currentCaretPosition;
|
329
|
+
const ch = '';
|
330
|
+
const checkCadence = (count >> 2) + 1;
|
331
|
+
for (let i = 0; i < count; i++) {
|
332
|
+
this._editScriptAndUpdateMarkers(this.activeFile.fileName, offset, offset + 1, ch);
|
333
|
+
if (i % checkCadence === 0) {
|
334
|
+
this._checkPostEditInvariants();
|
335
|
+
}
|
336
|
+
}
|
337
|
+
this._checkPostEditInvariants();
|
338
|
+
}
|
339
|
+
replace(start, length, text) {
|
340
|
+
this._editScriptAndUpdateMarkers(this.activeFile.fileName, start, start + length, text);
|
341
|
+
this._checkPostEditInvariants();
|
342
|
+
}
|
343
|
+
deleteLineRange(startIndex, endIndexInclusive) {
|
344
|
+
const startPos = this.convertPositionToOffset(this.activeFile.fileName, { line: startIndex, character: 0 });
|
345
|
+
const endPos = this.convertPositionToOffset(this.activeFile.fileName, {
|
346
|
+
line: endIndexInclusive + 1,
|
347
|
+
character: 0,
|
348
|
+
});
|
349
|
+
this.replace(startPos, endPos - startPos, '');
|
350
|
+
}
|
351
|
+
deleteCharBehindMarker(count = 1) {
|
352
|
+
let offset = this.currentCaretPosition;
|
353
|
+
const ch = '';
|
354
|
+
const checkCadence = (count >> 2) + 1;
|
355
|
+
for (let i = 0; i < count; i++) {
|
356
|
+
this.currentCaretPosition--;
|
357
|
+
offset--;
|
358
|
+
this._editScriptAndUpdateMarkers(this.activeFile.fileName, offset, offset + 1, ch);
|
359
|
+
if (i % checkCadence === 0) {
|
360
|
+
this._checkPostEditInvariants();
|
361
|
+
}
|
362
|
+
// Don't need to examine formatting because there are no formatting changes on backspace.
|
363
|
+
}
|
364
|
+
this._checkPostEditInvariants();
|
365
|
+
}
|
366
|
+
// Enters lines of text at the current caret position
|
367
|
+
type(text) {
|
368
|
+
let offset = this.currentCaretPosition;
|
369
|
+
const selection = this._getSelection();
|
370
|
+
this.replace(selection.start, selection.length, '');
|
371
|
+
for (let i = 0; i < text.length; i++) {
|
372
|
+
const ch = text.charAt(i);
|
373
|
+
this._editScriptAndUpdateMarkers(this.activeFile.fileName, offset, offset, ch);
|
374
|
+
this.currentCaretPosition++;
|
375
|
+
offset++;
|
376
|
+
}
|
377
|
+
this._checkPostEditInvariants();
|
378
|
+
}
|
379
|
+
// Enters text as if the user had pasted it
|
380
|
+
paste(text) {
|
381
|
+
this._editScriptAndUpdateMarkers(this.activeFile.fileName, this.currentCaretPosition, this.currentCaretPosition, text);
|
382
|
+
this._checkPostEditInvariants();
|
383
|
+
}
|
384
|
+
verifyDiagnostics(map) {
|
385
|
+
this._analyze();
|
386
|
+
// organize things per file
|
387
|
+
const resultPerFile = this._getDiagnosticsPerFile();
|
388
|
+
const rangePerFile = this.createMultiMap(this.getRanges(), (r) => r.fileName);
|
389
|
+
if (!hasDiagnostics(resultPerFile) && rangePerFile.size === 0) {
|
390
|
+
// no errors and no error is expected. we are done
|
391
|
+
return;
|
392
|
+
}
|
393
|
+
for (const [file, ranges] of rangePerFile.entries()) {
|
394
|
+
const rangesPerCategory = this.createMultiMap(ranges, (r) => {
|
395
|
+
if (map) {
|
396
|
+
const name = this.getMarkerName(r.marker);
|
397
|
+
return map[name].category;
|
398
|
+
}
|
399
|
+
return r.marker.data.category;
|
400
|
+
});
|
401
|
+
if (!rangesPerCategory.has('error')) {
|
402
|
+
rangesPerCategory.set('error', []);
|
403
|
+
}
|
404
|
+
if (!rangesPerCategory.has('warning')) {
|
405
|
+
rangesPerCategory.set('warning', []);
|
406
|
+
}
|
407
|
+
if (!rangesPerCategory.has('information')) {
|
408
|
+
rangesPerCategory.set('information', []);
|
409
|
+
}
|
410
|
+
const result = resultPerFile.get(file);
|
411
|
+
resultPerFile.delete(file);
|
412
|
+
for (const [category, expected] of rangesPerCategory.entries()) {
|
413
|
+
const lines = result.parseResults.tokenizerOutput.lines;
|
414
|
+
const actual = category === 'error'
|
415
|
+
? result.errors
|
416
|
+
: category === 'warning'
|
417
|
+
? result.warnings
|
418
|
+
: category === 'information'
|
419
|
+
? result.information
|
420
|
+
: this.raiseError(`unexpected category ${category}`);
|
421
|
+
if (expected.length !== actual.length) {
|
422
|
+
this.raiseError(`contains unexpected result - expected: ${(0, utils_1.stringify)(expected)}, actual: ${(0, utils_1.stringify)(actual)}`);
|
423
|
+
}
|
424
|
+
for (const range of expected) {
|
425
|
+
const rangeSpan = textRange_1.TextRange.fromBounds(range.pos, range.end);
|
426
|
+
const matches = actual.filter((d) => {
|
427
|
+
const diagnosticSpan = textRange_1.TextRange.fromBounds((0, positionUtils_1.convertPositionToOffset)(d.range.start, lines), (0, positionUtils_1.convertPositionToOffset)(d.range.end, lines));
|
428
|
+
return this._deepEqual(diagnosticSpan, rangeSpan);
|
429
|
+
});
|
430
|
+
if (matches.length === 0) {
|
431
|
+
this.raiseError(`doesn't contain expected range: ${(0, utils_1.stringify)(range)}`);
|
432
|
+
}
|
433
|
+
// if map is provided, check message as well
|
434
|
+
if (map) {
|
435
|
+
const name = this.getMarkerName(range.marker);
|
436
|
+
const message = map[name].message;
|
437
|
+
if (matches.filter((d) => message === d.message).length !== 1) {
|
438
|
+
this.raiseError(`message doesn't match: ${message} of ${name} - ${(0, utils_1.stringify)(range)}, actual: ${(0, utils_1.stringify)(matches)}`);
|
439
|
+
}
|
440
|
+
}
|
441
|
+
}
|
442
|
+
}
|
443
|
+
}
|
444
|
+
if (hasDiagnostics(resultPerFile)) {
|
445
|
+
this.raiseError(`these diagnostics were unexpected: ${(0, utils_1.stringify)(resultPerFile)}`);
|
446
|
+
}
|
447
|
+
function hasDiagnostics(resultPerFile) {
|
448
|
+
for (const entry of resultPerFile.values()) {
|
449
|
+
if (entry.errors.length + entry.warnings.length > 0) {
|
450
|
+
return true;
|
451
|
+
}
|
452
|
+
}
|
453
|
+
return false;
|
454
|
+
}
|
455
|
+
}
|
456
|
+
async verifyCodeActions(map, verifyCodeActionCount) {
|
457
|
+
// make sure we don't use cache built from other tests
|
458
|
+
this.workspace.serviceInstance.invalidateAndForceReanalysis();
|
459
|
+
this._analyze();
|
460
|
+
for (const range of this.getRanges()) {
|
461
|
+
const name = this.getMarkerName(range.marker);
|
462
|
+
if (!map[name]) {
|
463
|
+
continue;
|
464
|
+
}
|
465
|
+
const codeActions = await this._getCodeActions(range);
|
466
|
+
if (verifyCodeActionCount) {
|
467
|
+
if (codeActions.length !== map[name].codeActions.length) {
|
468
|
+
this.raiseError(`doesn't contain expected result: ${(0, utils_1.stringify)(map[name])}, actual: ${(0, utils_1.stringify)(codeActions)}`);
|
469
|
+
}
|
470
|
+
}
|
471
|
+
for (const expected of map[name].codeActions) {
|
472
|
+
let expectedCommand;
|
473
|
+
if (expected.command) {
|
474
|
+
expectedCommand = {
|
475
|
+
title: expected.command.title,
|
476
|
+
command: expected.command.command,
|
477
|
+
arguments: convertToString(expected.command.arguments),
|
478
|
+
};
|
479
|
+
}
|
480
|
+
const matches = codeActions.filter((a) => {
|
481
|
+
const actualCommand = a.command
|
482
|
+
? {
|
483
|
+
title: a.command.title,
|
484
|
+
command: a.command.command,
|
485
|
+
arguments: convertToString(a.command.arguments),
|
486
|
+
}
|
487
|
+
: undefined;
|
488
|
+
const actualEdit = a.edit;
|
489
|
+
return (a.title === expected.title &&
|
490
|
+
a.kind === expected.kind &&
|
491
|
+
this._deepEqual(actualCommand, expectedCommand) &&
|
492
|
+
this._deepEqual(actualEdit, expected.edit));
|
493
|
+
});
|
494
|
+
if (matches.length !== 1) {
|
495
|
+
this.raiseError(`doesn't contain expected result: ${(0, utils_1.stringify)(expected)}, actual: ${(0, utils_1.stringify)(codeActions)}`);
|
496
|
+
}
|
497
|
+
}
|
498
|
+
}
|
499
|
+
function convertToString(args) {
|
500
|
+
return args === null || args === void 0 ? void 0 : args.map((a) => {
|
501
|
+
if ((0, core_1.isString)(a)) {
|
502
|
+
return (0, pathUtils_1.normalizeSlashes)(a);
|
503
|
+
}
|
504
|
+
return JSON.stringify(a);
|
505
|
+
});
|
506
|
+
}
|
507
|
+
}
|
508
|
+
async verifyCommand(command, files) {
|
509
|
+
this._analyze();
|
510
|
+
const commandResult = await this._hostSpecificFeatures.execute(new testLanguageService_1.TestLanguageService(this.workspace, this.console, this.fs), { command: command.command, arguments: command.arguments || [] }, vscode_languageserver_1.CancellationToken.None);
|
511
|
+
if (command.command === 'pyright.createtypestub') {
|
512
|
+
await this._verifyFiles(files);
|
513
|
+
}
|
514
|
+
else if (command.command === 'pyright.organizeimports') {
|
515
|
+
// Organize imports command can be used on only one file at a time,
|
516
|
+
// so there is no looping over "commandResult" or "files".
|
517
|
+
const workspaceEditResult = commandResult;
|
518
|
+
const uri = Object.keys(workspaceEditResult.changes)[0];
|
519
|
+
const textEdit = workspaceEditResult.changes[uri][0];
|
520
|
+
const actualText = textEdit.newText;
|
521
|
+
const expectedText = Object.values(files)[0];
|
522
|
+
if (actualText !== expectedText) {
|
523
|
+
this.raiseError(`doesn't contain expected result: ${(0, utils_1.stringify)(expectedText)}, actual: ${(0, utils_1.stringify)(actualText)}`);
|
524
|
+
}
|
525
|
+
}
|
526
|
+
return commandResult;
|
527
|
+
}
|
528
|
+
verifyWorkspaceEdit(expected, actual) {
|
529
|
+
if (actual.changes) {
|
530
|
+
this._verifyTextEditMap(expected.changes, actual.changes);
|
531
|
+
}
|
532
|
+
else {
|
533
|
+
(0, assert_1.default)(!expected.changes);
|
534
|
+
}
|
535
|
+
if (actual.documentChanges) {
|
536
|
+
this._verifyDocumentEdits(expected.documentChanges, actual.documentChanges);
|
537
|
+
}
|
538
|
+
else {
|
539
|
+
(0, assert_1.default)(!expected.documentChanges);
|
540
|
+
}
|
541
|
+
if (actual.changeAnnotations) {
|
542
|
+
this._verifyChangeAnnotations(expected.changeAnnotations, actual.changeAnnotations);
|
543
|
+
}
|
544
|
+
else {
|
545
|
+
(0, assert_1.default)(!expected.changeAnnotations);
|
546
|
+
}
|
547
|
+
}
|
548
|
+
_verifyChangeAnnotations(expected, actual) {
|
549
|
+
assert_1.default.strictEqual(Object.entries(expected).length, Object.entries(actual).length);
|
550
|
+
for (const key of Object.keys(expected)) {
|
551
|
+
const expectedAnnotation = expected[key];
|
552
|
+
const actualAnnotation = actual[key];
|
553
|
+
// We need to improve it to test localized strings.
|
554
|
+
assert_1.default.strictEqual(expectedAnnotation.label, actualAnnotation.label);
|
555
|
+
assert_1.default.strictEqual(expectedAnnotation.description, actualAnnotation.description);
|
556
|
+
assert_1.default.strictEqual(expectedAnnotation.needsConfirmation, actualAnnotation.needsConfirmation);
|
557
|
+
}
|
558
|
+
}
|
559
|
+
_textDocumentAreSame(expected, actual) {
|
560
|
+
return expected.version === actual.version && expected.uri === actual.uri;
|
561
|
+
}
|
562
|
+
_verifyDocumentEdits(expected, actual) {
|
563
|
+
assert_1.default.strictEqual(expected.length, actual.length);
|
564
|
+
for (const op of expected) {
|
565
|
+
(0, assert_1.default)(actual.some((a) => {
|
566
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
567
|
+
const expectedKind = vscode_languageserver_1.TextDocumentEdit.is(op) ? 'edit' : op.kind;
|
568
|
+
const actualKind = vscode_languageserver_1.TextDocumentEdit.is(a) ? 'edit' : a.kind;
|
569
|
+
if (expectedKind !== actualKind) {
|
570
|
+
return false;
|
571
|
+
}
|
572
|
+
switch (expectedKind) {
|
573
|
+
case 'edit': {
|
574
|
+
const expectedEdit = op;
|
575
|
+
const actualEdit = a;
|
576
|
+
if (!this._textDocumentAreSame(expectedEdit.textDocument, actualEdit.textDocument)) {
|
577
|
+
return false;
|
578
|
+
}
|
579
|
+
return this._textEditsAreSame(expectedEdit.edits, actualEdit.edits);
|
580
|
+
}
|
581
|
+
case 'create': {
|
582
|
+
const expectedOp = op;
|
583
|
+
const actualOp = a;
|
584
|
+
return (expectedOp.kind === actualOp.kind &&
|
585
|
+
expectedOp.annotationId === actualOp.annotationId &&
|
586
|
+
expectedOp.uri === actualOp.uri &&
|
587
|
+
((_a = expectedOp.options) === null || _a === void 0 ? void 0 : _a.ignoreIfExists) === ((_b = actualOp.options) === null || _b === void 0 ? void 0 : _b.ignoreIfExists) &&
|
588
|
+
((_c = expectedOp.options) === null || _c === void 0 ? void 0 : _c.overwrite) === ((_d = actualOp.options) === null || _d === void 0 ? void 0 : _d.overwrite));
|
589
|
+
}
|
590
|
+
case 'rename': {
|
591
|
+
const expectedOp = op;
|
592
|
+
const actualOp = a;
|
593
|
+
return (expectedOp.kind === actualOp.kind &&
|
594
|
+
expectedOp.annotationId === actualOp.annotationId &&
|
595
|
+
expectedOp.oldUri === actualOp.oldUri &&
|
596
|
+
expectedOp.newUri === actualOp.newUri &&
|
597
|
+
((_e = expectedOp.options) === null || _e === void 0 ? void 0 : _e.ignoreIfExists) === ((_f = actualOp.options) === null || _f === void 0 ? void 0 : _f.ignoreIfExists) &&
|
598
|
+
((_g = expectedOp.options) === null || _g === void 0 ? void 0 : _g.overwrite) === ((_h = actualOp.options) === null || _h === void 0 ? void 0 : _h.overwrite));
|
599
|
+
}
|
600
|
+
case 'delete': {
|
601
|
+
const expectedOp = op;
|
602
|
+
const actualOp = a;
|
603
|
+
return (expectedOp.annotationId === actualOp.annotationId &&
|
604
|
+
expectedOp.kind === actualOp.kind &&
|
605
|
+
expectedOp.uri === actualOp.uri &&
|
606
|
+
((_j = expectedOp.options) === null || _j === void 0 ? void 0 : _j.ignoreIfNotExists) === ((_k = actualOp.options) === null || _k === void 0 ? void 0 : _k.ignoreIfNotExists) &&
|
607
|
+
((_l = expectedOp.options) === null || _l === void 0 ? void 0 : _l.recursive) === ((_m = actualOp.options) === null || _m === void 0 ? void 0 : _m.recursive));
|
608
|
+
}
|
609
|
+
default:
|
610
|
+
debug.assertNever(expectedKind);
|
611
|
+
}
|
612
|
+
}));
|
613
|
+
}
|
614
|
+
}
|
615
|
+
_verifyTextEditMap(expected, actual) {
|
616
|
+
assert_1.default.strictEqual(Object.entries(expected).length, Object.entries(actual).length);
|
617
|
+
for (const key of Object.keys(expected)) {
|
618
|
+
(0, assert_1.default)(this._textEditsAreSame(expected[key], actual[key]));
|
619
|
+
}
|
620
|
+
}
|
621
|
+
_textEditsAreSame(expectedEdits, actualEdits) {
|
622
|
+
if (expectedEdits.length !== actualEdits.length) {
|
623
|
+
return false;
|
624
|
+
}
|
625
|
+
for (const edit of expectedEdits) {
|
626
|
+
if (!actualEdits.some((a) => this._textEditAreSame(edit, a))) {
|
627
|
+
return false;
|
628
|
+
}
|
629
|
+
}
|
630
|
+
return true;
|
631
|
+
}
|
632
|
+
_textEditAreSame(expected, actual) {
|
633
|
+
if (!(0, textRange_1.rangesAreEqual)(expected.range, actual.range)) {
|
634
|
+
return false;
|
635
|
+
}
|
636
|
+
if (expected.newText !== actual.newText) {
|
637
|
+
return false;
|
638
|
+
}
|
639
|
+
const expectedAnnotation = vscode_languageserver_1.AnnotatedTextEdit.is(expected) ? expected.annotationId : '';
|
640
|
+
const actualAnnotation = vscode_languageserver_1.AnnotatedTextEdit.is(actual) ? actual.annotationId : '';
|
641
|
+
return expectedAnnotation === actualAnnotation;
|
642
|
+
}
|
643
|
+
async verifyInvokeCodeAction(map, verifyCodeActionCount) {
|
644
|
+
var _a;
|
645
|
+
this._analyze();
|
646
|
+
for (const range of this.getRanges()) {
|
647
|
+
const name = this.getMarkerName(range.marker);
|
648
|
+
if (!map[name]) {
|
649
|
+
continue;
|
650
|
+
}
|
651
|
+
const ls = new testLanguageService_1.TestLanguageService(this.workspace, this.console, this.fs);
|
652
|
+
const codeActions = await this._getCodeActions(range);
|
653
|
+
if (verifyCodeActionCount) {
|
654
|
+
if (codeActions.length !== Object.keys(map).length) {
|
655
|
+
this.raiseError(`doesn't contain expected result: ${(0, utils_1.stringify)(map[name])}, actual: ${(0, utils_1.stringify)(codeActions)}`);
|
656
|
+
}
|
657
|
+
}
|
658
|
+
const matches = codeActions.filter((c) => c.title === map[name].title);
|
659
|
+
if (matches.length === 0) {
|
660
|
+
this.raiseError(`doesn't contain expected result: ${(0, utils_1.stringify)(map[name])}, actual: ${(0, utils_1.stringify)(codeActions)}`);
|
661
|
+
}
|
662
|
+
for (const codeAction of matches) {
|
663
|
+
const results = await this._hostSpecificFeatures.execute(ls, {
|
664
|
+
command: codeAction.command.command,
|
665
|
+
arguments: ((_a = codeAction.command) === null || _a === void 0 ? void 0 : _a.arguments) || [],
|
666
|
+
}, vscode_languageserver_1.CancellationToken.None);
|
667
|
+
if (map[name].edits) {
|
668
|
+
const workspaceEdits = results;
|
669
|
+
for (const edits of Object.values(workspaceEdits.changes)) {
|
670
|
+
for (const edit of edits) {
|
671
|
+
if (map[name].edits.filter((e) => this._editsAreEqual(e, edit)).length !== 1) {
|
672
|
+
this.raiseError(`doesn't contain expected result: ${(0, utils_1.stringify)(map[name])}, actual: ${(0, utils_1.stringify)(edits)}`);
|
673
|
+
}
|
674
|
+
}
|
675
|
+
}
|
676
|
+
}
|
677
|
+
}
|
678
|
+
if (map[name].files) {
|
679
|
+
await this._verifyFiles(map[name].files);
|
680
|
+
}
|
681
|
+
}
|
682
|
+
}
|
683
|
+
verifyHover(kind, map) {
|
684
|
+
// Do not force analyze, it can lead to test passing while it doesn't work in product
|
685
|
+
for (const range of this.getRanges()) {
|
686
|
+
const name = this.getMarkerName(range.marker);
|
687
|
+
const expected = map[name];
|
688
|
+
if (expected === undefined) {
|
689
|
+
continue;
|
690
|
+
}
|
691
|
+
const rangePos = this.convertOffsetsToRange(range.fileName, range.pos, range.end);
|
692
|
+
const actual = (0, hoverProvider_1.convertHoverResults)(kind, this.program.getHoverForPosition(range.fileName, rangePos.start, kind, vscode_languageserver_1.CancellationToken.None));
|
693
|
+
// if expected is null then there should be nothing shown on hover
|
694
|
+
if (expected === null) {
|
695
|
+
assert_1.default.equal(actual, undefined);
|
696
|
+
continue;
|
697
|
+
}
|
698
|
+
assert_1.default.ok(actual);
|
699
|
+
assert_1.default.deepEqual(actual.range, rangePos);
|
700
|
+
if (vscode_languageserver_1.MarkupContent.is(actual.contents)) {
|
701
|
+
assert_1.default.equal(actual.contents.value, expected);
|
702
|
+
assert_1.default.equal(actual.contents.kind, kind);
|
703
|
+
}
|
704
|
+
else {
|
705
|
+
assert_1.default.fail(`Unexpected type of contents object "${actual.contents}", should be MarkupContent.`);
|
706
|
+
}
|
707
|
+
}
|
708
|
+
}
|
709
|
+
verifyCaretAtMarker(markerName = '') {
|
710
|
+
const pos = this.getMarkerByName(markerName);
|
711
|
+
if (pos.fileName !== this.activeFile.fileName) {
|
712
|
+
throw new Error(`verifyCaretAtMarker failed - expected to be in file "${pos.fileName}", but was in file "${this.activeFile.fileName}"`);
|
713
|
+
}
|
714
|
+
if (pos.position !== this.currentCaretPosition) {
|
715
|
+
throw new Error(`verifyCaretAtMarker failed - expected to be at marker "/*${markerName}*/, but was at position ${this.currentCaretPosition}(${this._getLineColStringAtPosition(this.currentCaretPosition)})`);
|
716
|
+
}
|
717
|
+
}
|
718
|
+
verifyCurrentLineContent(text) {
|
719
|
+
const actual = this._getCurrentLineContent();
|
720
|
+
if (actual !== text) {
|
721
|
+
throw new Error('verifyCurrentLineContent\n' + this._displayExpectedAndActualString(text, actual, /* quoted */ true));
|
722
|
+
}
|
723
|
+
}
|
724
|
+
verifyCurrentFileContent(text) {
|
725
|
+
this._verifyFileContent(this.activeFile.fileName, text);
|
726
|
+
}
|
727
|
+
verifyTextAtCaretIs(text) {
|
728
|
+
const actual = this._getFileContent(this.activeFile.fileName).substring(this.currentCaretPosition, this.currentCaretPosition + text.length);
|
729
|
+
if (actual !== text) {
|
730
|
+
throw new Error('verifyTextAtCaretIs\n' + this._displayExpectedAndActualString(text, actual, /* quoted */ true));
|
731
|
+
}
|
732
|
+
}
|
733
|
+
verifyRangeIs(expectedText, includeWhiteSpace) {
|
734
|
+
this._verifyTextMatches(this._rangeText(this._getOnlyRange()), !!includeWhiteSpace, expectedText);
|
735
|
+
}
|
736
|
+
async verifyCompletion(verifyMode, docFormat, map, abbrMap) {
|
737
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
738
|
+
this._analyze();
|
739
|
+
for (const marker of this.getMarkers()) {
|
740
|
+
const markerName = this.getMarkerName(marker);
|
741
|
+
if (!map[markerName]) {
|
742
|
+
continue;
|
743
|
+
}
|
744
|
+
this.lastKnownMarker = markerName;
|
745
|
+
const filePath = marker.fileName;
|
746
|
+
const expectedCompletions = map[markerName].completions;
|
747
|
+
const completionPosition = this.convertOffsetToPosition(filePath, marker.position);
|
748
|
+
const options = { format: docFormat, snippet: true, lazyEdit: true, autoImport: true };
|
749
|
+
const nameMap = abbrMap ? new Map(Object.entries(abbrMap)) : undefined;
|
750
|
+
const result = await this.workspace.serviceInstance.getCompletionsForPosition(filePath, completionPosition, this.workspace.rootPath, options, nameMap, vscode_languageserver_1.CancellationToken.None);
|
751
|
+
if (result === null || result === void 0 ? void 0 : result.completionList) {
|
752
|
+
if (verifyMode === 'exact') {
|
753
|
+
if (result.completionList.items.length !== expectedCompletions.length) {
|
754
|
+
assert_1.default.fail(`${markerName} - Expected ${expectedCompletions.length} items but received ${result.completionList.items.length}. Actual completions:\n${(0, utils_1.stringify)(result.completionList.items.map((r) => r.label))}`);
|
755
|
+
}
|
756
|
+
}
|
757
|
+
for (let i = 0; i < expectedCompletions.length; i++) {
|
758
|
+
const expected = expectedCompletions[i];
|
759
|
+
const actualIndex = result.completionList.items.findIndex((a) => a.label === expected.label &&
|
760
|
+
(expected.kind ? a.kind === expected.kind : true) &&
|
761
|
+
(expected.detail ? a.detail === expected.detail : true) &&
|
762
|
+
(expected.documentation && vscode_languageserver_1.MarkupContent.is(a.documentation)
|
763
|
+
? a.documentation.value === expected.documentation
|
764
|
+
: true));
|
765
|
+
if (actualIndex >= 0) {
|
766
|
+
if (verifyMode === 'excluded') {
|
767
|
+
// we're not supposed to find the completions passed to the test
|
768
|
+
assert_1.default.fail(`${markerName} - Completion item with label "${expected.label}" unexpected. Actual completions:\n${(0, utils_1.stringify)(result.completionList.items.map((r) => r.label))}`);
|
769
|
+
}
|
770
|
+
const actual = result.completionList.items[actualIndex];
|
771
|
+
if (expected.additionalTextEdits !== undefined) {
|
772
|
+
if (actual.additionalTextEdits === undefined) {
|
773
|
+
this.workspace.serviceInstance.resolveCompletionItem(filePath, actual, options, nameMap, vscode_languageserver_1.CancellationToken.None);
|
774
|
+
}
|
775
|
+
}
|
776
|
+
this.verifyCompletionItem(expected, actual);
|
777
|
+
if (expected.documentation !== undefined) {
|
778
|
+
if (actual.documentation === undefined) {
|
779
|
+
this.workspace.serviceInstance.resolveCompletionItem(filePath, actual, options, nameMap, vscode_languageserver_1.CancellationToken.None);
|
780
|
+
}
|
781
|
+
if (vscode_languageserver_1.MarkupContent.is(actual.documentation)) {
|
782
|
+
assert_1.default.strictEqual(actual.documentation.value, expected.documentation);
|
783
|
+
assert_1.default.strictEqual(actual.documentation.kind, docFormat);
|
784
|
+
}
|
785
|
+
else {
|
786
|
+
assert_1.default.fail(`${markerName} - Unexpected type of contents object "${actual.documentation}", should be MarkupContent.`);
|
787
|
+
}
|
788
|
+
}
|
789
|
+
result.completionList.items.splice(actualIndex, 1);
|
790
|
+
}
|
791
|
+
else {
|
792
|
+
if (verifyMode === 'included' || verifyMode === 'exact') {
|
793
|
+
// we're supposed to find all items passed to the test
|
794
|
+
assert_1.default.fail(`${markerName} - Completion item with label "${expected.label}" expected. Actual completions:\n${(0, utils_1.stringify)(result.completionList.items.map((r) => r.label))}`);
|
795
|
+
}
|
796
|
+
}
|
797
|
+
}
|
798
|
+
if (verifyMode === 'exact') {
|
799
|
+
if (result.completionList.items.length !== 0) {
|
800
|
+
// we removed every item we found, there should not be any remaining
|
801
|
+
assert_1.default.fail(`${markerName} - Completion items unexpected: ${(0, utils_1.stringify)(result.completionList.items.map((r) => r.label))}`);
|
802
|
+
}
|
803
|
+
}
|
804
|
+
}
|
805
|
+
else {
|
806
|
+
if (verifyMode !== 'exact' || expectedCompletions.length > 0) {
|
807
|
+
assert_1.default.fail(`${markerName} - Failed to get completions`);
|
808
|
+
}
|
809
|
+
}
|
810
|
+
if (map[markerName].memberAccessInfo !== undefined && (result === null || result === void 0 ? void 0 : result.memberAccessInfo) !== undefined) {
|
811
|
+
const expectedModule = (_a = map[markerName].memberAccessInfo) === null || _a === void 0 ? void 0 : _a.lastKnownModule;
|
812
|
+
const expectedType = (_b = map[markerName].memberAccessInfo) === null || _b === void 0 ? void 0 : _b.lastKnownMemberName;
|
813
|
+
const expectedName = (_c = map[markerName].memberAccessInfo) === null || _c === void 0 ? void 0 : _c.unknownMemberName;
|
814
|
+
if (((_d = result === null || result === void 0 ? void 0 : result.memberAccessInfo) === null || _d === void 0 ? void 0 : _d.lastKnownModule) !== expectedModule ||
|
815
|
+
((_e = result === null || result === void 0 ? void 0 : result.memberAccessInfo) === null || _e === void 0 ? void 0 : _e.lastKnownMemberName) !== expectedType ||
|
816
|
+
((_f = result === null || result === void 0 ? void 0 : result.memberAccessInfo) === null || _f === void 0 ? void 0 : _f.unknownMemberName) !== expectedName) {
|
817
|
+
assert_1.default.fail(`${markerName} - Expected completion results memberAccessInfo with \n lastKnownModule: "${expectedModule}"\n lastKnownMemberName: "${expectedType}"\n unknownMemberName: "${expectedName}"\n Actual memberAccessInfo:\n lastKnownModule: "${(_h = (_g = result.memberAccessInfo) === null || _g === void 0 ? void 0 : _g.lastKnownModule) !== null && _h !== void 0 ? _h : ''}"\n lastKnownMemberName: "${(_k = (_j = result.memberAccessInfo) === null || _j === void 0 ? void 0 : _j.lastKnownMemberName) !== null && _k !== void 0 ? _k : ''}\n unknownMemberName: "${(_m = (_l = result.memberAccessInfo) === null || _l === void 0 ? void 0 : _l.unknownMemberName) !== null && _m !== void 0 ? _m : ''}" `);
|
818
|
+
}
|
819
|
+
}
|
820
|
+
}
|
821
|
+
}
|
822
|
+
verifySignature(docFormat, map) {
|
823
|
+
this._analyze();
|
824
|
+
for (const marker of this.getMarkers()) {
|
825
|
+
const fileName = marker.fileName;
|
826
|
+
const name = this.getMarkerName(marker);
|
827
|
+
if (!(name in map)) {
|
828
|
+
continue;
|
829
|
+
}
|
830
|
+
const expected = map[name];
|
831
|
+
const position = this.convertOffsetToPosition(fileName, marker.position);
|
832
|
+
const actual = this.program.getSignatureHelpForPosition(fileName, position, docFormat, vscode_languageserver_1.CancellationToken.None);
|
833
|
+
if (expected.noSig) {
|
834
|
+
assert_1.default.equal(actual, undefined);
|
835
|
+
continue;
|
836
|
+
}
|
837
|
+
assert_1.default.ok(actual);
|
838
|
+
assert_1.default.ok(actual.signatures);
|
839
|
+
assert_1.default.ok(expected.activeParameters);
|
840
|
+
assert_1.default.equal(actual.signatures.length, expected.activeParameters.length);
|
841
|
+
actual.signatures.forEach((sig, index) => {
|
842
|
+
const expectedSig = expected.signatures[index];
|
843
|
+
assert_1.default.equal(sig.label, expectedSig.label);
|
844
|
+
assert_1.default.ok(sig.parameters);
|
845
|
+
const actualParameters = [];
|
846
|
+
sig.parameters.forEach((p) => {
|
847
|
+
actualParameters.push(sig.label.substring(p.startOffset, p.endOffset));
|
848
|
+
});
|
849
|
+
assert_1.default.deepEqual(actualParameters, expectedSig.parameters);
|
850
|
+
if (expectedSig.documentation === undefined) {
|
851
|
+
assert_1.default.equal(sig.documentation, undefined);
|
852
|
+
}
|
853
|
+
else {
|
854
|
+
assert_1.default.deepEqual(sig.documentation, {
|
855
|
+
kind: docFormat,
|
856
|
+
value: expectedSig.documentation,
|
857
|
+
});
|
858
|
+
}
|
859
|
+
});
|
860
|
+
assert_1.default.deepEqual(actual.signatures.map((sig) => sig.activeParameter), expected.activeParameters);
|
861
|
+
if (expected.callHasParameters !== undefined) {
|
862
|
+
assert_1.default.equal(actual.callHasParameters, expected.callHasParameters);
|
863
|
+
}
|
864
|
+
}
|
865
|
+
}
|
866
|
+
verifyFindAllReferences(map) {
|
867
|
+
var _a;
|
868
|
+
this._analyze();
|
869
|
+
for (const marker of this.getMarkers()) {
|
870
|
+
const fileName = marker.fileName;
|
871
|
+
const name = this.getMarkerName(marker);
|
872
|
+
if (!(name in map)) {
|
873
|
+
continue;
|
874
|
+
}
|
875
|
+
const expected = map[name].references;
|
876
|
+
const position = this.convertOffsetToPosition(fileName, marker.position);
|
877
|
+
const actual = [];
|
878
|
+
this.program.reportReferencesForPosition(fileName, position, true, (locs) => (0, collectionUtils_1.appendArray)(actual, locs), vscode_languageserver_1.CancellationToken.None);
|
879
|
+
assert_1.default.strictEqual((_a = actual === null || actual === void 0 ? void 0 : actual.length) !== null && _a !== void 0 ? _a : 0, expected.length, `${name} has failed`);
|
880
|
+
for (const r of expected) {
|
881
|
+
assert_1.default.equal(actual === null || actual === void 0 ? void 0 : actual.filter((d) => this._deepEqual(d, r)).length, 1);
|
882
|
+
}
|
883
|
+
}
|
884
|
+
}
|
885
|
+
getDocumentHighlightKind(m) {
|
886
|
+
const kind = (m === null || m === void 0 ? void 0 : m.data) ? m.data.kind : undefined;
|
887
|
+
switch (kind) {
|
888
|
+
case 'text':
|
889
|
+
return vscode_languageserver_1.DocumentHighlightKind.Text;
|
890
|
+
case 'read':
|
891
|
+
return vscode_languageserver_1.DocumentHighlightKind.Read;
|
892
|
+
case 'write':
|
893
|
+
return vscode_languageserver_1.DocumentHighlightKind.Write;
|
894
|
+
default:
|
895
|
+
return undefined;
|
896
|
+
}
|
897
|
+
}
|
898
|
+
verifyHighlightReferences(map) {
|
899
|
+
var _a;
|
900
|
+
this._analyze();
|
901
|
+
for (const name of Object.keys(map)) {
|
902
|
+
const marker = this.getMarkerByName(name);
|
903
|
+
const fileName = marker.fileName;
|
904
|
+
const expected = map[name].references;
|
905
|
+
const position = this.convertOffsetToPosition(fileName, marker.position);
|
906
|
+
const actual = this.program.getDocumentHighlight(fileName, position, vscode_languageserver_1.CancellationToken.None);
|
907
|
+
assert_1.default.equal((_a = actual === null || actual === void 0 ? void 0 : actual.length) !== null && _a !== void 0 ? _a : 0, expected.length);
|
908
|
+
for (const r of expected) {
|
909
|
+
const match = actual === null || actual === void 0 ? void 0 : actual.filter((h) => this._deepEqual(h.range, r.range));
|
910
|
+
assert_1.default.equal(match === null || match === void 0 ? void 0 : match.length, 1);
|
911
|
+
if (r.kind) {
|
912
|
+
assert_1.default.equal(match[0].kind, r.kind);
|
913
|
+
}
|
914
|
+
}
|
915
|
+
}
|
916
|
+
}
|
917
|
+
verifyFindDefinitions(map, filter = definitionProvider_1.DefinitionFilter.All) {
|
918
|
+
var _a;
|
919
|
+
this._analyze();
|
920
|
+
for (const marker of this.getMarkers()) {
|
921
|
+
const fileName = marker.fileName;
|
922
|
+
const name = this.getMarkerName(marker);
|
923
|
+
if (!(name in map)) {
|
924
|
+
continue;
|
925
|
+
}
|
926
|
+
const expected = map[name].definitions;
|
927
|
+
const position = this.convertOffsetToPosition(fileName, marker.position);
|
928
|
+
const actual = this.program.getDefinitionsForPosition(fileName, position, filter, vscode_languageserver_1.CancellationToken.None);
|
929
|
+
assert_1.default.equal((_a = actual === null || actual === void 0 ? void 0 : actual.length) !== null && _a !== void 0 ? _a : 0, expected.length);
|
930
|
+
for (const r of expected) {
|
931
|
+
assert_1.default.equal(actual === null || actual === void 0 ? void 0 : actual.filter((d) => this._deepEqual(d, r)).length, 1);
|
932
|
+
}
|
933
|
+
}
|
934
|
+
}
|
935
|
+
verifyFindTypeDefinitions(map) {
|
936
|
+
var _a;
|
937
|
+
this._analyze();
|
938
|
+
for (const marker of this.getMarkers()) {
|
939
|
+
const fileName = marker.fileName;
|
940
|
+
const name = this.getMarkerName(marker);
|
941
|
+
if (!(name in map)) {
|
942
|
+
continue;
|
943
|
+
}
|
944
|
+
const expected = map[name].definitions;
|
945
|
+
const position = this.convertOffsetToPosition(fileName, marker.position);
|
946
|
+
const actual = this.program.getTypeDefinitionsForPosition(fileName, position, vscode_languageserver_1.CancellationToken.None);
|
947
|
+
assert_1.default.strictEqual((_a = actual === null || actual === void 0 ? void 0 : actual.length) !== null && _a !== void 0 ? _a : 0, expected.length, name);
|
948
|
+
for (const r of expected) {
|
949
|
+
assert_1.default.strictEqual(actual === null || actual === void 0 ? void 0 : actual.filter((d) => this._deepEqual(d, r)).length, 1, name);
|
950
|
+
}
|
951
|
+
}
|
952
|
+
}
|
953
|
+
verifyRename(map) {
|
954
|
+
var _a;
|
955
|
+
this._analyze();
|
956
|
+
for (const marker of this.getMarkers()) {
|
957
|
+
const fileName = marker.fileName;
|
958
|
+
const name = this.getMarkerName(marker);
|
959
|
+
if (!(name in map)) {
|
960
|
+
continue;
|
961
|
+
}
|
962
|
+
const expected = map[name];
|
963
|
+
const position = this.convertOffsetToPosition(fileName, marker.position);
|
964
|
+
const actual = this.program.renameSymbolAtPosition(fileName, position, expected.newName,
|
965
|
+
/* isDefaultWorkspace */ false,
|
966
|
+
/* allowModuleRename */ false, vscode_languageserver_1.CancellationToken.None);
|
967
|
+
assert_1.default.equal((_a = actual === null || actual === void 0 ? void 0 : actual.edits.length) !== null && _a !== void 0 ? _a : 0, expected.changes.length);
|
968
|
+
for (const c of expected.changes) {
|
969
|
+
assert_1.default.equal(actual === null || actual === void 0 ? void 0 : actual.edits.filter((e) => this._deepEqual(e, c)).length, 1);
|
970
|
+
}
|
971
|
+
}
|
972
|
+
}
|
973
|
+
setCancelled(numberOfCalls) {
|
974
|
+
this._cancellationToken.setCancelled(numberOfCalls);
|
975
|
+
}
|
976
|
+
resetCancelled() {
|
977
|
+
this._cancellationToken.resetCancelled();
|
978
|
+
}
|
979
|
+
_isConfig(file, ignoreCase) {
|
980
|
+
const comparer = (0, stringUtils_1.getStringComparer)(ignoreCase);
|
981
|
+
return service_1.configFileNames.some((f) => comparer((0, pathUtils_1.getBaseFileName)(file.fileName), f) === 0 /* EqualTo */);
|
982
|
+
}
|
983
|
+
_convertGlobalOptionsToConfigOptions(globalOptions, mountPaths) {
|
984
|
+
var _a;
|
985
|
+
const srtRoot = "projectroot" /* projectRoot */;
|
986
|
+
const projectRoot = (0, pathUtils_1.normalizeSlashes)((_a = globalOptions[srtRoot]) !== null && _a !== void 0 ? _a : vfs.MODULE_PATH);
|
987
|
+
const configOptions = new configOptions_1.ConfigOptions(projectRoot);
|
988
|
+
// add more global options as we need them
|
989
|
+
return this._applyTestConfigOptions(configOptions, mountPaths);
|
990
|
+
}
|
991
|
+
_applyTestConfigOptions(configOptions, mountPaths) {
|
992
|
+
// Always enable "test mode".
|
993
|
+
configOptions.internalTestMode = true;
|
994
|
+
// Always analyze all files
|
995
|
+
configOptions.checkOnlyOpenFiles = false;
|
996
|
+
// make sure we set typing path
|
997
|
+
if (configOptions.stubPath === undefined) {
|
998
|
+
configOptions.stubPath = (0, pathUtils_1.normalizePath)((0, pathUtils_1.combinePaths)(vfs.MODULE_PATH, 'typings'));
|
999
|
+
}
|
1000
|
+
configOptions.include.push((0, pathUtils_1.getFileSpec)(this.fs, configOptions.projectRoot, '.'));
|
1001
|
+
configOptions.exclude.push((0, pathUtils_1.getFileSpec)(this.fs, configOptions.projectRoot, factory_1.typeshedFolder));
|
1002
|
+
configOptions.exclude.push((0, pathUtils_1.getFileSpec)(this.fs, configOptions.projectRoot, factory_1.distlibFolder));
|
1003
|
+
configOptions.exclude.push((0, pathUtils_1.getFileSpec)(this.fs, configOptions.projectRoot, factory_1.libFolder));
|
1004
|
+
if (mountPaths) {
|
1005
|
+
for (const mountPath of mountPaths.keys()) {
|
1006
|
+
configOptions.exclude.push((0, pathUtils_1.getFileSpec)(this.fs, configOptions.projectRoot, mountPath));
|
1007
|
+
}
|
1008
|
+
}
|
1009
|
+
return configOptions;
|
1010
|
+
}
|
1011
|
+
_getFileContent(fileName) {
|
1012
|
+
const files = this.testData.files.filter((f) => (0, pathUtils_1.comparePaths)(f.fileName, fileName, this.testFS.ignoreCase) === 0 /* EqualTo */);
|
1013
|
+
return files[0].content;
|
1014
|
+
}
|
1015
|
+
convertPositionToOffset(fileName, position) {
|
1016
|
+
const lines = this._getTextRangeCollection(fileName);
|
1017
|
+
return (0, positionUtils_1.convertPositionToOffset)(position, lines);
|
1018
|
+
}
|
1019
|
+
convertOffsetToPosition(fileName, offset) {
|
1020
|
+
const lines = this._getTextRangeCollection(fileName);
|
1021
|
+
return (0, positionUtils_1.convertOffsetToPosition)(offset, lines);
|
1022
|
+
}
|
1023
|
+
convertOffsetsToRange(fileName, startOffset, endOffset) {
|
1024
|
+
const lines = this._getTextRangeCollection(fileName);
|
1025
|
+
return {
|
1026
|
+
start: (0, positionUtils_1.convertOffsetToPosition)(startOffset, lines),
|
1027
|
+
end: (0, positionUtils_1.convertOffsetToPosition)(endOffset, lines),
|
1028
|
+
};
|
1029
|
+
}
|
1030
|
+
_getParseResult(fileName) {
|
1031
|
+
const file = this.program.getBoundSourceFile(fileName);
|
1032
|
+
return file.getParseResults();
|
1033
|
+
}
|
1034
|
+
_getTextRangeCollection(fileName) {
|
1035
|
+
if (fileName in this._files) {
|
1036
|
+
return this._getParseResult(fileName).tokenizerOutput.lines;
|
1037
|
+
}
|
1038
|
+
// slow path
|
1039
|
+
const fileContents = this.fs.readFileSync(fileName, 'utf8');
|
1040
|
+
const tokenizer = new tokenizer_1.Tokenizer();
|
1041
|
+
return tokenizer.tokenize(fileContents).lines;
|
1042
|
+
}
|
1043
|
+
raiseError(message) {
|
1044
|
+
throw new Error(this._messageAtLastKnownMarker(message));
|
1045
|
+
}
|
1046
|
+
_messageAtLastKnownMarker(message) {
|
1047
|
+
const locationDescription = this.lastKnownMarker
|
1048
|
+
? this.lastKnownMarker
|
1049
|
+
: this._getLineColStringAtPosition(this.currentCaretPosition);
|
1050
|
+
return `At ${locationDescription}: ${message}`;
|
1051
|
+
}
|
1052
|
+
_checkPostEditInvariants() {
|
1053
|
+
// blank for now
|
1054
|
+
}
|
1055
|
+
_editScriptAndUpdateMarkers(fileName, editStart, editEnd, newText) {
|
1056
|
+
// this.languageServiceAdapterHost.editScript(fileName, editStart, editEnd, newText);
|
1057
|
+
for (const marker of this.testData.markers) {
|
1058
|
+
if (marker.fileName === fileName) {
|
1059
|
+
marker.position = this._updatePosition(marker.position, editStart, editEnd, newText);
|
1060
|
+
}
|
1061
|
+
}
|
1062
|
+
for (const range of this.testData.ranges) {
|
1063
|
+
if (range.fileName === fileName) {
|
1064
|
+
range.pos = this._updatePosition(range.pos, editStart, editEnd, newText);
|
1065
|
+
range.end = this._updatePosition(range.end, editStart, editEnd, newText);
|
1066
|
+
}
|
1067
|
+
}
|
1068
|
+
this.testData.rangesByText = undefined;
|
1069
|
+
}
|
1070
|
+
_removeWhitespace(text) {
|
1071
|
+
return text.replace(/\s/g, '');
|
1072
|
+
}
|
1073
|
+
createMultiMap(values, getKey) {
|
1074
|
+
const map = new Map();
|
1075
|
+
map.add = multiMapAdd;
|
1076
|
+
map.remove = multiMapRemove;
|
1077
|
+
if (values && getKey) {
|
1078
|
+
for (const value of values) {
|
1079
|
+
map.add(getKey(value), value);
|
1080
|
+
}
|
1081
|
+
}
|
1082
|
+
return map;
|
1083
|
+
function multiMapAdd(key, value) {
|
1084
|
+
let values = this.get(key);
|
1085
|
+
if (values) {
|
1086
|
+
values.push(value);
|
1087
|
+
}
|
1088
|
+
else {
|
1089
|
+
this.set(key, (values = [value]));
|
1090
|
+
}
|
1091
|
+
return values;
|
1092
|
+
}
|
1093
|
+
function multiMapRemove(key, value) {
|
1094
|
+
const values = this.get(key);
|
1095
|
+
if (values) {
|
1096
|
+
values.forEach((v, i, arr) => {
|
1097
|
+
if (v === value) {
|
1098
|
+
arr.splice(i, 1);
|
1099
|
+
}
|
1100
|
+
});
|
1101
|
+
if (!values.length) {
|
1102
|
+
this.delete(key);
|
1103
|
+
}
|
1104
|
+
}
|
1105
|
+
}
|
1106
|
+
}
|
1107
|
+
_rangeText({ fileName, pos, end }) {
|
1108
|
+
return this._getFileContent(fileName).slice(pos, end);
|
1109
|
+
}
|
1110
|
+
_getOnlyRange() {
|
1111
|
+
const ranges = this.getRanges();
|
1112
|
+
if (ranges.length !== 1) {
|
1113
|
+
this.raiseError('Exactly one range should be specified in the test file.');
|
1114
|
+
}
|
1115
|
+
return ranges[0];
|
1116
|
+
}
|
1117
|
+
_verifyFileContent(fileName, text) {
|
1118
|
+
const actual = this._getFileContent(fileName);
|
1119
|
+
if (actual !== text) {
|
1120
|
+
throw new Error(`verifyFileContent failed:\n${this._showTextDiff(text, actual)}`);
|
1121
|
+
}
|
1122
|
+
}
|
1123
|
+
_verifyTextMatches(actualText, includeWhitespace, expectedText) {
|
1124
|
+
const removeWhitespace = (s) => (includeWhitespace ? s : this._removeWhitespace(s));
|
1125
|
+
if (removeWhitespace(actualText) !== removeWhitespace(expectedText)) {
|
1126
|
+
this.raiseError(`Actual range text doesn't match expected text.\n${this._showTextDiff(expectedText, actualText)}`);
|
1127
|
+
}
|
1128
|
+
}
|
1129
|
+
_getSelection() {
|
1130
|
+
return textRange_1.TextRange.fromBounds(this.currentCaretPosition, this.selectionEnd === -1 ? this.currentCaretPosition : this.selectionEnd);
|
1131
|
+
}
|
1132
|
+
_getLineContent(index) {
|
1133
|
+
const text = this._getFileContent(this.activeFile.fileName);
|
1134
|
+
const pos = this.convertPositionToOffset(this.activeFile.fileName, { line: index, character: 0 });
|
1135
|
+
let startPos = pos;
|
1136
|
+
let endPos = pos;
|
1137
|
+
while (startPos > 0) {
|
1138
|
+
const ch = text.charCodeAt(startPos - 1);
|
1139
|
+
if (ch === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */) {
|
1140
|
+
break;
|
1141
|
+
}
|
1142
|
+
startPos--;
|
1143
|
+
}
|
1144
|
+
while (endPos < text.length) {
|
1145
|
+
const ch = text.charCodeAt(endPos);
|
1146
|
+
if (ch === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */) {
|
1147
|
+
break;
|
1148
|
+
}
|
1149
|
+
endPos++;
|
1150
|
+
}
|
1151
|
+
return text.substring(startPos, endPos);
|
1152
|
+
}
|
1153
|
+
// Get the text of the entire line the caret is currently at
|
1154
|
+
_getCurrentLineContent() {
|
1155
|
+
return this._getLineContent(this.convertOffsetToPosition(this.activeFile.fileName, this.currentCaretPosition).line);
|
1156
|
+
}
|
1157
|
+
_findFile(indexOrName) {
|
1158
|
+
if (typeof indexOrName === 'number') {
|
1159
|
+
const index = indexOrName;
|
1160
|
+
if (index >= this.testData.files.length) {
|
1161
|
+
throw new Error(`File index (${index}) in openFile was out of range. There are only ${this.testData.files.length} files in this test.`);
|
1162
|
+
}
|
1163
|
+
else {
|
1164
|
+
return this.testData.files[index];
|
1165
|
+
}
|
1166
|
+
}
|
1167
|
+
else if ((0, core_1.isString)(indexOrName)) {
|
1168
|
+
const { file, availableNames } = this._tryFindFileWorker(indexOrName);
|
1169
|
+
if (!file) {
|
1170
|
+
throw new Error(`No test file named "${indexOrName}" exists. Available file names are: ${availableNames.join(', ')}`);
|
1171
|
+
}
|
1172
|
+
return file;
|
1173
|
+
}
|
1174
|
+
else {
|
1175
|
+
return debug.assertNever(indexOrName);
|
1176
|
+
}
|
1177
|
+
}
|
1178
|
+
_tryFindFileWorker(name) {
|
1179
|
+
name = (0, pathUtils_1.normalizePath)(name);
|
1180
|
+
let file;
|
1181
|
+
const availableNames = [];
|
1182
|
+
this.testData.files.forEach((f) => {
|
1183
|
+
const fn = (0, pathUtils_1.normalizePath)(f.fileName);
|
1184
|
+
if (fn) {
|
1185
|
+
if (fn === name) {
|
1186
|
+
file = f;
|
1187
|
+
}
|
1188
|
+
availableNames.push(fn);
|
1189
|
+
}
|
1190
|
+
});
|
1191
|
+
assert_1.default.ok(file);
|
1192
|
+
return { file, availableNames };
|
1193
|
+
}
|
1194
|
+
_getLineColStringAtPosition(position, file = this.activeFile) {
|
1195
|
+
const pos = this.convertOffsetToPosition(file.fileName, position);
|
1196
|
+
return `line ${pos.line + 1}, col ${pos.character}`;
|
1197
|
+
}
|
1198
|
+
_showTextDiff(expected, actual) {
|
1199
|
+
// Only show whitespace if the difference is whitespace-only.
|
1200
|
+
if (this._differOnlyByWhitespace(expected, actual)) {
|
1201
|
+
expected = this._makeWhitespaceVisible(expected);
|
1202
|
+
actual = this._makeWhitespaceVisible(actual);
|
1203
|
+
}
|
1204
|
+
return this._displayExpectedAndActualString(expected, actual);
|
1205
|
+
}
|
1206
|
+
_differOnlyByWhitespace(a, b) {
|
1207
|
+
return this._removeWhitespace(a) === this._removeWhitespace(b);
|
1208
|
+
}
|
1209
|
+
_displayExpectedAndActualString(expected, actual, quoted = false) {
|
1210
|
+
const expectMsg = '\x1b[1mExpected\x1b[0m\x1b[31m';
|
1211
|
+
const actualMsg = '\x1b[1mActual\x1b[0m\x1b[31m';
|
1212
|
+
const expectedString = quoted ? '"' + expected + '"' : expected;
|
1213
|
+
const actualString = quoted ? '"' + actual + '"' : actual;
|
1214
|
+
return `\n${expectMsg}:\n${expectedString}\n\n${actualMsg}:\n${actualString}`;
|
1215
|
+
}
|
1216
|
+
_makeWhitespaceVisible(text) {
|
1217
|
+
return text
|
1218
|
+
.replace(/ /g, '\u00B7')
|
1219
|
+
.replace(/\r/g, '\u00B6')
|
1220
|
+
.replace(/\n/g, '\u2193\n')
|
1221
|
+
.replace(/\t/g, '\u2192 ');
|
1222
|
+
}
|
1223
|
+
_updatePosition(position, editStart, editEnd, { length }) {
|
1224
|
+
// If inside the edit, return -1 to mark as invalid
|
1225
|
+
return position <= editStart ? position : position < editEnd ? -1 : position + length - +(editEnd - editStart);
|
1226
|
+
}
|
1227
|
+
_analyze() {
|
1228
|
+
while (this.program.analyze()) {
|
1229
|
+
// Continue to call analyze until it completes. Since we're not
|
1230
|
+
// specifying a timeout, it should complete the first time.
|
1231
|
+
}
|
1232
|
+
}
|
1233
|
+
_getDiagnosticsPerFile() {
|
1234
|
+
const sourceFiles = this._files.map((f) => this.program.getSourceFile(f));
|
1235
|
+
const results = sourceFiles.map((sourceFile, index) => {
|
1236
|
+
if (sourceFile) {
|
1237
|
+
const diagnostics = sourceFile.getDiagnostics(this.configOptions) || [];
|
1238
|
+
const filePath = sourceFile.getFilePath();
|
1239
|
+
const value = {
|
1240
|
+
filePath,
|
1241
|
+
parseResults: sourceFile.getParseResults(),
|
1242
|
+
errors: diagnostics.filter((diag) => diag.category === 0 /* Error */),
|
1243
|
+
warnings: diagnostics.filter((diag) => diag.category === 1 /* Warning */),
|
1244
|
+
information: diagnostics.filter((diag) => diag.category === 2 /* Information */),
|
1245
|
+
};
|
1246
|
+
return [filePath, value];
|
1247
|
+
}
|
1248
|
+
else {
|
1249
|
+
this.raiseError(`Source file not found for ${this._files[index]}`);
|
1250
|
+
}
|
1251
|
+
});
|
1252
|
+
return new Map(results);
|
1253
|
+
}
|
1254
|
+
_createAnalysisService(nullConsole, importResolverFactory, configOptions) {
|
1255
|
+
// we do not initiate automatic analysis or file watcher in test.
|
1256
|
+
const service = new service_1.AnalyzerService('test service', this.fs, nullConsole, () => testAccessHost, importResolverFactory, configOptions);
|
1257
|
+
// directly set files to track rather than using fileSpec from config
|
1258
|
+
// to discover those files from file system
|
1259
|
+
service.test_program.setTrackedFiles(this._files
|
1260
|
+
.filter((path) => {
|
1261
|
+
const fileExtension = (0, pathUtils_1.getFileExtension)(path).toLowerCase();
|
1262
|
+
return fileExtension === '.py' || fileExtension === '.pyi';
|
1263
|
+
})
|
1264
|
+
.filter((path) => service.isTracked(path)));
|
1265
|
+
return service;
|
1266
|
+
}
|
1267
|
+
_deepEqual(a, e) {
|
1268
|
+
try {
|
1269
|
+
// NOTE: find better way.
|
1270
|
+
assert_1.default.deepStrictEqual(a, e);
|
1271
|
+
}
|
1272
|
+
catch {
|
1273
|
+
return false;
|
1274
|
+
}
|
1275
|
+
return true;
|
1276
|
+
}
|
1277
|
+
async _waitForFile(filePath) {
|
1278
|
+
while (!this.fs.existsSync(filePath)) {
|
1279
|
+
await new Promise((res) => setTimeout(() => {
|
1280
|
+
res();
|
1281
|
+
}, 200));
|
1282
|
+
}
|
1283
|
+
}
|
1284
|
+
_getCodeActions(range) {
|
1285
|
+
const file = range.fileName;
|
1286
|
+
const textRange = {
|
1287
|
+
start: this.convertOffsetToPosition(file, range.pos),
|
1288
|
+
end: this.convertOffsetToPosition(file, range.end),
|
1289
|
+
};
|
1290
|
+
return this._hostSpecificFeatures.getCodeActionsForPosition(this.workspace, file, textRange, vscode_languageserver_1.CancellationToken.None);
|
1291
|
+
}
|
1292
|
+
async _verifyFiles(files) {
|
1293
|
+
for (const filePath of Object.keys(files)) {
|
1294
|
+
const expected = files[filePath];
|
1295
|
+
const normalizedFilePath = (0, pathUtils_1.normalizeSlashes)(filePath);
|
1296
|
+
// wait until the file exists
|
1297
|
+
await this._waitForFile(normalizedFilePath);
|
1298
|
+
const actual = this.fs.readFileSync(normalizedFilePath, 'utf8');
|
1299
|
+
if (actual !== expected) {
|
1300
|
+
this.raiseError(`doesn't contain expected result: ${(0, utils_1.stringify)(expected)}, actual: ${(0, utils_1.stringify)(actual)}`);
|
1301
|
+
}
|
1302
|
+
}
|
1303
|
+
}
|
1304
|
+
_editsAreEqual(actual, expected) {
|
1305
|
+
if (actual === expected) {
|
1306
|
+
return true;
|
1307
|
+
}
|
1308
|
+
if (actual === undefined || expected === undefined) {
|
1309
|
+
return false;
|
1310
|
+
}
|
1311
|
+
return (0, textRange_1.rangesAreEqual)(actual.range, expected.range) && actual.newText === expected.newText;
|
1312
|
+
}
|
1313
|
+
_verifyEdit(actual, expected) {
|
1314
|
+
if (!this._editsAreEqual(actual, expected)) {
|
1315
|
+
this.raiseError(`doesn't contain expected result: ${(0, utils_1.stringify)(expected)}, actual: ${(0, utils_1.stringify)(actual)}`);
|
1316
|
+
}
|
1317
|
+
}
|
1318
|
+
_verifyEdits(actual, expected) {
|
1319
|
+
actual = actual !== null && actual !== void 0 ? actual : [];
|
1320
|
+
expected = expected !== null && expected !== void 0 ? expected : [];
|
1321
|
+
let extra = expected.slice(0);
|
1322
|
+
let left = actual.slice(0);
|
1323
|
+
for (const item of actual) {
|
1324
|
+
extra = extra.filter((e) => !this._editsAreEqual(e, item));
|
1325
|
+
}
|
1326
|
+
for (const item of expected) {
|
1327
|
+
left = left.filter((e) => !this._editsAreEqual(e, item));
|
1328
|
+
}
|
1329
|
+
if (extra.length > 0 || left.length > 0) {
|
1330
|
+
this.raiseError(`doesn't contain expected result: ${(0, utils_1.stringify)(extra)}, actual: ${(0, utils_1.stringify)(left)}`);
|
1331
|
+
}
|
1332
|
+
}
|
1333
|
+
verifyCompletionItem(expected, actual) {
|
1334
|
+
var _a;
|
1335
|
+
assert_1.default.strictEqual(actual.label, expected.label);
|
1336
|
+
assert_1.default.strictEqual(actual.detail, expected.detail);
|
1337
|
+
assert_1.default.strictEqual(actual.kind, expected.kind);
|
1338
|
+
assert_1.default.strictEqual(actual.insertText, expected.insertionText);
|
1339
|
+
this._verifyEdit(actual.textEdit, expected.textEdit);
|
1340
|
+
this._verifyEdits(actual.additionalTextEdits, expected.additionalTextEdits);
|
1341
|
+
if (expected.detailDescription !== undefined) {
|
1342
|
+
assert_1.default.strictEqual((_a = actual.labelDetails) === null || _a === void 0 ? void 0 : _a.description, expected.detailDescription);
|
1343
|
+
}
|
1344
|
+
}
|
1345
|
+
}
|
1346
|
+
exports.TestState = TestState;
|
1347
|
+
function parseAndGetTestState(code, projectRoot = '/', anonymousFileName = 'unnamedFile.py') {
|
1348
|
+
const data = (0, fourSlashParser_1.parseTestData)((0, pathUtils_1.normalizeSlashes)(projectRoot), code, anonymousFileName);
|
1349
|
+
const state = new TestState((0, pathUtils_1.normalizeSlashes)('/'), data);
|
1350
|
+
return { data, state };
|
1351
|
+
}
|
1352
|
+
exports.parseAndGetTestState = parseAndGetTestState;
|
1353
|
+
function getNodeForRange(codeOrState, markerName = 'marker') {
|
1354
|
+
const state = (0, core_1.isString)(codeOrState) ? parseAndGetTestState(codeOrState).state : codeOrState;
|
1355
|
+
const range = state.getRangeByMarkerName(markerName);
|
1356
|
+
(0, assert_1.default)(range);
|
1357
|
+
const textRange = textRange_1.TextRange.fromBounds(range.pos, range.end);
|
1358
|
+
const node = getNodeAtMarker(state, markerName);
|
1359
|
+
let current = node;
|
1360
|
+
while (current) {
|
1361
|
+
if (textRange_1.TextRange.containsRange(current, textRange)) {
|
1362
|
+
return current;
|
1363
|
+
}
|
1364
|
+
current = current.parent;
|
1365
|
+
}
|
1366
|
+
return node;
|
1367
|
+
}
|
1368
|
+
exports.getNodeForRange = getNodeForRange;
|
1369
|
+
function getNodeAtMarker(codeOrState, markerName = 'marker') {
|
1370
|
+
const state = (0, core_1.isString)(codeOrState) ? parseAndGetTestState(codeOrState).state : codeOrState;
|
1371
|
+
const marker = state.getMarkerByName(markerName);
|
1372
|
+
const sourceFile = state.program.getBoundSourceFile(marker.fileName);
|
1373
|
+
(0, assert_1.default)(sourceFile);
|
1374
|
+
const parserResults = sourceFile.getParseResults();
|
1375
|
+
(0, assert_1.default)(parserResults);
|
1376
|
+
const node = (0, parseTreeUtils_1.findNodeByOffset)(parserResults.parseTree, marker.position);
|
1377
|
+
(0, assert_1.default)(node);
|
1378
|
+
return node;
|
1379
|
+
}
|
1380
|
+
exports.getNodeAtMarker = getNodeAtMarker;
|
1381
|
+
//# sourceMappingURL=testState.js.map
|