@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,884 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* renameModuleProvider.ts
|
4
|
+
* Copyright (c) Microsoft Corporation.
|
5
|
+
* Licensed under the MIT license.
|
6
|
+
*
|
7
|
+
* Logic that updates affected references of a module rename/move.
|
8
|
+
*/
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
+
exports.RenameModuleProvider = void 0;
|
11
|
+
const vscode_languageserver_1 = require("vscode-languageserver");
|
12
|
+
const analyzerNodeInfo_1 = require("../analyzer/analyzerNodeInfo");
|
13
|
+
const declaration_1 = require("../analyzer/declaration");
|
14
|
+
const declarationUtils_1 = require("../analyzer/declarationUtils");
|
15
|
+
const importResolver_1 = require("../analyzer/importResolver");
|
16
|
+
const importStatementUtils_1 = require("../analyzer/importStatementUtils");
|
17
|
+
const parseTreeUtils_1 = require("../analyzer/parseTreeUtils");
|
18
|
+
const parseTreeWalker_1 = require("../analyzer/parseTreeWalker");
|
19
|
+
const sourceMapper_1 = require("../analyzer/sourceMapper");
|
20
|
+
const collectionUtils_1 = require("../common/collectionUtils");
|
21
|
+
const core_1 = require("../common/core");
|
22
|
+
const debug_1 = require("../common/debug");
|
23
|
+
const pathUtils_1 = require("../common/pathUtils");
|
24
|
+
const positionUtils_1 = require("../common/positionUtils");
|
25
|
+
const textRange_1 = require("../common/textRange");
|
26
|
+
const parseNodes_1 = require("../parser/parseNodes");
|
27
|
+
const documentSymbolCollector_1 = require("./documentSymbolCollector");
|
28
|
+
var UpdateType;
|
29
|
+
(function (UpdateType) {
|
30
|
+
UpdateType[UpdateType["File"] = 0] = "File";
|
31
|
+
UpdateType[UpdateType["Folder"] = 1] = "Folder";
|
32
|
+
UpdateType[UpdateType["Symbol"] = 2] = "Symbol";
|
33
|
+
})(UpdateType || (UpdateType = {}));
|
34
|
+
class RenameModuleProvider {
|
35
|
+
constructor(_fs, _evaluator, _moduleFilePath, newModuleFilePath, _moduleNameAndType, _newModuleNameAndType, _type, _declarations, _token) {
|
36
|
+
this._fs = _fs;
|
37
|
+
this._evaluator = _evaluator;
|
38
|
+
this._moduleFilePath = _moduleFilePath;
|
39
|
+
this._moduleNameAndType = _moduleNameAndType;
|
40
|
+
this._newModuleNameAndType = _newModuleNameAndType;
|
41
|
+
this._type = _type;
|
42
|
+
this._declarations = _declarations;
|
43
|
+
this._token = _token;
|
44
|
+
this._results = new Map();
|
45
|
+
this._aliasIntroduced = new Set();
|
46
|
+
// moduleName and newModuleName are always in the absolute path form.
|
47
|
+
this._newModuleFilePath = (0, pathUtils_1.resolvePaths)(newModuleFilePath);
|
48
|
+
this._moduleNames = this._moduleName.split('.');
|
49
|
+
this._newModuleNames = this._newModuleName.split('.');
|
50
|
+
if (this._moduleNames.length !== this._newModuleNames.length) {
|
51
|
+
this._onlyNameChanged = false;
|
52
|
+
return;
|
53
|
+
}
|
54
|
+
let i = 0;
|
55
|
+
for (i = 0; i < this._moduleNames.length - 1; i++) {
|
56
|
+
if (this._moduleNames[i] !== this._newModuleNames[i]) {
|
57
|
+
break;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
this._onlyNameChanged = i === this._moduleNames.length - 1;
|
61
|
+
(0, debug_1.assert)(this._type !== UpdateType.Folder || this._onlyNameChanged, 'We only support simple rename for folder');
|
62
|
+
}
|
63
|
+
static createForModule(importResolver, configOptions, evaluator, path, newPath, token) {
|
64
|
+
if (!importResolver.fileSystem.existsSync(path)) {
|
65
|
+
return undefined;
|
66
|
+
}
|
67
|
+
if ((0, pathUtils_1.isFile)(importResolver.fileSystem, path)) {
|
68
|
+
return this._create(importResolver, configOptions, evaluator, path, newPath, UpdateType.File, token);
|
69
|
+
}
|
70
|
+
else if ((0, pathUtils_1.isDirectory)(importResolver.fileSystem, path)) {
|
71
|
+
// Make sure folder path is simple rename.
|
72
|
+
if ((0, pathUtils_1.getDirectoryChangeKind)(importResolver.fileSystem, path, newPath) !== 'Renamed') {
|
73
|
+
return undefined;
|
74
|
+
}
|
75
|
+
// We don't support namespace folder name. Currently, we don't have
|
76
|
+
// a way to find namespace folder references.
|
77
|
+
let fileNameForPackage = (0, pathUtils_1.combinePaths)(path, '__init__.pyi');
|
78
|
+
if (!importResolver.fileSystem.existsSync(fileNameForPackage)) {
|
79
|
+
fileNameForPackage = (0, pathUtils_1.combinePaths)(path, '__init__.py');
|
80
|
+
if (!importResolver.fileSystem.existsSync(fileNameForPackage)) {
|
81
|
+
return undefined;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
return this._create(importResolver, configOptions, evaluator, fileNameForPackage, (0, pathUtils_1.combinePaths)(newPath, (0, pathUtils_1.getFileName)(fileNameForPackage)), UpdateType.Folder, token);
|
85
|
+
}
|
86
|
+
return undefined;
|
87
|
+
}
|
88
|
+
static createForSymbol(importResolver, configOptions, evaluator, path, newPath, declarations, token) {
|
89
|
+
if (!importResolver.fileSystem.existsSync(path)) {
|
90
|
+
return undefined;
|
91
|
+
}
|
92
|
+
const filteredDecls = declarations.filter((d) => (0, declaration_1.isClassDeclaration)(d) || (0, declaration_1.isFunctionDeclaration)(d) || (0, declaration_1.isVariableDeclaration)(d));
|
93
|
+
if (filteredDecls.length === 0) {
|
94
|
+
return undefined;
|
95
|
+
}
|
96
|
+
return this._create(importResolver, configOptions, evaluator, path, newPath, UpdateType.Symbol, filteredDecls, token);
|
97
|
+
}
|
98
|
+
static getRenameModulePath(declarations) {
|
99
|
+
// If we have a decl with no node, we will prefer that decl over others.
|
100
|
+
// The decl with no node is a synthesized alias decl created only for IDE case
|
101
|
+
// that should point to the right module file.
|
102
|
+
const bestDecl = declarations.find((d) => !d.node);
|
103
|
+
if (bestDecl) {
|
104
|
+
return bestDecl.path;
|
105
|
+
}
|
106
|
+
// Otherwise, prefer stub if we have one. or just return first decl.
|
107
|
+
const declarationPaths = [...declarations.reduce((s, d) => s.add(d.path), new Set())];
|
108
|
+
const stubIndex = declarationPaths.findIndex((d) => (0, sourceMapper_1.isStubFile)(d));
|
109
|
+
if (stubIndex >= 0) {
|
110
|
+
return declarationPaths[stubIndex];
|
111
|
+
}
|
112
|
+
return declarationPaths[0];
|
113
|
+
}
|
114
|
+
static getRenameModulePathInfo(declarationPath, newName) {
|
115
|
+
const filePath = getFilePathToRename(declarationPath);
|
116
|
+
const newFilePath = replaceFileName(filePath, newName);
|
117
|
+
return { filePath, newFilePath };
|
118
|
+
function getFilePathToRename(filePath) {
|
119
|
+
const fileName = (0, pathUtils_1.stripFileExtension)((0, pathUtils_1.getFileName)(filePath));
|
120
|
+
if (fileName === '__init__') {
|
121
|
+
return (0, pathUtils_1.getDirectoryPath)(filePath);
|
122
|
+
}
|
123
|
+
return filePath;
|
124
|
+
}
|
125
|
+
function replaceFileName(filePath, newName) {
|
126
|
+
const ext = (0, pathUtils_1.getFileExtension)(filePath);
|
127
|
+
const directory = (0, pathUtils_1.getDirectoryPath)(filePath);
|
128
|
+
return (0, pathUtils_1.combinePaths)(directory, `${newName}${ext}`);
|
129
|
+
}
|
130
|
+
}
|
131
|
+
static _create(importResolver, configOptions, evaluator, moduleFilePath, newModuleFilePath, type, tokenOrDeclarations, token) {
|
132
|
+
const execEnv = configOptions.findExecEnvironment(moduleFilePath);
|
133
|
+
const moduleName = importResolver.getModuleNameForImport(moduleFilePath, execEnv);
|
134
|
+
if (!moduleName.moduleName) {
|
135
|
+
return undefined;
|
136
|
+
}
|
137
|
+
const newModuleName = importResolver.getModuleNameForImport(newModuleFilePath, execEnv);
|
138
|
+
if (!newModuleName.moduleName) {
|
139
|
+
return undefined;
|
140
|
+
}
|
141
|
+
token = vscode_languageserver_1.CancellationToken.is(tokenOrDeclarations) ? tokenOrDeclarations : token;
|
142
|
+
const declarations = vscode_languageserver_1.CancellationToken.is(tokenOrDeclarations) ? [] : tokenOrDeclarations;
|
143
|
+
if (declarations.length === 0) {
|
144
|
+
// Create synthesized alias decls from the given file path. If the given file is for stub,
|
145
|
+
// create one for the corresponding py file as well.
|
146
|
+
declarations.push((0, declarationUtils_1.createSynthesizedAliasDeclaration)(moduleFilePath));
|
147
|
+
if ((0, sourceMapper_1.isStubFile)(moduleFilePath)) {
|
148
|
+
// The resolveImport should make sure non stub file search to happen.
|
149
|
+
importResolver.resolveImport(moduleFilePath, execEnv, (0, importResolver_1.createImportedModuleDescriptor)(moduleName.moduleName));
|
150
|
+
importResolver
|
151
|
+
.getSourceFilesFromStub(moduleFilePath, execEnv, /* mapCompiled */ false)
|
152
|
+
.forEach((p) => declarations.push((0, declarationUtils_1.createSynthesizedAliasDeclaration)(p)));
|
153
|
+
}
|
154
|
+
}
|
155
|
+
return new RenameModuleProvider(importResolver.fileSystem, evaluator, moduleFilePath, newModuleFilePath, moduleName, newModuleName, type, declarations, token);
|
156
|
+
}
|
157
|
+
renameReferences(filePath, parseResults) {
|
158
|
+
switch (this._type) {
|
159
|
+
case UpdateType.Folder:
|
160
|
+
return this._renameFolderReferences(filePath, parseResults);
|
161
|
+
case UpdateType.File:
|
162
|
+
return this._renameModuleReferences(filePath, parseResults);
|
163
|
+
case UpdateType.Symbol:
|
164
|
+
return this._updateSymbolReferences(filePath, parseResults);
|
165
|
+
default:
|
166
|
+
return (0, debug_1.assertNever)(this._type, `${this._type} is unknown`);
|
167
|
+
}
|
168
|
+
}
|
169
|
+
_updateSymbolReferences(filePath, parseResults) {
|
170
|
+
var _a, _b, _c, _d;
|
171
|
+
const collector = new documentSymbolCollector_1.DocumentSymbolCollector((_a = (0, declarationUtils_1.getNameFromDeclaration)(this._declarations[0])) !== null && _a !== void 0 ? _a : '', this._declarations, this._evaluator, this._token, parseResults.parseTree,
|
172
|
+
/* treatModuleImportAndFromImportSame */ true,
|
173
|
+
/* skipUnreachableCode */ false);
|
174
|
+
// See if we need to insert new import statement
|
175
|
+
const importStatements = (0, importStatementUtils_1.getTopLevelImports)(parseResults.parseTree, /* includeImplicitImports */ true);
|
176
|
+
// See whether we have existing import statement for the same module
|
177
|
+
// ex) import [moduleName] or from ... import [moduleName]
|
178
|
+
const imported = importStatements.orderedImports.find((i) => i.moduleName === this._newModuleName);
|
179
|
+
const nameRemoved = new Set();
|
180
|
+
const importUsed = new Map();
|
181
|
+
for (const result of collector.collect()) {
|
182
|
+
const nodeFound = result.node;
|
183
|
+
if (nodeFound.nodeType === 49 /* String */) {
|
184
|
+
// Ignore symbol appearing in the __all__. it should be handled
|
185
|
+
// when decl is moved.
|
186
|
+
continue;
|
187
|
+
}
|
188
|
+
if ((0, parseTreeUtils_1.isFromImportName)(nodeFound)) {
|
189
|
+
// ex) from ... import [symbol] ...
|
190
|
+
const fromNode = (_b = nodeFound.parent) === null || _b === void 0 ? void 0 : _b.parent;
|
191
|
+
const newModuleName = this._getNewModuleName(filePath, fromNode.module.leadingDots > 0,
|
192
|
+
/* isLastPartImportName */ false);
|
193
|
+
if (fromNode.imports.length === 1) {
|
194
|
+
// ex) "from [module] import symbol" to "from [module.changed] import symbol"
|
195
|
+
this._addResultWithTextRange(filePath, fromNode.module, parseResults, newModuleName);
|
196
|
+
}
|
197
|
+
else {
|
198
|
+
// ex) "from module import symbol, another_symbol" to
|
199
|
+
// "from module import another_symbol" and "from module.changed import symbol"
|
200
|
+
// Delete the existing import name including alias.
|
201
|
+
const importFromAs = nodeFound.parent;
|
202
|
+
this._addFromImportNameDeletion(filePath, parseResults, nameRemoved, fromNode.imports, importFromAs);
|
203
|
+
// For now, this won't merge absolute and relative path "from import" statement.
|
204
|
+
const importNameInfo = {
|
205
|
+
name: importFromAs.name.value,
|
206
|
+
alias: (_c = importFromAs.alias) === null || _c === void 0 ? void 0 : _c.value,
|
207
|
+
};
|
208
|
+
this._addResultEdits(this._getTextEditsForNewOrExistingFromImport(filePath, fromNode, parseResults, nameRemoved, importStatements, newModuleName, [importNameInfo]));
|
209
|
+
}
|
210
|
+
continue;
|
211
|
+
}
|
212
|
+
const dottedName = (0, parseTreeUtils_1.getDottedNameWithGivenNodeAsLastName)(nodeFound);
|
213
|
+
if (dottedName === nodeFound || dottedName.nodeType !== 35 /* MemberAccess */) {
|
214
|
+
// ex) from module import foo
|
215
|
+
// foo
|
216
|
+
// foo.method()
|
217
|
+
//
|
218
|
+
// from module import *
|
219
|
+
// foo()
|
220
|
+
// bar()
|
221
|
+
//
|
222
|
+
// we don't need to do anything for wild card case since
|
223
|
+
// we will preserve __all__ entries.
|
224
|
+
continue;
|
225
|
+
}
|
226
|
+
const moduleName = dottedName.leftExpression.nodeType === 35 /* MemberAccess */
|
227
|
+
? dottedName.leftExpression.memberName
|
228
|
+
: dottedName.leftExpression.nodeType === 38 /* Name */
|
229
|
+
? dottedName.leftExpression
|
230
|
+
: undefined;
|
231
|
+
if (!moduleName) {
|
232
|
+
// ex) from module import foo
|
233
|
+
// getModule().foo
|
234
|
+
continue;
|
235
|
+
}
|
236
|
+
const moduleDecl = (_d = this._evaluator
|
237
|
+
.getDeclarationsForNameNode(moduleName)) === null || _d === void 0 ? void 0 : _d.filter((d) => (0, declaration_1.isAliasDeclaration)(d) &&
|
238
|
+
(d.node.nodeType === 21 /* ImportAs */ || d.node.nodeType === 23 /* ImportFromAs */));
|
239
|
+
if (!moduleDecl || moduleDecl.length === 0) {
|
240
|
+
// ex) from xxx import yyy
|
241
|
+
// yyy.property.foo
|
242
|
+
continue;
|
243
|
+
}
|
244
|
+
const importAs = moduleDecl[0].node;
|
245
|
+
(0, collectionUtils_1.getOrAdd)(importUsed, importAs, () => []).push(dottedName);
|
246
|
+
continue;
|
247
|
+
}
|
248
|
+
// Handle symbol references that are used off imported modules.
|
249
|
+
for (const [key, value] of importUsed) {
|
250
|
+
let referenceModuleName;
|
251
|
+
if (this._canReplaceImportName(parseResults, key, value)) {
|
252
|
+
const moduleName = this._getReferenceModuleName(importStatements, imported);
|
253
|
+
if (key.nodeType === 21 /* ImportAs */) {
|
254
|
+
if (moduleName) {
|
255
|
+
referenceModuleName = moduleName;
|
256
|
+
this._addImportNameDeletion(filePath, parseResults, nameRemoved, key.parent.list, key);
|
257
|
+
}
|
258
|
+
else {
|
259
|
+
referenceModuleName = key.alias ? key.alias.value : this._newModuleName;
|
260
|
+
this._addResultWithTextRange(filePath, key.module, parseResults, this._newModuleName);
|
261
|
+
}
|
262
|
+
}
|
263
|
+
else {
|
264
|
+
if (moduleName) {
|
265
|
+
referenceModuleName = moduleName;
|
266
|
+
this._addFromImportNameDeletion(filePath, parseResults, nameRemoved, key.parent.imports, key);
|
267
|
+
}
|
268
|
+
else {
|
269
|
+
const fromNode = key.parent;
|
270
|
+
const newModuleName = this._getNewModuleName(filePath, fromNode.module.leadingDots > 0,
|
271
|
+
/* isLastPartImportName */ true);
|
272
|
+
referenceModuleName = key.alias ? key.alias.value : this._newLastModuleName;
|
273
|
+
this._addResultWithTextRange(filePath, fromNode.module, parseResults, newModuleName);
|
274
|
+
this._addResultWithTextRange(filePath, key.name, parseResults, this._newLastModuleName);
|
275
|
+
}
|
276
|
+
}
|
277
|
+
}
|
278
|
+
else {
|
279
|
+
const moduleName = this._getReferenceModuleName(importStatements, imported);
|
280
|
+
if (moduleName) {
|
281
|
+
referenceModuleName = moduleName;
|
282
|
+
}
|
283
|
+
else {
|
284
|
+
referenceModuleName = this._newModuleName;
|
285
|
+
this._addResultEdits((0, importStatementUtils_1.getTextEditsForAutoImportInsertion)([], importStatements, this._newModuleName, (0, importStatementUtils_1.getImportGroupFromModuleNameAndType)(this._newModuleNameAndType), parseResults, (0, positionUtils_1.convertOffsetToPosition)(parseResults.parseTree.length, parseResults.tokenizerOutput.lines)).map((e) => ({ filePath, range: e.range, replacementText: e.replacementText })));
|
286
|
+
}
|
287
|
+
}
|
288
|
+
for (const node of value) {
|
289
|
+
this._addResultWithTextRange(filePath, node.leftExpression, parseResults, referenceModuleName);
|
290
|
+
}
|
291
|
+
}
|
292
|
+
}
|
293
|
+
_getReferenceModuleName(importStatements, imported) {
|
294
|
+
var _a, _b;
|
295
|
+
if (imported && imported.node.nodeType === 20 /* Import */) {
|
296
|
+
return ((_a = imported.subnode) === null || _a === void 0 ? void 0 : _a.alias) ? imported.subnode.alias.value : this._newModuleName;
|
297
|
+
}
|
298
|
+
else if ((_b = importStatements.implicitImports) === null || _b === void 0 ? void 0 : _b.has(this._newModuleFilePath)) {
|
299
|
+
const fromImportAs = importStatements.implicitImports.get(this._newModuleFilePath);
|
300
|
+
return fromImportAs.alias ? fromImportAs.alias.value : fromImportAs.name.value;
|
301
|
+
}
|
302
|
+
return undefined;
|
303
|
+
}
|
304
|
+
_canReplaceImportName(parseResults, importAs, symbolReferences) {
|
305
|
+
var _a;
|
306
|
+
const nameToBind = (_a = importAs.alias) !== null && _a !== void 0 ? _a : (importAs.nodeType === 21 /* ImportAs */
|
307
|
+
? importAs.module.nameParts[importAs.module.nameParts.length - 1]
|
308
|
+
: importAs.name);
|
309
|
+
const declarations = documentSymbolCollector_1.DocumentSymbolCollector.getDeclarationsForNode(nameToBind, this._evaluator,
|
310
|
+
/* resolveLocalName */ false, this._token);
|
311
|
+
if (declarations.length === 0) {
|
312
|
+
return false;
|
313
|
+
}
|
314
|
+
const collector = new documentSymbolCollector_1.DocumentSymbolCollector(nameToBind.value, declarations, this._evaluator, this._token, parseResults.parseTree,
|
315
|
+
/* treatModuleImportAndFromImportSame */ true,
|
316
|
+
/* skipUnreachableCode */ false);
|
317
|
+
for (const result of collector.collect()) {
|
318
|
+
if ((0, parseTreeUtils_1.isImportModuleName)(result.node) ||
|
319
|
+
(0, parseTreeUtils_1.isImportAlias)(result.node) ||
|
320
|
+
(0, parseTreeUtils_1.isFromImportModuleName)(result.node) ||
|
321
|
+
(0, parseTreeUtils_1.isFromImportName)(result.node) ||
|
322
|
+
(0, parseTreeUtils_1.isFromImportAlias)(result.node)) {
|
323
|
+
// collector will report decls as well. ignore decls.
|
324
|
+
continue;
|
325
|
+
}
|
326
|
+
if (!symbolReferences.some((s) => textRange_1.TextRange.containsRange(s, result.node))) {
|
327
|
+
return false;
|
328
|
+
}
|
329
|
+
}
|
330
|
+
return true;
|
331
|
+
}
|
332
|
+
_renameFolderReferences(filePath, parseResults) {
|
333
|
+
const collector = new documentSymbolCollector_1.DocumentSymbolCollector(this.lastModuleName, this._declarations, this._evaluator, this._token, parseResults.parseTree,
|
334
|
+
/* treatModuleImportAndFromImportSame */ true,
|
335
|
+
/* skipUnreachableCode */ false);
|
336
|
+
// We only support simple rename of folder. Change all occurrence of the old folder name
|
337
|
+
// to new name.
|
338
|
+
for (const result of collector.collect()) {
|
339
|
+
this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName);
|
340
|
+
}
|
341
|
+
}
|
342
|
+
_renameModuleReferences(filePath, parseResults) {
|
343
|
+
const collector = new documentSymbolCollector_1.DocumentSymbolCollector(this.lastModuleName, this._declarations, this._evaluator, this._token, parseResults.parseTree,
|
344
|
+
/* treatModuleImportAndFromImportSame */ true,
|
345
|
+
/* skipUnreachableCode */ false);
|
346
|
+
const nameRemoved = new Set();
|
347
|
+
const results = collector.collect();
|
348
|
+
// Update module references first.
|
349
|
+
this._updateModuleReferences(filePath, parseResults, nameRemoved, results);
|
350
|
+
// If the module file has moved, we need to update all relative paths used in the file to reflect the move.
|
351
|
+
this._updateRelativeModuleNamePath(filePath, parseResults, nameRemoved, results);
|
352
|
+
}
|
353
|
+
_updateRelativeModuleNamePath(filePath, parseResults, nameRemoved, results) {
|
354
|
+
if (filePath !== this._moduleFilePath) {
|
355
|
+
// We only update relative import paths for the file that has moved.
|
356
|
+
return;
|
357
|
+
}
|
358
|
+
let importStatements;
|
359
|
+
// Filter out module name that is already re-written.
|
360
|
+
for (const edit of this._getNewRelativeModuleNamesForFileMoved(filePath, ModuleNameCollector.collect(parseResults.parseTree).filter((m) => !results.some((r) => textRange_1.TextRange.containsRange(m.parent, r.node))))) {
|
361
|
+
this._addResultWithTextRange(filePath, edit.moduleName, parseResults, edit.newModuleName);
|
362
|
+
if (!edit.itemsToMove) {
|
363
|
+
continue;
|
364
|
+
}
|
365
|
+
// This could introduce multiple import statements for same modules with
|
366
|
+
// different symbols per module name. Unfortunately, there is no easy way to
|
367
|
+
// prevent it since we can't see changes made by other code until all changes
|
368
|
+
// are committed. In future, if we support snapshot and diff between snapshots,
|
369
|
+
// then we can support those complex code generations.
|
370
|
+
const fromNode = edit.moduleName.parent;
|
371
|
+
// First, delete existing exported symbols from "from import" statement.
|
372
|
+
for (const importFromAs of edit.itemsToMove) {
|
373
|
+
this._addFromImportNameDeletion(filePath, parseResults, nameRemoved, fromNode.imports, importFromAs);
|
374
|
+
}
|
375
|
+
importStatements =
|
376
|
+
importStatements !== null && importStatements !== void 0 ? importStatements : (0, importStatementUtils_1.getTopLevelImports)(parseResults.parseTree, /* includeImplicitImports */ false);
|
377
|
+
// For now, this won't merge absolute and relative path "from import"
|
378
|
+
// statement.
|
379
|
+
this._addResultEdits(this._getTextEditsForNewOrExistingFromImport(filePath, fromNode, parseResults, nameRemoved, importStatements, (0, importStatementUtils_1.getRelativeModuleName)(this._fs, this._newModuleFilePath, this._newModuleFilePath,
|
380
|
+
/* ignoreFolderStructure */ false,
|
381
|
+
/* sourceIsFile */ true), edit.itemsToMove.map((i) => {
|
382
|
+
var _a;
|
383
|
+
return { name: i.name.value, alias: (_a = i.alias) === null || _a === void 0 ? void 0 : _a.value };
|
384
|
+
})));
|
385
|
+
}
|
386
|
+
}
|
387
|
+
_updateModuleReferences(filePath, parseResults, nameRemoved, results) {
|
388
|
+
var _a, _b, _c, _d, _e;
|
389
|
+
let importStatements;
|
390
|
+
for (const result of results) {
|
391
|
+
const nodeFound = result.node;
|
392
|
+
if (nodeFound.nodeType === 49 /* String */) {
|
393
|
+
// ex) __all__ = ["[a]"]
|
394
|
+
this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName);
|
395
|
+
continue;
|
396
|
+
}
|
397
|
+
if ((0, parseTreeUtils_1.isImportModuleName)(nodeFound)) {
|
398
|
+
if (!(0, parseTreeUtils_1.isLastNameOfModuleName)(nodeFound)) {
|
399
|
+
// It must be directory and we don't support folder rename.
|
400
|
+
continue;
|
401
|
+
}
|
402
|
+
const moduleNameNode = (0, parseTreeUtils_1.getFirstAncestorOrSelfOfKind)(nodeFound, 37 /* ModuleName */);
|
403
|
+
// * Enhancement * one case we don't handle is introducing new symbol in __all__
|
404
|
+
// or converting "import" statement to "from import" statement.
|
405
|
+
//
|
406
|
+
// when the existing statement was "import x as x" and it is changed to
|
407
|
+
// "import y.z as z". we either need to introduce "z" in __all__ or convert
|
408
|
+
// "import y.z as z" to "from y import z as z" to make sure we keep the symbol
|
409
|
+
// visibility same.
|
410
|
+
//
|
411
|
+
// when we convert "import x as x" to "from y import z as z", we need to handle
|
412
|
+
// deletion of existing import statement or (x as x) and inserting/merging
|
413
|
+
// new "from import" statement.
|
414
|
+
// If original module name was single word and it becomes dotted name without alias,
|
415
|
+
// then we introduce alias to keep references as a single word.
|
416
|
+
// ex) import [xxx] to import [aaa.bbb as bbb]
|
417
|
+
if (moduleNameNode.nameParts.length === 1 &&
|
418
|
+
((_a = moduleNameNode.parent) === null || _a === void 0 ? void 0 : _a.nodeType) === 21 /* ImportAs */ &&
|
419
|
+
!moduleNameNode.parent.alias &&
|
420
|
+
this._newModuleNames.length > 1) {
|
421
|
+
this._aliasIntroduced.add(moduleNameNode.parent);
|
422
|
+
this._addResultWithTextRange(filePath, moduleNameNode, parseResults, `${this._newModuleName} as ${this._newLastModuleName}`);
|
423
|
+
continue;
|
424
|
+
}
|
425
|
+
// Otherwise, update whole module name to new name
|
426
|
+
// ex) import [xxx.yyy] to import [aaa.bbb]
|
427
|
+
this._addResultWithTextRange(filePath, moduleNameNode, parseResults, this._newModuleName);
|
428
|
+
continue;
|
429
|
+
}
|
430
|
+
if ((0, parseTreeUtils_1.isImportAlias)(nodeFound)) {
|
431
|
+
// ex) import xxx as [yyy] to import xxx as [zzz]
|
432
|
+
this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName);
|
433
|
+
continue;
|
434
|
+
}
|
435
|
+
if ((0, parseTreeUtils_1.isFromImportModuleName)(nodeFound)) {
|
436
|
+
if (!(0, parseTreeUtils_1.isLastNameOfModuleName)(nodeFound)) {
|
437
|
+
// It must be directory and we don't support folder rename.
|
438
|
+
continue;
|
439
|
+
}
|
440
|
+
const moduleNameNode = (0, parseTreeUtils_1.getFirstAncestorOrSelfOfKind)(nodeFound, 37 /* ModuleName */);
|
441
|
+
const fromNode = moduleNameNode.parent;
|
442
|
+
// We need to check whether imports of this import statement has
|
443
|
+
// any implicit submodule imports or not. If there is one, we need to
|
444
|
+
// either split or leave it as it is.
|
445
|
+
const exportedSymbols = [];
|
446
|
+
const subModules = [];
|
447
|
+
for (const importFromAs of fromNode.imports) {
|
448
|
+
if (this._isExportedSymbol(importFromAs.name)) {
|
449
|
+
exportedSymbols.push(importFromAs);
|
450
|
+
}
|
451
|
+
else {
|
452
|
+
subModules.push(importFromAs);
|
453
|
+
}
|
454
|
+
}
|
455
|
+
if (subModules.length === 0) {
|
456
|
+
// We don't have any sub modules, we can change module name to new one.
|
457
|
+
// Update whole module name to new name.
|
458
|
+
// ex) from [xxx.yyy] import zzz to from [aaa.bbb] import zzz
|
459
|
+
this._addResultWithTextRange(filePath, moduleNameNode, parseResults, this._getNewModuleName(filePath, moduleNameNode.leadingDots > 0,
|
460
|
+
/* isLastPartImportName */ false));
|
461
|
+
continue;
|
462
|
+
}
|
463
|
+
if (exportedSymbols.length === 0) {
|
464
|
+
// We only have sub modules. That means module name actually refers to
|
465
|
+
// folder name, not module (ex, __init__.py). Folder rename is done by
|
466
|
+
// different code path.
|
467
|
+
continue;
|
468
|
+
}
|
469
|
+
// Now, we need to split "from import" statement to 2.
|
470
|
+
// Update module name if needed.
|
471
|
+
if (fromNode.module.leadingDots > 0) {
|
472
|
+
for (const edit of this._getNewRelativeModuleNamesForFileMoved(filePath, [fromNode.module])) {
|
473
|
+
this._addResultWithTextRange(filePath, edit.moduleName, parseResults, edit.newModuleName);
|
474
|
+
}
|
475
|
+
}
|
476
|
+
// First, delete existing exported symbols from "from import" statement.
|
477
|
+
for (const importFromAs of exportedSymbols) {
|
478
|
+
this._addFromImportNameDeletion(filePath, parseResults, nameRemoved, fromNode.imports, importFromAs);
|
479
|
+
}
|
480
|
+
importStatements =
|
481
|
+
importStatements !== null && importStatements !== void 0 ? importStatements : (0, importStatementUtils_1.getTopLevelImports)(parseResults.parseTree, /* includeImplicitImports */ false);
|
482
|
+
// For now, this won't merge absolute and relative path "from import"
|
483
|
+
// statement.
|
484
|
+
this._addResultEdits(this._getTextEditsForNewOrExistingFromImport(filePath, fromNode, parseResults, nameRemoved, importStatements, this._newModuleName, exportedSymbols.map((i) => {
|
485
|
+
var _a;
|
486
|
+
const name = results.findIndex((r) => r.node === i.name) >= 0
|
487
|
+
? this._newLastModuleName
|
488
|
+
: i.name.value;
|
489
|
+
const alias = results.findIndex((r) => r.node === i.alias) >= 0
|
490
|
+
? this._newLastModuleName
|
491
|
+
: (_a = i.alias) === null || _a === void 0 ? void 0 : _a.value;
|
492
|
+
return { name, alias };
|
493
|
+
})));
|
494
|
+
continue;
|
495
|
+
}
|
496
|
+
if ((0, parseTreeUtils_1.isFromImportName)(nodeFound)) {
|
497
|
+
if (nameRemoved.has(nodeFound.id)) {
|
498
|
+
// Import name is already removed.
|
499
|
+
continue;
|
500
|
+
}
|
501
|
+
const fromNode = (_b = nodeFound.parent) === null || _b === void 0 ? void 0 : _b.parent;
|
502
|
+
const newModuleName = this._getNewModuleName(filePath, fromNode.module.leadingDots > 0,
|
503
|
+
/* isLastPartImportName */ true);
|
504
|
+
// If the name bound to symbol re-exported, we don't need to update module name.
|
505
|
+
// Existing logic should make sure re-exported symbol name work as before after
|
506
|
+
// symbol rename.
|
507
|
+
if (this._isExportedSymbol(nodeFound)) {
|
508
|
+
this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName);
|
509
|
+
continue;
|
510
|
+
}
|
511
|
+
if (fromNode.imports.length === 1) {
|
512
|
+
// ex) from xxx import [yyy] to from [aaa.bbb] import [zzz]
|
513
|
+
this._addResultWithTextRange(filePath, fromNode.module, parseResults, newModuleName);
|
514
|
+
this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName);
|
515
|
+
}
|
516
|
+
else {
|
517
|
+
// Delete the existing import name including alias.
|
518
|
+
const importFromAs = nodeFound.parent;
|
519
|
+
// Update module name if needed.
|
520
|
+
if (fromNode.module.leadingDots > 0) {
|
521
|
+
for (const edit of this._getNewRelativeModuleNamesForFileMoved(filePath, [fromNode.module])) {
|
522
|
+
this._addResultWithTextRange(filePath, edit.moduleName, parseResults, edit.newModuleName);
|
523
|
+
}
|
524
|
+
}
|
525
|
+
this._addFromImportNameDeletion(filePath, parseResults, nameRemoved, fromNode.imports, importFromAs);
|
526
|
+
importStatements =
|
527
|
+
importStatements !== null && importStatements !== void 0 ? importStatements : (0, importStatementUtils_1.getTopLevelImports)(parseResults.parseTree, /* includeImplicitImports */ false);
|
528
|
+
// ex) from xxx import yyy, [zzz] to
|
529
|
+
// from xxx import yyy
|
530
|
+
// from [aaa.bbb] import [ccc]
|
531
|
+
// or
|
532
|
+
// from aaa.bbb import ddd
|
533
|
+
// from xxx import yyy, [zzz] to
|
534
|
+
// from aaa.bbb import [ccc], ddd
|
535
|
+
//
|
536
|
+
// For now, this won't merge absolute and relative path "from import"
|
537
|
+
// statement.
|
538
|
+
const importNameInfo = {
|
539
|
+
name: this._newLastModuleName,
|
540
|
+
alias: ((_c = importFromAs.alias) === null || _c === void 0 ? void 0 : _c.value) === this.lastModuleName
|
541
|
+
? this._newLastModuleName
|
542
|
+
: (_d = importFromAs.alias) === null || _d === void 0 ? void 0 : _d.value,
|
543
|
+
};
|
544
|
+
this._addResultEdits(this._getTextEditsForNewOrExistingFromImport(filePath, fromNode, parseResults, nameRemoved, importStatements, newModuleName, [importNameInfo]));
|
545
|
+
}
|
546
|
+
continue;
|
547
|
+
}
|
548
|
+
if ((0, parseTreeUtils_1.isFromImportAlias)(nodeFound)) {
|
549
|
+
if (nameRemoved.has(nodeFound.id)) {
|
550
|
+
// alias is already removed.
|
551
|
+
continue;
|
552
|
+
}
|
553
|
+
// ex) from ccc import xxx as [yyy] to from ccc import xxx as [zzz]
|
554
|
+
this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName);
|
555
|
+
continue;
|
556
|
+
}
|
557
|
+
/** TODO: if we get more than 1 decls, flag it as attention needed */
|
558
|
+
const decls = documentSymbolCollector_1.DocumentSymbolCollector.getDeclarationsForNode(nodeFound, this._evaluator,
|
559
|
+
/* resolveLocalName */ false, this._token).filter((d) => (0, declaration_1.isAliasDeclaration)(d));
|
560
|
+
if (this._onlyNameChanged) {
|
561
|
+
// Simple case. only name has changed. but not path.
|
562
|
+
// Just replace name to new symbol name.
|
563
|
+
// ex) a.[b].foo() to a.[z].foo()
|
564
|
+
this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName);
|
565
|
+
continue;
|
566
|
+
}
|
567
|
+
if (decls === null || decls === void 0 ? void 0 : decls.some((d) => !d.usesLocalName &&
|
568
|
+
(!d.node || d.node.nodeType === 21 /* ImportAs */) &&
|
569
|
+
!this._aliasIntroduced.has(d.node))) {
|
570
|
+
const dottedName = (0, parseTreeUtils_1.getDottedNameWithGivenNodeAsLastName)(nodeFound);
|
571
|
+
if (((_e = dottedName.parent) === null || _e === void 0 ? void 0 : _e.nodeType) !== 35 /* MemberAccess */) {
|
572
|
+
// Replace whole dotted name with new module name.
|
573
|
+
this._addResultWithTextRange(filePath, dottedName, parseResults, this._newModuleName);
|
574
|
+
continue;
|
575
|
+
}
|
576
|
+
// Check whether name after me is sub module or not.
|
577
|
+
// ex) a.b.[c]
|
578
|
+
const nextNameDecl = this._evaluator.getDeclarationsForNameNode(dottedName.parent.memberName);
|
579
|
+
if (!nextNameDecl || nextNameDecl.length === 0) {
|
580
|
+
// Next dotted name is sub module. That means dottedName actually refers to folder names, not modules.
|
581
|
+
// and We don't support renaming folder. So, leave things as they are.
|
582
|
+
// ex) import a.b.c
|
583
|
+
// [a.b].[c]
|
584
|
+
continue;
|
585
|
+
}
|
586
|
+
// Next name is actual symbol. Replace whole name to new module name.
|
587
|
+
// ex) import a.b.c
|
588
|
+
// [a.b.c].[foo]()
|
589
|
+
this._addResultWithTextRange(filePath, dottedName, parseResults, this._newModuleName);
|
590
|
+
continue;
|
591
|
+
}
|
592
|
+
if (result.node.value !== this._newLastModuleName) {
|
593
|
+
this._addResultWithTextRange(filePath, result.range, parseResults, this._newLastModuleName);
|
594
|
+
continue;
|
595
|
+
}
|
596
|
+
}
|
597
|
+
}
|
598
|
+
_getNewRelativeModuleNamesForFileMoved(filePath, moduleNames) {
|
599
|
+
if (filePath !== this._moduleFilePath) {
|
600
|
+
// We only update relative import paths for the file that has moved.
|
601
|
+
return [];
|
602
|
+
}
|
603
|
+
const originalFileName = (0, pathUtils_1.stripFileExtension)((0, pathUtils_1.getFileName)(filePath));
|
604
|
+
const originalInit = originalFileName === '__init__';
|
605
|
+
const originalDirectory = (0, pathUtils_1.getDirectoryPath)(filePath);
|
606
|
+
const newNames = [];
|
607
|
+
for (const moduleName of moduleNames) {
|
608
|
+
// Filter out all absolute path.
|
609
|
+
if (moduleName.leadingDots === 0) {
|
610
|
+
continue;
|
611
|
+
}
|
612
|
+
const result = this._getNewModuleNameInfoForFileMoved(moduleName, originalInit, originalDirectory);
|
613
|
+
if (!result) {
|
614
|
+
continue;
|
615
|
+
}
|
616
|
+
const newModuleName = (0, importStatementUtils_1.getRelativeModuleName)(this._fs, result.src, result.dest,
|
617
|
+
/* ignoreFolderStructure */ false,
|
618
|
+
/* sourceIsFile */ true);
|
619
|
+
newNames.push({ moduleName, newModuleName, itemsToMove: result.itemsToMove });
|
620
|
+
}
|
621
|
+
return newNames;
|
622
|
+
}
|
623
|
+
_getNewModuleNameInfoForFileMoved(moduleName, originalInit, originalDirectory) {
|
624
|
+
const importInfo = (0, analyzerNodeInfo_1.getImportInfo)(moduleName);
|
625
|
+
if (!importInfo) {
|
626
|
+
return undefined;
|
627
|
+
}
|
628
|
+
let importPath = importInfo.resolvedPaths[importInfo.resolvedPaths.length - 1];
|
629
|
+
if (!importPath) {
|
630
|
+
// It is possible for the module name to point to namespace folder (no __init__).
|
631
|
+
// See whether we can use some heuristic to get importPath
|
632
|
+
if (moduleName.nameParts.length === 0) {
|
633
|
+
const directory = (0, importStatementUtils_1.getDirectoryLeadingDotsPointsTo)(originalDirectory, moduleName.leadingDots);
|
634
|
+
if (!directory) {
|
635
|
+
return undefined;
|
636
|
+
}
|
637
|
+
// Add fake __init__.py since we know this is namespace folder.
|
638
|
+
importPath = (0, pathUtils_1.combinePaths)(directory, '__init__.py');
|
639
|
+
}
|
640
|
+
else {
|
641
|
+
return undefined;
|
642
|
+
}
|
643
|
+
}
|
644
|
+
// Check whether module is pointing to moved file itself and whether it is __init__
|
645
|
+
if (this._moduleFilePath !== importPath || !originalInit) {
|
646
|
+
return { src: this._newModuleFilePath, dest: importPath };
|
647
|
+
}
|
648
|
+
// Now, moduleName is pointing to __init__ which point to moved file itself.
|
649
|
+
// We need to check whether imports of this import statement has
|
650
|
+
// any implicit submodule imports or not. If there is one, we need to
|
651
|
+
// either split or leave it as it is.
|
652
|
+
const exportedSymbols = [];
|
653
|
+
const subModules = [];
|
654
|
+
for (const importFromAs of moduleName.parent.imports) {
|
655
|
+
if (this._isExportedSymbol(importFromAs.name)) {
|
656
|
+
exportedSymbols.push(importFromAs);
|
657
|
+
}
|
658
|
+
else {
|
659
|
+
subModules.push(importFromAs);
|
660
|
+
}
|
661
|
+
}
|
662
|
+
// Point to itself.
|
663
|
+
if (subModules.length === 0) {
|
664
|
+
return { src: this._newModuleFilePath, dest: this._newModuleFilePath };
|
665
|
+
}
|
666
|
+
// "." is used to point folder location.
|
667
|
+
if (exportedSymbols.length === 0) {
|
668
|
+
return { src: this._newModuleFilePath, dest: this._moduleFilePath };
|
669
|
+
}
|
670
|
+
// now we need to split, provide split info as well.
|
671
|
+
return {
|
672
|
+
src: this._newModuleFilePath,
|
673
|
+
dest: this._moduleFilePath,
|
674
|
+
itemsToMove: [...exportedSymbols],
|
675
|
+
};
|
676
|
+
}
|
677
|
+
_isExportedSymbol(nameNode) {
|
678
|
+
const decls = this._evaluator.getDeclarationsForNameNode(nameNode);
|
679
|
+
if (!decls) {
|
680
|
+
return false;
|
681
|
+
}
|
682
|
+
// If submoduleFallback exists, then, it points to submodule not symbol.
|
683
|
+
return !decls.some((d) => (0, declaration_1.isAliasDeclaration)(d) && d.submoduleFallback);
|
684
|
+
}
|
685
|
+
_getNewModuleName(currentFilePath, isRelativePath, isLastPartImportName) {
|
686
|
+
const filePath = currentFilePath === this._moduleFilePath ? this._newModuleFilePath : currentFilePath;
|
687
|
+
// If the existing code was using relative path, try to keep the relative path.
|
688
|
+
const moduleName = isRelativePath
|
689
|
+
? (0, importStatementUtils_1.getRelativeModuleName)(this._fs, filePath, this._newModuleFilePath, isLastPartImportName,
|
690
|
+
/* sourceIsFile*/ true)
|
691
|
+
: this._newModuleName;
|
692
|
+
if (isLastPartImportName && moduleName.endsWith(this._newLastModuleName)) {
|
693
|
+
const dotPrefix = moduleName === this._newLastModuleName
|
694
|
+
? 0
|
695
|
+
: moduleName.length > this._newLastModuleName.length + 1
|
696
|
+
? moduleName[moduleName.length - this._newLastModuleName.length - 2] !== '.'
|
697
|
+
? 1
|
698
|
+
: 0
|
699
|
+
: 0;
|
700
|
+
const length = moduleName.length - this._newLastModuleName.length - dotPrefix;
|
701
|
+
//ex) x.y.z used in "from x.y import z"
|
702
|
+
const newModuleName = moduleName.substr(0, length);
|
703
|
+
return newModuleName.length > 0 ? newModuleName : '.';
|
704
|
+
}
|
705
|
+
// ex) x.y.z used in "from x.y.z import ..."
|
706
|
+
return moduleName;
|
707
|
+
}
|
708
|
+
getEdits() {
|
709
|
+
const edits = [];
|
710
|
+
this._results.forEach((v) => (0, collectionUtils_1.appendArray)(edits, v));
|
711
|
+
return edits;
|
712
|
+
}
|
713
|
+
get lastModuleName() {
|
714
|
+
return this._moduleNames[this._moduleNames.length - 1];
|
715
|
+
}
|
716
|
+
get _moduleName() {
|
717
|
+
return this._moduleNameAndType.moduleName;
|
718
|
+
}
|
719
|
+
get _newLastModuleName() {
|
720
|
+
return this._newModuleNames[this._newModuleNames.length - 1];
|
721
|
+
}
|
722
|
+
get _newModuleName() {
|
723
|
+
return this._newModuleNameAndType.moduleName;
|
724
|
+
}
|
725
|
+
_addImportNameDeletion(filePath, parseResults, nameRemoved, imports, importToDelete) {
|
726
|
+
this._addImportNameDeletionInternal(filePath, parseResults, nameRemoved, imports, importToDelete, 20 /* Import */);
|
727
|
+
// Mark that we don't need to process these node again later.
|
728
|
+
nameRemoved.add(importToDelete.module.id);
|
729
|
+
importToDelete.module.nameParts.forEach((n) => nameRemoved.add(n.id));
|
730
|
+
if (importToDelete.alias) {
|
731
|
+
nameRemoved.add(importToDelete.alias.id);
|
732
|
+
}
|
733
|
+
}
|
734
|
+
_addFromImportNameDeletion(filePath, parseResults, nameRemoved, imports, importToDelete) {
|
735
|
+
this._addImportNameDeletionInternal(filePath, parseResults, nameRemoved, imports, importToDelete, 22 /* ImportFrom */);
|
736
|
+
// Mark that we don't need to process these node again later.
|
737
|
+
nameRemoved.add(importToDelete.name.id);
|
738
|
+
if (importToDelete.alias) {
|
739
|
+
nameRemoved.add(importToDelete.alias.id);
|
740
|
+
}
|
741
|
+
}
|
742
|
+
_addImportNameDeletionInternal(filePath, parseResults, nameRemoved, imports, importToDelete, importKind) {
|
743
|
+
const range = (0, importStatementUtils_1.getTextRangeForImportNameDeletion)(imports, imports.findIndex((v) => v === importToDelete));
|
744
|
+
this._addResultWithTextRange(filePath, range, parseResults, '');
|
745
|
+
// Mark that we don't need to process these node again later.
|
746
|
+
nameRemoved.add(importToDelete.id);
|
747
|
+
// Check whether we have deleted all trailing import names.
|
748
|
+
// If either no trailing import is deleted or handled properly
|
749
|
+
// then, there is nothing to do. otherwise, either delete the whole statement
|
750
|
+
// or remove trailing comma.
|
751
|
+
// ex) from x import [y], z or from x import y[, z]
|
752
|
+
let lastImportIndexNotDeleted = 0;
|
753
|
+
for (lastImportIndexNotDeleted = imports.length - 1; lastImportIndexNotDeleted >= 0; lastImportIndexNotDeleted--) {
|
754
|
+
if (!nameRemoved.has(imports[lastImportIndexNotDeleted].id)) {
|
755
|
+
break;
|
756
|
+
}
|
757
|
+
}
|
758
|
+
if (lastImportIndexNotDeleted === -1) {
|
759
|
+
// Whole statement is deleted. Remove the statement itself.
|
760
|
+
// ex) [from x import a, b, c] or [import a]
|
761
|
+
const importStatement = (0, parseTreeUtils_1.getFirstAncestorOrSelfOfKind)(importToDelete, importKind);
|
762
|
+
if (importStatement) {
|
763
|
+
this._addResultWithRange(filePath, (0, parseTreeUtils_1.getFullStatementRange)(importStatement, parseResults.tokenizerOutput), '');
|
764
|
+
}
|
765
|
+
}
|
766
|
+
else if (lastImportIndexNotDeleted >= 0 && lastImportIndexNotDeleted < imports.length - 2) {
|
767
|
+
// We need to delete trailing comma
|
768
|
+
// ex) from x import a, [b, c]
|
769
|
+
const start = textRange_1.TextRange.getEnd(imports[lastImportIndexNotDeleted]);
|
770
|
+
const length = textRange_1.TextRange.getEnd(imports[lastImportIndexNotDeleted + 1]) - start;
|
771
|
+
this._addResultWithTextRange(filePath, { start, length }, parseResults, '');
|
772
|
+
}
|
773
|
+
}
|
774
|
+
_addResultWithTextRange(filePath, range, parseResults, newName) {
|
775
|
+
const existing = parseResults.text.substr(range.start, range.length);
|
776
|
+
if (existing === newName) {
|
777
|
+
// No change. Return as it is.
|
778
|
+
return;
|
779
|
+
}
|
780
|
+
this._addResultWithRange(filePath, (0, positionUtils_1.convertTextRangeToRange)(range, parseResults.tokenizerOutput.lines), newName);
|
781
|
+
}
|
782
|
+
_addResultEdits(edits) {
|
783
|
+
edits.forEach((e) => this._addResultWithRange(e.filePath, e.range, e.replacementText));
|
784
|
+
}
|
785
|
+
_getDeletionsForSpan(filePathOrEdit, range) {
|
786
|
+
var _a;
|
787
|
+
if ((0, core_1.isString)(filePathOrEdit)) {
|
788
|
+
filePathOrEdit = (_a = this._results.get(filePathOrEdit)) !== null && _a !== void 0 ? _a : [];
|
789
|
+
}
|
790
|
+
return filePathOrEdit.filter((e) => e.replacementText === '' && (0, textRange_1.doRangesIntersect)(e.range, range));
|
791
|
+
}
|
792
|
+
_removeEdits(filePathOrEdit, edits) {
|
793
|
+
var _a;
|
794
|
+
if ((0, core_1.isString)(filePathOrEdit)) {
|
795
|
+
filePathOrEdit = (_a = this._results.get(filePathOrEdit)) !== null && _a !== void 0 ? _a : [];
|
796
|
+
}
|
797
|
+
(0, collectionUtils_1.removeArrayElements)(filePathOrEdit, (f) => edits.findIndex((e) => e === f) >= 0);
|
798
|
+
}
|
799
|
+
_addResultWithRange(filePath, range, replacementText) {
|
800
|
+
const edits = (0, collectionUtils_1.getOrAdd)(this._results, filePath, () => []);
|
801
|
+
if (replacementText === '') {
|
802
|
+
// If it is a deletion, merge with overlapping deletion edit if there is any.
|
803
|
+
const deletions = this._getDeletionsForSpan(edits, range);
|
804
|
+
if (deletions.length > 0) {
|
805
|
+
// Delete the existing ones.
|
806
|
+
this._removeEdits(edits, deletions);
|
807
|
+
// Extend range with deleted ones.
|
808
|
+
(0, textRange_1.extendRange)(range, deletions.map((d) => d.range));
|
809
|
+
}
|
810
|
+
}
|
811
|
+
// Don't put duplicated edit. It can happen if code has duplicated module import.
|
812
|
+
// ex) from a import b, b, c
|
813
|
+
// If we need to introduce new "from import" statement for "b", we will add new statement twice.
|
814
|
+
if (edits.some((e) => (0, textRange_1.rangesAreEqual)(e.range, range) && e.replacementText === replacementText)) {
|
815
|
+
return;
|
816
|
+
}
|
817
|
+
edits.push({ filePath, range, replacementText });
|
818
|
+
}
|
819
|
+
_getTextEditsForNewOrExistingFromImport(filePath, currentFromImport, parseResults, nameRemoved, importStatements, moduleName, importNameInfo) {
|
820
|
+
// See whether we have existing from import statement for the same module
|
821
|
+
// ex) from [|moduleName|] import subModule
|
822
|
+
const imported = importStatements.orderedImports.find((i) => i.moduleName === moduleName);
|
823
|
+
if (imported && imported.node.nodeType === 22 /* ImportFrom */ && !imported.node.isWildcardImport) {
|
824
|
+
const edits = (0, importStatementUtils_1.getTextEditsForAutoImportSymbolAddition)(importNameInfo, imported, parseResults);
|
825
|
+
if (imported.node !== currentFromImport) {
|
826
|
+
// Add what we want to the existing "import from" statement as long as it is not the same import
|
827
|
+
// node we are working on.
|
828
|
+
return edits.map((e) => ({ filePath, range: e.range, replacementText: e.replacementText }));
|
829
|
+
}
|
830
|
+
// Check whether we can avoid creating a new statement. We can't just merge with existing one since
|
831
|
+
// we could create invalid text edits (2 edits that change the same span, or invalid replacement text since
|
832
|
+
// texts on the node has changed)
|
833
|
+
if (this._onlyNameChanged && importNameInfo.length === 1 && edits.length === 1) {
|
834
|
+
const deletions = this._getDeletionsForSpan(filePath, edits[0].range);
|
835
|
+
if (deletions.length === 0) {
|
836
|
+
return [{ filePath, range: edits[0].range, replacementText: edits[0].replacementText }];
|
837
|
+
}
|
838
|
+
else {
|
839
|
+
const alias = importNameInfo[0].alias === this._newLastModuleName
|
840
|
+
? this.lastModuleName
|
841
|
+
: importNameInfo[0].alias;
|
842
|
+
const importName = currentFromImport.imports.find((i) => { var _a; return i.name.value === this.lastModuleName && ((_a = i.alias) === null || _a === void 0 ? void 0 : _a.value) === alias; });
|
843
|
+
if (importName) {
|
844
|
+
this._removeEdits(filePath, deletions);
|
845
|
+
if (importName.alias) {
|
846
|
+
nameRemoved.delete(importName.alias.id);
|
847
|
+
}
|
848
|
+
return [
|
849
|
+
{
|
850
|
+
filePath,
|
851
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(importName.name, parseResults.tokenizerOutput.lines),
|
852
|
+
replacementText: this._newLastModuleName,
|
853
|
+
},
|
854
|
+
];
|
855
|
+
}
|
856
|
+
}
|
857
|
+
}
|
858
|
+
}
|
859
|
+
return (0, importStatementUtils_1.getTextEditsForAutoImportInsertion)(importNameInfo, importStatements, moduleName, (0, importStatementUtils_1.getImportGroupFromModuleNameAndType)(this._newModuleNameAndType), parseResults, (0, positionUtils_1.convertOffsetToPosition)(parseResults.parseTree.length, parseResults.tokenizerOutput.lines)).map((e) => ({ filePath, range: e.range, replacementText: e.replacementText }));
|
860
|
+
}
|
861
|
+
}
|
862
|
+
exports.RenameModuleProvider = RenameModuleProvider;
|
863
|
+
class ModuleNameCollector extends parseTreeWalker_1.ParseTreeWalker {
|
864
|
+
constructor() {
|
865
|
+
super(...arguments);
|
866
|
+
this._result = [];
|
867
|
+
}
|
868
|
+
walk(node) {
|
869
|
+
if ((0, parseNodes_1.isExpressionNode)(node)) {
|
870
|
+
return;
|
871
|
+
}
|
872
|
+
super.walk(node);
|
873
|
+
}
|
874
|
+
visitModuleName(node) {
|
875
|
+
this._result.push(node);
|
876
|
+
return false;
|
877
|
+
}
|
878
|
+
static collect(root) {
|
879
|
+
const collector = new ModuleNameCollector();
|
880
|
+
collector.walk(root);
|
881
|
+
return collector._result;
|
882
|
+
}
|
883
|
+
}
|
884
|
+
//# sourceMappingURL=renameModuleProvider.js.map
|