@zzzen/pyright-internal 1.2.0-dev.20231203 → 1.2.0-dev.20231217
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/analyzerFileInfo.d.ts +4 -3
- package/dist/analyzer/analyzerFileInfo.js.map +1 -1
- package/dist/analyzer/backgroundAnalysisProgram.d.ts +15 -14
- package/dist/analyzer/backgroundAnalysisProgram.js +38 -38
- package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -1
- package/dist/analyzer/binder.js +67 -62
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/checker.js +43 -33
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/circularDependency.d.ts +3 -2
- package/dist/analyzer/circularDependency.js.map +1 -1
- package/dist/analyzer/codeFlowEngine.js +47 -47
- package/dist/analyzer/codeFlowEngine.js.map +1 -1
- package/dist/analyzer/codeFlowTypes.d.ts +0 -1
- package/dist/analyzer/codeFlowTypes.js.map +1 -1
- package/dist/analyzer/constraintSolver.js +3 -5
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/dataClasses.js +1 -1
- package/dist/analyzer/dataClasses.js.map +1 -1
- package/dist/analyzer/declaration.d.ts +5 -3
- package/dist/analyzer/declaration.js +3 -2
- package/dist/analyzer/declaration.js.map +1 -1
- package/dist/analyzer/declarationUtils.d.ts +3 -2
- package/dist/analyzer/declarationUtils.js +14 -12
- package/dist/analyzer/declarationUtils.js.map +1 -1
- package/dist/analyzer/decorators.js +14 -43
- package/dist/analyzer/decorators.js.map +1 -1
- package/dist/analyzer/enums.js +1 -1
- package/dist/analyzer/enums.js.map +1 -1
- package/dist/analyzer/importResolver.d.ts +29 -25
- package/dist/analyzer/importResolver.js +300 -301
- package/dist/analyzer/importResolver.js.map +1 -1
- package/dist/analyzer/importResult.d.ts +5 -4
- package/dist/analyzer/importResult.js.map +1 -1
- package/dist/analyzer/importStatementUtils.d.ts +5 -4
- package/dist/analyzer/importStatementUtils.js +23 -22
- package/dist/analyzer/importStatementUtils.js.map +1 -1
- package/dist/analyzer/namedTuples.js +3 -3
- package/dist/analyzer/namedTuples.js.map +1 -1
- package/dist/analyzer/packageTypeReport.d.ts +7 -6
- package/dist/analyzer/packageTypeReport.js +4 -4
- package/dist/analyzer/packageTypeReport.js.map +1 -1
- package/dist/analyzer/packageTypeVerifier.js +68 -64
- package/dist/analyzer/packageTypeVerifier.js.map +1 -1
- package/dist/analyzer/parentDirectoryCache.d.ts +7 -6
- package/dist/analyzer/parentDirectoryCache.js +9 -10
- package/dist/analyzer/parentDirectoryCache.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.d.ts +1 -1
- package/dist/analyzer/parseTreeUtils.js +7 -4
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/patternMatching.js +102 -14
- package/dist/analyzer/patternMatching.js.map +1 -1
- package/dist/analyzer/program.d.ts +27 -26
- package/dist/analyzer/program.js +162 -156
- package/dist/analyzer/program.js.map +1 -1
- package/dist/analyzer/properties.js +6 -3
- package/dist/analyzer/properties.js.map +1 -1
- package/dist/analyzer/pyTypedUtils.d.ts +3 -2
- package/dist/analyzer/pyTypedUtils.js +4 -5
- package/dist/analyzer/pyTypedUtils.js.map +1 -1
- package/dist/analyzer/pythonPathUtils.d.ts +7 -6
- package/dist/analyzer/pythonPathUtils.js +21 -23
- package/dist/analyzer/pythonPathUtils.js.map +1 -1
- package/dist/analyzer/service.d.ts +24 -23
- package/dist/analyzer/service.js +190 -184
- package/dist/analyzer/service.js.map +1 -1
- package/dist/analyzer/sourceFile.d.ts +4 -5
- package/dist/analyzer/sourceFile.js +68 -56
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/sourceFileInfoUtils.js +3 -3
- package/dist/analyzer/sourceFileInfoUtils.js.map +1 -1
- package/dist/analyzer/sourceMapper.d.ts +11 -10
- package/dist/analyzer/sourceMapper.js +61 -63
- package/dist/analyzer/sourceMapper.js.map +1 -1
- package/dist/analyzer/sourceMapperUtils.d.ts +2 -1
- package/dist/analyzer/sourceMapperUtils.js +2 -2
- package/dist/analyzer/sourceMapperUtils.js.map +1 -1
- package/dist/analyzer/tracePrinter.d.ts +3 -2
- package/dist/analyzer/tracePrinter.js +21 -23
- package/dist/analyzer/tracePrinter.js.map +1 -1
- package/dist/analyzer/typeDocStringUtils.d.ts +2 -1
- package/dist/analyzer/typeDocStringUtils.js +14 -17
- package/dist/analyzer/typeDocStringUtils.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +259 -152
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeGuards.d.ts +1 -0
- package/dist/analyzer/typeGuards.js +5 -4
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typePrinter.d.ts +2 -0
- package/dist/analyzer/typePrinter.js +48 -8
- package/dist/analyzer/typePrinter.js.map +1 -1
- package/dist/analyzer/typeStubWriter.d.ts +2 -1
- package/dist/analyzer/typeStubWriter.js +2 -2
- package/dist/analyzer/typeStubWriter.js.map +1 -1
- package/dist/analyzer/typeUtils.d.ts +5 -2
- package/dist/analyzer/typeUtils.js +37 -10
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/typedDicts.js +4 -4
- package/dist/analyzer/typedDicts.js.map +1 -1
- package/dist/analyzer/types.d.ts +10 -6
- package/dist/analyzer/types.js +7 -5
- package/dist/analyzer/types.js.map +1 -1
- package/dist/backgroundAnalysis.d.ts +1 -2
- package/dist/backgroundAnalysis.js +6 -4
- package/dist/backgroundAnalysis.js.map +1 -1
- package/dist/backgroundAnalysisBase.d.ts +22 -20
- package/dist/backgroundAnalysisBase.js +76 -55
- package/dist/backgroundAnalysisBase.js.map +1 -1
- package/dist/backgroundThreadBase.d.ts +1 -1
- package/dist/backgroundThreadBase.js +20 -11
- package/dist/backgroundThreadBase.js.map +1 -1
- package/dist/commands/createTypeStub.js +3 -2
- package/dist/commands/createTypeStub.js.map +1 -1
- package/dist/commands/dumpFileDebugInfoCommand.js +21 -20
- package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
- package/dist/commands/quickActionCommand.js +5 -5
- package/dist/commands/quickActionCommand.js.map +1 -1
- package/dist/common/configOptions.d.ts +14 -13
- package/dist/common/configOptions.js +29 -27
- package/dist/common/configOptions.js.map +1 -1
- package/dist/common/diagnostic.d.ts +6 -5
- package/dist/common/diagnostic.js +2 -2
- package/dist/common/diagnostic.js.map +1 -1
- package/dist/common/diagnosticSink.d.ts +2 -1
- package/dist/common/diagnosticSink.js.map +1 -1
- package/dist/common/editAction.d.ts +6 -5
- package/dist/common/editAction.js +2 -2
- package/dist/common/editAction.js.map +1 -1
- package/dist/common/envVarUtils.d.ts +2 -1
- package/dist/common/envVarUtils.js +20 -28
- package/dist/common/envVarUtils.js.map +1 -1
- package/dist/common/extensibility.d.ts +19 -19
- package/dist/common/extensibility.js.map +1 -1
- package/dist/common/fileSystem.d.ts +29 -28
- package/dist/common/fileWatcher.d.ts +2 -1
- package/dist/common/fileWatcher.js.map +1 -1
- package/dist/common/fullAccessHost.d.ts +8 -7
- package/dist/common/fullAccessHost.js +21 -16
- package/dist/common/fullAccessHost.js.map +1 -1
- package/dist/common/host.d.ts +7 -6
- package/dist/common/host.js +1 -1
- package/dist/common/host.js.map +1 -1
- package/dist/common/logTracker.d.ts +2 -1
- package/dist/common/logTracker.js +4 -4
- package/dist/common/logTracker.js.map +1 -1
- package/dist/common/pathUtils.d.ts +1 -28
- package/dist/common/pathUtils.js +17 -366
- package/dist/common/pathUtils.js.map +1 -1
- package/dist/common/realFileSystem.d.ts +7 -3
- package/dist/common/realFileSystem.js +78 -60
- package/dist/common/realFileSystem.js.map +1 -1
- package/dist/common/serviceProviderExtensions.d.ts +2 -1
- package/dist/common/serviceProviderExtensions.js +5 -2
- package/dist/common/serviceProviderExtensions.js.map +1 -1
- package/dist/common/textEditTracker.d.ts +2 -1
- package/dist/common/textEditTracker.js +28 -28
- package/dist/common/textEditTracker.js.map +1 -1
- package/dist/common/textRange.d.ts +2 -1
- package/dist/common/textRange.js.map +1 -1
- package/dist/common/uri/baseUri.d.ts +51 -0
- package/dist/common/uri/baseUri.js +194 -0
- package/dist/common/uri/baseUri.js.map +1 -0
- package/dist/common/uri/emptyUri.d.ts +32 -0
- package/dist/common/uri/emptyUri.js +98 -0
- package/dist/common/uri/emptyUri.js.map +1 -0
- package/dist/common/uri/fileUri.d.ts +36 -0
- package/dist/common/uri/fileUri.js +180 -0
- package/dist/common/uri/fileUri.js.map +1 -0
- package/dist/common/uri/memoization.d.ts +3 -0
- package/dist/common/uri/memoization.js +72 -0
- package/dist/common/uri/memoization.js.map +1 -0
- package/dist/common/uri/uri.d.ts +50 -0
- package/dist/common/uri/uri.js +104 -0
- package/dist/common/uri/uri.js.map +1 -0
- package/dist/common/uri/uriUtils.d.ts +39 -0
- package/dist/common/uri/uriUtils.js +362 -0
- package/dist/common/uri/uriUtils.js.map +1 -0
- package/dist/common/uri/webUri.d.ts +36 -0
- package/dist/common/uri/webUri.js +207 -0
- package/dist/common/uri/webUri.js.map +1 -0
- package/dist/common/workspaceEditUtils.d.ts +8 -8
- package/dist/common/workspaceEditUtils.js +35 -38
- package/dist/common/workspaceEditUtils.js.map +1 -1
- package/dist/languageServerBase.d.ts +19 -22
- package/dist/languageServerBase.js +91 -95
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/analyzerServiceExecutor.d.ts +2 -1
- package/dist/languageService/analyzerServiceExecutor.js +14 -16
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
- package/dist/languageService/autoImporter.d.ts +11 -9
- package/dist/languageService/autoImporter.js +45 -44
- package/dist/languageService/autoImporter.js.map +1 -1
- package/dist/languageService/callHierarchyProvider.d.ts +3 -2
- package/dist/languageService/callHierarchyProvider.js +23 -35
- package/dist/languageService/callHierarchyProvider.js.map +1 -1
- package/dist/languageService/codeActionProvider.d.ts +2 -1
- package/dist/languageService/codeActionProvider.js +8 -10
- package/dist/languageService/codeActionProvider.js.map +1 -1
- package/dist/languageService/completionProvider.d.ts +7 -6
- package/dist/languageService/completionProvider.js +32 -30
- package/dist/languageService/completionProvider.js.map +1 -1
- package/dist/languageService/completionProviderUtils.d.ts +2 -1
- package/dist/languageService/completionProviderUtils.js +1 -1
- package/dist/languageService/completionProviderUtils.js.map +1 -1
- package/dist/languageService/definitionProvider.d.ts +4 -3
- package/dist/languageService/definitionProvider.js +26 -24
- package/dist/languageService/definitionProvider.js.map +1 -1
- package/dist/languageService/documentHighlightProvider.d.ts +3 -2
- package/dist/languageService/documentHighlightProvider.js +3 -3
- package/dist/languageService/documentHighlightProvider.js.map +1 -1
- package/dist/languageService/documentSymbolCollector.js +8 -7
- package/dist/languageService/documentSymbolCollector.js.map +1 -1
- package/dist/languageService/documentSymbolProvider.d.ts +5 -4
- package/dist/languageService/documentSymbolProvider.js +9 -11
- package/dist/languageService/documentSymbolProvider.js.map +1 -1
- package/dist/languageService/hoverProvider.d.ts +4 -3
- package/dist/languageService/hoverProvider.js +6 -5
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/languageService/navigationUtils.d.ts +2 -1
- package/dist/languageService/navigationUtils.js +2 -3
- package/dist/languageService/navigationUtils.js.map +1 -1
- package/dist/languageService/quickActions.d.ts +2 -1
- package/dist/languageService/quickActions.js +3 -3
- package/dist/languageService/quickActions.js.map +1 -1
- package/dist/languageService/referencesProvider.d.ts +10 -9
- package/dist/languageService/referencesProvider.js +28 -28
- package/dist/languageService/referencesProvider.js.map +1 -1
- package/dist/languageService/renameProvider.d.ts +4 -3
- package/dist/languageService/renameProvider.js +17 -18
- package/dist/languageService/renameProvider.js.map +1 -1
- package/dist/languageService/signatureHelpProvider.d.ts +3 -2
- package/dist/languageService/signatureHelpProvider.js +4 -4
- package/dist/languageService/signatureHelpProvider.js.map +1 -1
- package/dist/languageService/symbolIndexer.d.ts +2 -1
- package/dist/languageService/symbolIndexer.js +11 -3
- package/dist/languageService/symbolIndexer.js.map +1 -1
- package/dist/languageService/tooltipUtils.js +10 -4
- package/dist/languageService/tooltipUtils.js.map +1 -1
- package/dist/languageService/workspaceSymbolProvider.d.ts +4 -3
- package/dist/languageService/workspaceSymbolProvider.js +10 -11
- package/dist/languageService/workspaceSymbolProvider.js.map +1 -1
- package/dist/localization/localize.d.ts +2 -0
- package/dist/localization/localize.js +2 -0
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.en-us.json +3 -1
- package/dist/parser/parseNodes.d.ts +1 -0
- package/dist/parser/parseNodes.js +1 -0
- package/dist/parser/parseNodes.js.map +1 -1
- package/dist/parser/parser.js +18 -15
- package/dist/parser/parser.js.map +1 -1
- package/dist/pyright.js +16 -15
- package/dist/pyright.js.map +1 -1
- package/dist/pyrightFileSystem.d.ts +13 -13
- package/dist/pyrightFileSystem.js +38 -43
- package/dist/pyrightFileSystem.js.map +1 -1
- package/dist/readonlyAugmentedFileSystem.d.ts +29 -28
- package/dist/readonlyAugmentedFileSystem.js +62 -65
- package/dist/readonlyAugmentedFileSystem.js.map +1 -1
- package/dist/server.js +21 -20
- package/dist/server.js.map +1 -1
- package/dist/tests/chainedSourceFiles.test.js +39 -30
- package/dist/tests/chainedSourceFiles.test.js.map +1 -1
- package/dist/tests/checker.test.js +31 -30
- package/dist/tests/checker.test.js.map +1 -1
- package/dist/tests/classDeclaration.test.d.ts +1 -0
- package/dist/tests/classDeclaration.test.js +166 -0
- package/dist/tests/classDeclaration.test.js.map +1 -0
- package/dist/tests/completions.test.js +7 -3
- package/dist/tests/completions.test.js.map +1 -1
- package/dist/tests/config.test.js +24 -22
- package/dist/tests/config.test.js.map +1 -1
- package/dist/tests/documentSymbolCollector.test.js +3 -2
- package/dist/tests/documentSymbolCollector.test.js.map +1 -1
- package/dist/tests/filesystem.test.js +37 -35
- package/dist/tests/filesystem.test.js.map +1 -1
- package/dist/tests/fourSlashParser.test.js +4 -4
- package/dist/tests/fourSlashParser.test.js.map +1 -1
- package/dist/tests/fourslash/hover.docstring.alias.fourslash.js +27 -11
- package/dist/tests/fourslash/hover.docstring.alias.fourslash.js.map +1 -1
- package/dist/tests/harness/fourslash/fourSlashParser.js +2 -2
- package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -1
- package/dist/tests/harness/fourslash/testLanguageService.d.ts +4 -5
- package/dist/tests/harness/fourslash/testLanguageService.js +9 -15
- package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -1
- package/dist/tests/harness/fourslash/testState.d.ts +4 -4
- package/dist/tests/harness/fourslash/testState.js +91 -51
- package/dist/tests/harness/fourslash/testState.js.map +1 -1
- package/dist/tests/harness/fourslash/workspaceEditTestUtils.js +4 -0
- package/dist/tests/harness/fourslash/workspaceEditTestUtils.js.map +1 -1
- package/dist/tests/harness/testAccessHost.d.ts +3 -2
- package/dist/tests/harness/testAccessHost.js +2 -1
- package/dist/tests/harness/testAccessHost.js.map +1 -1
- package/dist/tests/harness/testHost.js +13 -11
- package/dist/tests/harness/testHost.js.map +1 -1
- package/dist/tests/harness/vfs/factory.d.ts +3 -2
- package/dist/tests/harness/vfs/factory.js +5 -4
- package/dist/tests/harness/vfs/factory.js.map +1 -1
- package/dist/tests/harness/vfs/filesystem.d.ts +32 -31
- package/dist/tests/harness/vfs/filesystem.js +47 -49
- package/dist/tests/harness/vfs/filesystem.js.map +1 -1
- package/dist/tests/harness/vfs/pathValidation.js +1 -10
- package/dist/tests/harness/vfs/pathValidation.js.map +1 -1
- package/dist/tests/importResolver.test.js +106 -58
- package/dist/tests/importResolver.test.js.map +1 -1
- package/dist/tests/importStatementUtils.test.js +10 -9
- package/dist/tests/importStatementUtils.test.js.map +1 -1
- package/dist/tests/ipythonMode.test.js +12 -11
- package/dist/tests/ipythonMode.test.js.map +1 -1
- package/dist/tests/logger.test.js +2 -1
- package/dist/tests/logger.test.js.map +1 -1
- package/dist/tests/parseTreeUtils.test.js +2 -1
- package/dist/tests/parseTreeUtils.test.js.map +1 -1
- package/dist/tests/pathUtils.test.js +3 -138
- package/dist/tests/pathUtils.test.js.map +1 -1
- package/dist/tests/pyrightFileSystem.test.js +38 -34
- package/dist/tests/pyrightFileSystem.test.js.map +1 -1
- package/dist/tests/service.test.js +37 -42
- package/dist/tests/service.test.js.map +1 -1
- package/dist/tests/signatureHelp.test.js +3 -2
- package/dist/tests/signatureHelp.test.js.map +1 -1
- package/dist/tests/sourceFile.test.js +8 -7
- package/dist/tests/sourceFile.test.js.map +1 -1
- package/dist/tests/sourceMapperUtils.test.js +73 -35
- package/dist/tests/sourceMapperUtils.test.js.map +1 -1
- package/dist/tests/testState.test.js +13 -9
- package/dist/tests/testState.test.js.map +1 -1
- package/dist/tests/testStateUtils.d.ts +2 -5
- package/dist/tests/testStateUtils.js +27 -64
- package/dist/tests/testStateUtils.js.map +1 -1
- package/dist/tests/testUtils.d.ts +3 -5
- package/dist/tests/testUtils.js +15 -64
- package/dist/tests/testUtils.js.map +1 -1
- package/dist/tests/textEditUtil.test.js +4 -3
- package/dist/tests/textEditUtil.test.js.map +1 -1
- package/dist/tests/typeEvaluator1.test.js +16 -15
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator2.test.js +22 -9
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +86 -63
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +29 -20
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/tests/typeEvaluator5.test.js +28 -27
- package/dist/tests/typeEvaluator5.test.js.map +1 -1
- package/dist/tests/typePrinter.test.js +4 -3
- package/dist/tests/typePrinter.test.js.map +1 -1
- package/dist/tests/uri.test.d.ts +1 -0
- package/dist/tests/uri.test.js +695 -0
- package/dist/tests/uri.test.js.map +1 -0
- package/dist/tests/workspaceEditUtils.test.js +28 -28
- package/dist/tests/workspaceEditUtils.test.js.map +1 -1
- package/dist/tests/zipfs.test.js +11 -11
- package/dist/tests/zipfs.test.js.map +1 -1
- package/dist/workspaceFactory.d.ts +13 -14
- package/dist/workspaceFactory.js +54 -55
- package/dist/workspaceFactory.js.map +1 -1
- package/package.json +2 -2
- package/dist/common/uriParser.d.ts +0 -24
- package/dist/common/uriParser.js +0 -45
- package/dist/common/uriParser.js.map +0 -1
@@ -26,9 +26,9 @@ const configOptions_1 = require("./common/configOptions");
|
|
26
26
|
const console_1 = require("./common/console");
|
27
27
|
const diagnostic_1 = require("./common/diagnostic");
|
28
28
|
const lspUtils_1 = require("./common/lspUtils");
|
29
|
-
const pathUtils_1 = require("./common/pathUtils");
|
30
29
|
const progressReporter_1 = require("./common/progressReporter");
|
31
|
-
const
|
30
|
+
const uri_1 = require("./common/uri/uri");
|
31
|
+
const uriUtils_1 = require("./common/uri/uriUtils");
|
32
32
|
const analyzerServiceExecutor_1 = require("./languageService/analyzerServiceExecutor");
|
33
33
|
const callHierarchyProvider_1 = require("./languageService/callHierarchyProvider");
|
34
34
|
const completionProvider_1 = require("./languageService/completionProvider");
|
@@ -103,14 +103,14 @@ var VSDiagnosticRank;
|
|
103
103
|
VSDiagnosticRank.Lowest = 500;
|
104
104
|
})(VSDiagnosticRank || (exports.VSDiagnosticRank = VSDiagnosticRank = {}));
|
105
105
|
class LanguageServerBase {
|
106
|
-
constructor(serverOptions, connection
|
106
|
+
constructor(serverOptions, connection) {
|
107
107
|
var _a, _b;
|
108
108
|
this.serverOptions = serverOptions;
|
109
109
|
this.connection = connection;
|
110
110
|
this._lastTriggerKind = vscode_languageserver_1.CompletionTriggerKind.Invoked;
|
111
111
|
this._initialized = false;
|
112
112
|
// Global root path - the basis for all global settings.
|
113
|
-
this.
|
113
|
+
this.rootUri = uri_1.Uri.empty();
|
114
114
|
this.client = {
|
115
115
|
hasConfigurationCapability: false,
|
116
116
|
hasVisualStudioExtensionsCapability: false,
|
@@ -139,13 +139,12 @@ class LanguageServerBase {
|
|
139
139
|
this.documentsWithDiagnostics = new Set();
|
140
140
|
// Stash the base directory into a global variable.
|
141
141
|
// This must happen before fs.getModulePath().
|
142
|
-
global.__rootDirectory = serverOptions.rootDirectory;
|
142
|
+
global.__rootDirectory = serverOptions.rootDirectory.getFilePath();
|
143
143
|
this.console.info(`${serverOptions.productName} language server ${serverOptions.version && serverOptions.version + ' '}starting`);
|
144
144
|
this.console.info(`Server root directory: ${serverOptions.rootDirectory}`);
|
145
145
|
this.fs = this.serverOptions.serviceProvider.fs();
|
146
|
-
this.
|
147
|
-
|
148
|
-
/* isWeb */ false, this.createAnalyzerServiceForWorkspace.bind(this), this.isPythonPathImmutable.bind(this), this.onWorkspaceCreated.bind(this), this.onWorkspaceRemoved.bind(this));
|
146
|
+
this.workspaceFactory = new workspaceFactory_1.WorkspaceFactory(this.console,
|
147
|
+
/* isWeb */ false, this.createAnalyzerServiceForWorkspace.bind(this), this.isPythonPathImmutable.bind(this), this.onWorkspaceCreated.bind(this), this.onWorkspaceRemoved.bind(this), this.fs.isCaseSensitive);
|
149
148
|
// Set the working directory to a known location within
|
150
149
|
// the extension directory. Otherwise the execution of
|
151
150
|
// python can have unintended and surprising results.
|
@@ -175,10 +174,6 @@ class LanguageServerBase {
|
|
175
174
|
this.openFileMap.clear();
|
176
175
|
(_a = this._workspaceFoldersChangedDisposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
177
176
|
}
|
178
|
-
// Convert uri to path
|
179
|
-
decodeTextDocumentUri(uriString) {
|
180
|
-
return this.uriParser.decodeTextDocumentUri(uriString);
|
181
|
-
}
|
182
177
|
// Creates a service instance that's used for analyzing a
|
183
178
|
// program within a workspace.
|
184
179
|
createAnalyzerService(name, services, libraryReanalysisTimeProvider) {
|
@@ -207,11 +202,11 @@ class LanguageServerBase {
|
|
207
202
|
}
|
208
203
|
return workspaces;
|
209
204
|
}
|
210
|
-
async getWorkspaceForFile(
|
211
|
-
return this.workspaceFactory.getWorkspaceForFile(
|
205
|
+
async getWorkspaceForFile(fileUri, pythonPath) {
|
206
|
+
return this.workspaceFactory.getWorkspaceForFile(fileUri, pythonPath);
|
212
207
|
}
|
213
|
-
async getContainingWorkspacesForFile(
|
214
|
-
return this.workspaceFactory.getContainingWorkspacesForFile(
|
208
|
+
async getContainingWorkspacesForFile(fileUri) {
|
209
|
+
return this.workspaceFactory.getContainingWorkspacesForFile(fileUri);
|
215
210
|
}
|
216
211
|
reanalyze() {
|
217
212
|
this.workspaceFactory.items().forEach((workspace) => {
|
@@ -244,7 +239,7 @@ class LanguageServerBase {
|
|
244
239
|
// Set logging level first.
|
245
240
|
this.console.level = (_a = serverSettings.logLevel) !== null && _a !== void 0 ? _a : console_1.LogLevel.Info;
|
246
241
|
// Apply the new path to the workspace (before restarting the service).
|
247
|
-
serverSettings.pythonPath = this.workspaceFactory.applyPythonPath(workspace, serverSettings.pythonPath);
|
242
|
+
serverSettings.pythonPath = this.workspaceFactory.applyPythonPath(workspace, serverSettings.pythonPath ? serverSettings.pythonPath : undefined);
|
248
243
|
// Then use the updated settings to restart the service.
|
249
244
|
this.updateOptionsAndRestartService(workspace, serverSettings);
|
250
245
|
workspace.disableLanguageServices = !!serverSettings.disableLanguageServices;
|
@@ -256,10 +251,10 @@ class LanguageServerBase {
|
|
256
251
|
}
|
257
252
|
updateOptionsAndRestartService(workspace, serverSettings, typeStubTargetImportName) {
|
258
253
|
var _a;
|
259
|
-
analyzerServiceExecutor_1.AnalyzerServiceExecutor.runWithOptions(this.
|
260
|
-
workspace.searchPathsToWatch = (_a = workspace.service.
|
254
|
+
analyzerServiceExecutor_1.AnalyzerServiceExecutor.runWithOptions(this.rootUri, workspace, serverSettings, typeStubTargetImportName);
|
255
|
+
workspace.searchPathsToWatch = (_a = workspace.service.librarySearchUrisToWatch) !== null && _a !== void 0 ? _a : [];
|
261
256
|
}
|
262
|
-
isPythonPathImmutable(
|
257
|
+
isPythonPathImmutable(fileUri) {
|
263
258
|
// This function is called to determine if the file is using
|
264
259
|
// a special pythonPath separate from a workspace or not.
|
265
260
|
// The default is no.
|
@@ -269,7 +264,7 @@ class LanguageServerBase {
|
|
269
264
|
if (this.client.hasConfigurationCapability) {
|
270
265
|
const item = {};
|
271
266
|
if (scopeUri !== undefined) {
|
272
|
-
item.scopeUri = scopeUri;
|
267
|
+
item.scopeUri = scopeUri.toString();
|
273
268
|
}
|
274
269
|
if (section !== undefined) {
|
275
270
|
item.section = section;
|
@@ -341,7 +336,7 @@ class LanguageServerBase {
|
|
341
336
|
if (params.locale) {
|
342
337
|
(0, localize_1.setLocaleOverride)(params.locale);
|
343
338
|
}
|
344
|
-
this.
|
339
|
+
this.rootUri = params.rootUri ? uri_1.Uri.parse(params.rootUri, this.fs.isCaseSensitive) : uri_1.Uri.empty();
|
345
340
|
const capabilities = params.capabilities;
|
346
341
|
this.client.hasConfigurationCapability = !!((_a = capabilities.workspace) === null || _a === void 0 ? void 0 : _a.configuration);
|
347
342
|
this.client.hasWatchFileCapability = !!((_c = (_b = capabilities.workspace) === null || _b === void 0 ? void 0 : _b.didChangeWatchedFiles) === null || _c === void 0 ? void 0 : _c.dynamicRegistration);
|
@@ -461,18 +456,18 @@ class LanguageServerBase {
|
|
461
456
|
}
|
462
457
|
async getDefinitions(params, token, filter, getDefinitionsFunc) {
|
463
458
|
this.recordUserInteractionTime();
|
464
|
-
const
|
465
|
-
const workspace = await this.getWorkspaceForFile(
|
459
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
460
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
466
461
|
if (workspace.disableLanguageServices) {
|
467
462
|
return undefined;
|
468
463
|
}
|
469
|
-
const locations = getDefinitionsFunc(workspace,
|
464
|
+
const locations = getDefinitionsFunc(workspace, uri, params.position, filter, token);
|
470
465
|
if (!locations) {
|
471
466
|
return undefined;
|
472
467
|
}
|
473
468
|
return locations
|
474
|
-
.filter((loc) => this.canNavigateToFile(loc.
|
475
|
-
.map((loc) => vscode_languageserver_1.Location.create(
|
469
|
+
.filter((loc) => this.canNavigateToFile(loc.uri, workspace.service.fs))
|
470
|
+
.map((loc) => vscode_languageserver_1.Location.create(loc.uri.toString(), loc.range));
|
476
471
|
}
|
477
472
|
async onReferences(params, token, workDoneReporter, resultReporter, createDocumentRange, convertToLocation) {
|
478
473
|
if (this._pendingFindAllRefsCancellationSource) {
|
@@ -486,13 +481,13 @@ class LanguageServerBase {
|
|
486
481
|
const source = progress.source;
|
487
482
|
this._pendingFindAllRefsCancellationSource = source;
|
488
483
|
try {
|
489
|
-
const
|
490
|
-
const workspace = await this.getWorkspaceForFile(
|
484
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
485
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
491
486
|
if (workspace.disableLanguageServices) {
|
492
487
|
return;
|
493
488
|
}
|
494
489
|
return workspace.service.run((program) => {
|
495
|
-
return new referencesProvider_1.ReferencesProvider(program, source.token, createDocumentRange, convertToLocation).reportReferences(
|
490
|
+
return new referencesProvider_1.ReferencesProvider(program, source.token, createDocumentRange, convertToLocation).reportReferences(uri, params.position, params.context.includeDeclaration, resultReporter);
|
496
491
|
}, token);
|
497
492
|
}
|
498
493
|
finally {
|
@@ -502,13 +497,13 @@ class LanguageServerBase {
|
|
502
497
|
}
|
503
498
|
async onDocumentSymbol(params, token) {
|
504
499
|
this.recordUserInteractionTime();
|
505
|
-
const
|
506
|
-
const workspace = await this.getWorkspaceForFile(
|
500
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
501
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
507
502
|
if (workspace.disableLanguageServices) {
|
508
503
|
return undefined;
|
509
504
|
}
|
510
505
|
return workspace.service.run((program) => {
|
511
|
-
return new documentSymbolProvider_1.DocumentSymbolProvider(program,
|
506
|
+
return new documentSymbolProvider_1.DocumentSymbolProvider(program, uri, this.client.hasHierarchicalDocumentSymbolCapability, token).getSymbols();
|
512
507
|
}, token);
|
513
508
|
}
|
514
509
|
onWorkspaceSymbol(params, token, resultReporter) {
|
@@ -516,27 +511,27 @@ class LanguageServerBase {
|
|
516
511
|
return Promise.resolve(result);
|
517
512
|
}
|
518
513
|
async onHover(params, token) {
|
519
|
-
const
|
520
|
-
const workspace = await this.getWorkspaceForFile(
|
514
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
515
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
521
516
|
return workspace.service.run((program) => {
|
522
|
-
return new hoverProvider_1.HoverProvider(program,
|
517
|
+
return new hoverProvider_1.HoverProvider(program, uri, params.position, this.client.hoverContentFormat, token).getHover();
|
523
518
|
}, token);
|
524
519
|
}
|
525
520
|
async onDocumentHighlight(params, token) {
|
526
|
-
const
|
527
|
-
const workspace = await this.getWorkspaceForFile(
|
521
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
522
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
528
523
|
return workspace.service.run((program) => {
|
529
|
-
return new documentHighlightProvider_1.DocumentHighlightProvider(program,
|
524
|
+
return new documentHighlightProvider_1.DocumentHighlightProvider(program, uri, params.position, token).getDocumentHighlight();
|
530
525
|
}, token);
|
531
526
|
}
|
532
527
|
async onSignatureHelp(params, token) {
|
533
|
-
const
|
534
|
-
const workspace = await this.getWorkspaceForFile(
|
528
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
529
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
535
530
|
if (workspace.disableLanguageServices) {
|
536
531
|
return;
|
537
532
|
}
|
538
533
|
return workspace.service.run((program) => {
|
539
|
-
return new signatureHelpProvider_1.SignatureHelpProvider(program,
|
534
|
+
return new signatureHelpProvider_1.SignatureHelpProvider(program, uri, params.position, this.client.signatureDocFormat, this.client.hasSignatureLabelOffsetCapability, this.client.hasActiveParameterCapability, params.context, token).getSignatureHelp();
|
540
535
|
}, token);
|
541
536
|
}
|
542
537
|
setCompletionIncomplete(params, completions) {
|
@@ -557,14 +552,14 @@ class LanguageServerBase {
|
|
557
552
|
}
|
558
553
|
}
|
559
554
|
async onCompletion(params, token) {
|
560
|
-
const
|
561
|
-
const workspace = await this.getWorkspaceForFile(
|
555
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
556
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
562
557
|
if (workspace.disableLanguageServices) {
|
563
558
|
return null;
|
564
559
|
}
|
565
560
|
return workspace.service.run((program) => {
|
566
561
|
var _a;
|
567
|
-
const completions = new completionProvider_1.CompletionProvider(program, workspace.
|
562
|
+
const completions = new completionProvider_1.CompletionProvider(program, workspace.rootUri, uri, params.position, {
|
568
563
|
format: this.client.completionDocFormat,
|
569
564
|
snippet: this.client.completionSupportsSnippet,
|
570
565
|
lazyEdit: false,
|
@@ -582,10 +577,11 @@ class LanguageServerBase {
|
|
582
577
|
// cache that result and never call us back.
|
583
578
|
async onCompletionResolve(params, token) {
|
584
579
|
const completionItemData = (0, lspUtils_1.fromLSPAny)(params.data);
|
585
|
-
if (completionItemData && completionItemData.
|
586
|
-
const
|
580
|
+
if (completionItemData && completionItemData.uri) {
|
581
|
+
const uri = uri_1.Uri.parse(completionItemData.uri, this.fs.isCaseSensitive);
|
582
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
587
583
|
workspace.service.run((program) => {
|
588
|
-
return new completionProvider_1.CompletionProvider(program, workspace.
|
584
|
+
return new completionProvider_1.CompletionProvider(program, workspace.rootUri, uri, completionItemData.position, {
|
589
585
|
format: this.client.completionDocFormat,
|
590
586
|
snippet: this.client.completionSupportsSnippet,
|
591
587
|
lazyEdit: false,
|
@@ -595,104 +591,104 @@ class LanguageServerBase {
|
|
595
591
|
return params;
|
596
592
|
}
|
597
593
|
async onPrepareRenameRequest(params, token) {
|
598
|
-
const
|
599
|
-
const isUntitled =
|
600
|
-
const workspace = await this.getWorkspaceForFile(
|
594
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
595
|
+
const isUntitled = uri.isUntitled();
|
596
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
601
597
|
if (workspace.disableLanguageServices) {
|
602
598
|
return null;
|
603
599
|
}
|
604
600
|
return workspace.service.run((program) => {
|
605
|
-
return new renameProvider_1.RenameProvider(program,
|
601
|
+
return new renameProvider_1.RenameProvider(program, uri, params.position, token).canRenameSymbol(workspace.kinds.includes(workspaceFactory_1.WellKnownWorkspaceKinds.Default), isUntitled);
|
606
602
|
}, token);
|
607
603
|
}
|
608
604
|
async onRenameRequest(params, token) {
|
609
|
-
const
|
610
|
-
const isUntitled =
|
611
|
-
const workspace = await this.getWorkspaceForFile(
|
605
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
606
|
+
const isUntitled = uri.isUntitled();
|
607
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
612
608
|
if (workspace.disableLanguageServices) {
|
613
609
|
return;
|
614
610
|
}
|
615
611
|
return workspace.service.run((program) => {
|
616
|
-
return new renameProvider_1.RenameProvider(program,
|
612
|
+
return new renameProvider_1.RenameProvider(program, uri, params.position, token).renameSymbol(params.newName, workspace.kinds.includes(workspaceFactory_1.WellKnownWorkspaceKinds.Default), isUntitled);
|
617
613
|
}, token);
|
618
614
|
}
|
619
615
|
async onCallHierarchyPrepare(params, token) {
|
620
|
-
const
|
621
|
-
const workspace = await this.getWorkspaceForFile(
|
616
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
617
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
622
618
|
if (workspace.disableLanguageServices) {
|
623
619
|
return null;
|
624
620
|
}
|
625
621
|
return workspace.service.run((program) => {
|
626
|
-
return new callHierarchyProvider_1.CallHierarchyProvider(program,
|
622
|
+
return new callHierarchyProvider_1.CallHierarchyProvider(program, uri, params.position, token).onPrepare();
|
627
623
|
}, token);
|
628
624
|
}
|
629
625
|
async onCallHierarchyIncomingCalls(params, token) {
|
630
|
-
const
|
631
|
-
const workspace = await this.getWorkspaceForFile(
|
626
|
+
const uri = uri_1.Uri.parse(params.item.uri, this.fs.isCaseSensitive);
|
627
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
632
628
|
if (workspace.disableLanguageServices) {
|
633
629
|
return null;
|
634
630
|
}
|
635
631
|
return workspace.service.run((program) => {
|
636
|
-
return new callHierarchyProvider_1.CallHierarchyProvider(program,
|
632
|
+
return new callHierarchyProvider_1.CallHierarchyProvider(program, uri, params.item.range.start, token).getIncomingCalls();
|
637
633
|
}, token);
|
638
634
|
}
|
639
635
|
async onCallHierarchyOutgoingCalls(params, token) {
|
640
|
-
const
|
641
|
-
const workspace = await this.getWorkspaceForFile(
|
636
|
+
const uri = uri_1.Uri.parse(params.item.uri, this.fs.isCaseSensitive);
|
637
|
+
const workspace = await this.getWorkspaceForFile(uri);
|
642
638
|
if (workspace.disableLanguageServices) {
|
643
639
|
return null;
|
644
640
|
}
|
645
641
|
return workspace.service.run((program) => {
|
646
|
-
return new callHierarchyProvider_1.CallHierarchyProvider(program,
|
642
|
+
return new callHierarchyProvider_1.CallHierarchyProvider(program, uri, params.item.range.start, token).getOutgoingCalls();
|
647
643
|
}, token);
|
648
644
|
}
|
649
645
|
async onDidOpenTextDocument(params, ipythonMode = sourceFile_1.IPythonMode.None) {
|
650
|
-
const
|
651
|
-
let doc = this.openFileMap.get(
|
646
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
647
|
+
let doc = this.openFileMap.get(uri.key);
|
652
648
|
if (doc) {
|
653
649
|
// We shouldn't get an open text document request for an already-opened doc.
|
654
|
-
this.console.error(`Received redundant open text document command for ${
|
650
|
+
this.console.error(`Received redundant open text document command for ${uri}`);
|
655
651
|
vscode_languageserver_textdocument_1.TextDocument.update(doc, [{ text: params.textDocument.text }], params.textDocument.version);
|
656
652
|
}
|
657
653
|
else {
|
658
|
-
doc = vscode_languageserver_textdocument_1.TextDocument.create(
|
654
|
+
doc = vscode_languageserver_textdocument_1.TextDocument.create(params.textDocument.uri, 'python', params.textDocument.version, params.textDocument.text);
|
659
655
|
}
|
660
|
-
this.openFileMap.set(
|
656
|
+
this.openFileMap.set(uri.key, doc);
|
661
657
|
// Send this open to all the workspaces that might contain this file.
|
662
|
-
const workspaces = await this.getContainingWorkspacesForFile(
|
658
|
+
const workspaces = await this.getContainingWorkspacesForFile(uri);
|
663
659
|
workspaces.forEach((w) => {
|
664
|
-
w.service.setFileOpened(
|
660
|
+
w.service.setFileOpened(uri, params.textDocument.version, params.textDocument.text, ipythonMode);
|
665
661
|
});
|
666
662
|
}
|
667
663
|
async onDidChangeTextDocument(params, ipythonMode = sourceFile_1.IPythonMode.None) {
|
668
664
|
this.recordUserInteractionTime();
|
669
|
-
const
|
670
|
-
const doc = this.openFileMap.get(
|
665
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
666
|
+
const doc = this.openFileMap.get(uri.key);
|
671
667
|
if (!doc) {
|
672
668
|
// We shouldn't get a change text request for a closed doc.
|
673
|
-
this.console.error(`Received change text document command for closed file ${
|
669
|
+
this.console.error(`Received change text document command for closed file ${uri}`);
|
674
670
|
return;
|
675
671
|
}
|
676
672
|
vscode_languageserver_textdocument_1.TextDocument.update(doc, params.contentChanges, params.textDocument.version);
|
677
673
|
const newContents = doc.getText();
|
678
674
|
// Send this change to all the workspaces that might contain this file.
|
679
|
-
const workspaces = await this.getContainingWorkspacesForFile(
|
675
|
+
const workspaces = await this.getContainingWorkspacesForFile(uri);
|
680
676
|
workspaces.forEach((w) => {
|
681
|
-
w.service.updateOpenFileContents(
|
677
|
+
w.service.updateOpenFileContents(uri, params.textDocument.version, newContents, ipythonMode);
|
682
678
|
});
|
683
679
|
}
|
684
680
|
async onDidCloseTextDocument(params) {
|
685
|
-
const
|
681
|
+
const uri = uri_1.Uri.parse(params.textDocument.uri, this.fs.isCaseSensitive);
|
686
682
|
// Send this close to all the workspaces that might contain this file.
|
687
|
-
const workspaces = await this.getContainingWorkspacesForFile(
|
683
|
+
const workspaces = await this.getContainingWorkspacesForFile(uri);
|
688
684
|
workspaces.forEach((w) => {
|
689
|
-
w.service.setFileClosed(
|
685
|
+
w.service.setFileClosed(uri);
|
690
686
|
});
|
691
|
-
this.openFileMap.delete(
|
687
|
+
this.openFileMap.delete(uri.key);
|
692
688
|
}
|
693
689
|
onDidChangeWatchedFiles(params) {
|
694
690
|
params.changes.forEach((change) => {
|
695
|
-
const filePath = this.fs.realCasePath(
|
691
|
+
const filePath = this.fs.realCasePath(uri_1.Uri.parse(change.uri, this.fs.isCaseSensitive));
|
696
692
|
const eventType = change.type === 1 ? 'add' : 'change';
|
697
693
|
this.serverOptions.fileWatcherHandler.onFileChange(eventType, filePath);
|
698
694
|
});
|
@@ -746,7 +742,7 @@ class LanguageServerBase {
|
|
746
742
|
convertDiagnostics(fs, fileDiagnostics) {
|
747
743
|
return [
|
748
744
|
{
|
749
|
-
uri:
|
745
|
+
uri: fileDiagnostics.fileUri.toString(),
|
750
746
|
version: fileDiagnostics.version,
|
751
747
|
diagnostics: this._convertDiagnostics(fs, fileDiagnostics.diagnostics),
|
752
748
|
},
|
@@ -758,7 +754,7 @@ class LanguageServerBase {
|
|
758
754
|
onAnalysisCompletedHandler(fs, results) {
|
759
755
|
// Send the computed diagnostics to the client.
|
760
756
|
results.diagnostics.forEach((fileDiag) => {
|
761
|
-
if (!this.canNavigateToFile(fileDiag.
|
757
|
+
if (!this.canNavigateToFile(fileDiag.fileUri, fs)) {
|
762
758
|
return;
|
763
759
|
}
|
764
760
|
this.sendDiagnostics(this.convertDiagnostics(fs, fileDiag));
|
@@ -796,10 +792,10 @@ class LanguageServerBase {
|
|
796
792
|
const documentsWithDiagnosticsList = [...this.documentsWithDiagnostics];
|
797
793
|
const otherWorkspaces = this.workspaceFactory.items().filter((w) => w !== workspace);
|
798
794
|
for (const uri of documentsWithDiagnosticsList) {
|
799
|
-
const
|
800
|
-
if (workspace.service.isTracked(
|
795
|
+
const fileUri = uri_1.Uri.parse(uri, this.fs.isCaseSensitive);
|
796
|
+
if (workspace.service.isTracked(fileUri)) {
|
801
797
|
// Do not clean up diagnostics for files tracked by multiple workspaces
|
802
|
-
if (otherWorkspaces.some((w) => w.service.isTracked(
|
798
|
+
if (otherWorkspaces.some((w) => w.service.isTracked(fileUri))) {
|
803
799
|
continue;
|
804
800
|
}
|
805
801
|
this.sendDiagnostics([
|
@@ -811,7 +807,7 @@ class LanguageServerBase {
|
|
811
807
|
}
|
812
808
|
}
|
813
809
|
}
|
814
|
-
createAnalyzerServiceForWorkspace(name,
|
810
|
+
createAnalyzerServiceForWorkspace(name, uri, kinds, services) {
|
815
811
|
// 5 seconds default
|
816
812
|
const defaultBackOffTime = 5 * 1000;
|
817
813
|
// 10 seconds back off for multi workspace.
|
@@ -886,13 +882,13 @@ class LanguageServerBase {
|
|
886
882
|
// Dedup search paths from all workspaces.
|
887
883
|
// Get rid of any search path under workspace root since it is already watched by
|
888
884
|
// "**" above.
|
889
|
-
const foldersToWatch = (0,
|
885
|
+
const foldersToWatch = (0, uriUtils_1.deduplicateFolders)(this.workspaceFactory
|
890
886
|
.getNonDefaultWorkspaces()
|
891
|
-
.map((w) => w.searchPathsToWatch.filter((p) => !p.startsWith(w.
|
887
|
+
.map((w) => w.searchPathsToWatch.filter((p) => !p.startsWith(w.rootUri))));
|
892
888
|
foldersToWatch.forEach((p) => {
|
893
|
-
const globPattern = (0,
|
894
|
-
? { baseUri: (
|
895
|
-
: { baseUri:
|
889
|
+
const globPattern = (0, uriUtils_1.isFile)(this.fs, p, /* treatZipDirectoryAsFile */ true)
|
890
|
+
? { baseUri: p.getDirectory().toString(), pattern: p.fileName }
|
891
|
+
: { baseUri: p.toString(), pattern: '**' };
|
896
892
|
watchers.push({ globPattern, kind: watchKind });
|
897
893
|
});
|
898
894
|
}
|
@@ -971,8 +967,8 @@ class LanguageServerBase {
|
|
971
967
|
const relatedInfo = diag.getRelatedInfo();
|
972
968
|
if (relatedInfo.length > 0) {
|
973
969
|
vsDiag.relatedInformation = relatedInfo
|
974
|
-
.filter((info) => this.canNavigateToFile(info.
|
975
|
-
.map((info) => vscode_languageserver_1.DiagnosticRelatedInformation.create(vscode_languageserver_1.Location.create(
|
970
|
+
.filter((info) => this.canNavigateToFile(uri_1.Uri.fromJsonObj(info.uri), fs))
|
971
|
+
.map((info) => vscode_languageserver_1.DiagnosticRelatedInformation.create(vscode_languageserver_1.Location.create(uri_1.Uri.fromJsonObj(info.uri).toString(), info.range), info.message));
|
976
972
|
}
|
977
973
|
convertedDiags.push(vsDiag);
|
978
974
|
});
|