@zzzen/pyright-internal 1.2.0-dev.20240121 → 1.2.0-dev.20240218
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/analysis.js +4 -1
- package/dist/analyzer/analysis.js.map +1 -1
- package/dist/analyzer/analyzerFileInfo.js.map +1 -1
- package/dist/analyzer/analyzerNodeInfo.js.map +1 -1
- package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -1
- package/dist/analyzer/binder.js +2 -2
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/cacheManager.js.map +1 -1
- package/dist/analyzer/checker.js +139 -98
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/circularDependency.js.map +1 -1
- package/dist/analyzer/codeFlowEngine.js +29 -3
- package/dist/analyzer/codeFlowEngine.js.map +1 -1
- package/dist/analyzer/codeFlowTypes.js.map +1 -1
- package/dist/analyzer/codeFlowUtils.js.map +1 -1
- package/dist/analyzer/commentUtils.js.map +1 -1
- package/dist/analyzer/constraintSolver.d.ts +2 -2
- package/dist/analyzer/constraintSolver.js +28 -6
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/constructorTransform.js +8 -8
- package/dist/analyzer/constructorTransform.js.map +1 -1
- package/dist/analyzer/constructors.js +1 -1
- package/dist/analyzer/constructors.js.map +1 -1
- package/dist/analyzer/dataClasses.js +1 -1
- package/dist/analyzer/dataClasses.js.map +1 -1
- package/dist/analyzer/declaration.js.map +1 -1
- package/dist/analyzer/declarationUtils.js.map +1 -1
- package/dist/analyzer/decorators.js +1 -1
- package/dist/analyzer/decorators.js.map +1 -1
- package/dist/analyzer/deprecatedSymbols.js.map +1 -1
- package/dist/analyzer/docStringConversion.js.map +1 -1
- package/dist/analyzer/docStringUtils.js.map +1 -1
- package/dist/analyzer/enums.d.ts +4 -1
- package/dist/analyzer/enums.js +29 -25
- package/dist/analyzer/enums.js.map +1 -1
- package/dist/analyzer/functionTransform.js.map +1 -1
- package/dist/analyzer/importResolver.js +1 -1
- package/dist/analyzer/importResolver.js.map +1 -1
- package/dist/analyzer/importResult.js.map +1 -1
- package/dist/analyzer/importStatementUtils.js.map +1 -1
- package/dist/analyzer/namedTuples.js +4 -4
- package/dist/analyzer/namedTuples.js.map +1 -1
- package/dist/analyzer/operations.js +14 -8
- package/dist/analyzer/operations.js.map +1 -1
- package/dist/analyzer/packageTypeReport.js.map +1 -1
- package/dist/analyzer/packageTypeVerifier.js.map +1 -1
- package/dist/analyzer/parameterUtils.d.ts +1 -0
- package/dist/analyzer/parameterUtils.js +5 -1
- package/dist/analyzer/parameterUtils.js.map +1 -1
- package/dist/analyzer/parentDirectoryCache.js.map +1 -1
- package/dist/analyzer/parseTreeCleaner.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.d.ts +1 -0
- package/dist/analyzer/parseTreeUtils.js +4 -3
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/parseTreeWalker.js.map +1 -1
- package/dist/analyzer/patternMatching.js +87 -58
- package/dist/analyzer/patternMatching.js.map +1 -1
- package/dist/analyzer/program.d.ts +1 -1
- package/dist/analyzer/program.js +2 -2
- package/dist/analyzer/program.js.map +1 -1
- package/dist/analyzer/properties.js.map +1 -1
- package/dist/analyzer/protocols.js.map +1 -1
- package/dist/analyzer/pyTypedUtils.js.map +1 -1
- package/dist/analyzer/pythonPathUtils.js.map +1 -1
- package/dist/analyzer/regions.js.map +1 -1
- package/dist/analyzer/scope.js.map +1 -1
- package/dist/analyzer/scopeUtils.js.map +1 -1
- package/dist/analyzer/service.js.map +1 -1
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/sourceFileInfo.js +1 -1
- package/dist/analyzer/sourceFileInfo.js.map +1 -1
- package/dist/analyzer/sourceFileInfoUtils.js.map +1 -1
- package/dist/analyzer/sourceMapper.js.map +1 -1
- package/dist/analyzer/sourceMapperUtils.js.map +1 -1
- package/dist/analyzer/staticExpressions.js.map +1 -1
- package/dist/analyzer/symbol.js.map +1 -1
- package/dist/analyzer/symbolNameUtils.js.map +1 -1
- package/dist/analyzer/symbolUtils.js.map +1 -1
- package/dist/analyzer/testWalker.js.map +1 -1
- package/dist/analyzer/tracePrinter.js.map +1 -1
- package/dist/analyzer/typeCacheUtils.js.map +1 -1
- package/dist/analyzer/typeDocStringUtils.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +352 -310
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
- package/dist/analyzer/typeEvaluatorWithTracker.js.map +1 -1
- package/dist/analyzer/typeGuards.js +5 -0
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typePrinter.js.map +1 -1
- package/dist/analyzer/typeStubWriter.js.map +1 -1
- package/dist/analyzer/typeUtils.d.ts +0 -1
- package/dist/analyzer/typeUtils.js +25 -11
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/typeVarContext.d.ts +2 -2
- package/dist/analyzer/typeVarContext.js +10 -4
- package/dist/analyzer/typeVarContext.js.map +1 -1
- package/dist/analyzer/typeWalker.js.map +1 -1
- package/dist/analyzer/typedDicts.js +5 -5
- package/dist/analyzer/typedDicts.js.map +1 -1
- package/dist/analyzer/types.d.ts +7 -3
- package/dist/analyzer/types.js +40 -28
- package/dist/analyzer/types.js.map +1 -1
- package/dist/backgroundAnalysis.js.map +1 -1
- package/dist/backgroundAnalysisBase.js.map +1 -1
- package/dist/backgroundThreadBase.js.map +1 -1
- package/dist/commands/commandController.js.map +1 -1
- package/dist/commands/commandResult.js.map +1 -1
- package/dist/commands/commands.js.map +1 -1
- package/dist/commands/createTypeStub.js.map +1 -1
- package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
- package/dist/commands/quickActionCommand.js.map +1 -1
- package/dist/commands/restartServer.js.map +1 -1
- package/dist/common/cancellationUtils.d.ts +2 -1
- package/dist/common/cancellationUtils.js +17 -4
- package/dist/common/cancellationUtils.js.map +1 -1
- package/dist/common/charCodes.js.map +1 -1
- package/dist/common/chokidarFileWatcherProvider.js.map +1 -1
- package/dist/common/collectionUtils.js.map +1 -1
- package/dist/common/commandLineOptions.js.map +1 -1
- package/dist/common/commandUtils.js.map +1 -1
- package/dist/common/configOptions.d.ts +16 -0
- package/dist/common/configOptions.js +80 -0
- package/dist/common/configOptions.js.map +1 -1
- package/dist/common/console.js.map +1 -1
- package/dist/common/core.js.map +1 -1
- package/dist/common/crypto.js.map +1 -1
- package/dist/common/debug.js.map +1 -1
- package/dist/common/deferred.js.map +1 -1
- package/dist/common/diagnostic.js.map +1 -1
- package/dist/common/diagnosticRules.d.ts +16 -0
- package/dist/common/diagnosticRules.js +16 -0
- package/dist/common/diagnosticRules.js.map +1 -1
- package/dist/common/diagnosticSink.js.map +1 -1
- package/dist/common/editAction.js.map +1 -1
- package/dist/common/envVarUtils.d.ts +2 -1
- package/dist/common/envVarUtils.js +5 -1
- package/dist/common/envVarUtils.js.map +1 -1
- package/dist/common/extensibility.js.map +1 -1
- package/dist/common/extensions.js.map +1 -1
- package/dist/common/fileBasedCancellationUtils.js.map +1 -1
- package/dist/common/fileSystem.js.map +1 -1
- package/dist/common/fileWatcher.js.map +1 -1
- package/dist/common/fullAccessHost.js +1 -1
- package/dist/common/fullAccessHost.js.map +1 -1
- package/dist/common/host.js.map +1 -1
- package/dist/common/logTracker.js.map +1 -1
- package/dist/common/lspUtils.js.map +1 -1
- package/dist/common/memUtils.js.map +1 -1
- package/dist/common/pathConsts.js.map +1 -1
- package/dist/common/pathUtils.js.map +1 -1
- package/dist/common/positionUtils.js.map +1 -1
- package/dist/common/progressReporter.js.map +1 -1
- package/dist/common/pythonVersion.js.map +1 -1
- package/dist/common/realFileSystem.js +1 -1
- package/dist/common/realFileSystem.js.map +1 -1
- package/dist/common/serviceProvider.js.map +1 -1
- package/dist/common/serviceProviderExtensions.js.map +1 -1
- package/dist/common/stringUtils.js.map +1 -1
- package/dist/common/textEditTracker.js.map +1 -1
- package/dist/common/textRange.js.map +1 -1
- package/dist/common/textRangeCollection.js.map +1 -1
- package/dist/common/timing.js.map +1 -1
- package/dist/common/uri/baseUri.d.ts +2 -0
- package/dist/common/uri/baseUri.js +7 -7
- package/dist/common/uri/baseUri.js.map +1 -1
- package/dist/common/uri/emptyUri.d.ts +2 -0
- package/dist/common/uri/emptyUri.js +6 -0
- package/dist/common/uri/emptyUri.js.map +1 -1
- package/dist/common/uri/fileUri.d.ts +6 -4
- package/dist/common/uri/fileUri.js +18 -9
- package/dist/common/uri/fileUri.js.map +1 -1
- package/dist/common/uri/memoization.js.map +1 -1
- package/dist/common/uri/uri.d.ts +8 -0
- package/dist/common/uri/uri.js +16 -7
- package/dist/common/uri/uri.js.map +1 -1
- package/dist/common/uri/uriUtils.js.map +1 -1
- package/dist/common/uri/webUri.d.ts +3 -1
- package/dist/common/uri/webUri.js +21 -8
- package/dist/common/uri/webUri.js.map +1 -1
- package/dist/common/workspaceEditUtils.js.map +1 -1
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
- package/dist/languageService/autoImporter.js.map +1 -1
- package/dist/languageService/callHierarchyProvider.js.map +1 -1
- package/dist/languageService/codeActionProvider.js.map +1 -1
- package/dist/languageService/completionProvider.js +9 -1
- package/dist/languageService/completionProvider.js.map +1 -1
- package/dist/languageService/completionProviderUtils.js.map +1 -1
- package/dist/languageService/definitionProvider.js.map +1 -1
- package/dist/languageService/documentHighlightProvider.js.map +1 -1
- package/dist/languageService/documentSymbolCollector.js.map +1 -1
- package/dist/languageService/documentSymbolProvider.js.map +1 -1
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/languageService/importSorter.js.map +1 -1
- package/dist/languageService/navigationUtils.js.map +1 -1
- package/dist/languageService/quickActions.js.map +1 -1
- package/dist/languageService/referencesProvider.js +11 -1
- package/dist/languageService/referencesProvider.js.map +1 -1
- package/dist/languageService/renameProvider.js.map +1 -1
- package/dist/languageService/signatureHelpProvider.js.map +1 -1
- package/dist/languageService/symbolIndexer.js.map +1 -1
- package/dist/languageService/tooltipUtils.js.map +1 -1
- package/dist/languageService/workspaceSymbolProvider.js.map +1 -1
- package/dist/localization/localize.d.ts +15 -2
- package/dist/localization/localize.js +7 -2
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.cs.json +15 -7
- package/dist/localization/package.nls.de.json +17 -9
- package/dist/localization/package.nls.en-us.json +7 -2
- package/dist/localization/package.nls.es.json +16 -8
- package/dist/localization/package.nls.fr.json +16 -8
- package/dist/localization/package.nls.it.json +16 -8
- package/dist/localization/package.nls.ja.json +17 -9
- package/dist/localization/package.nls.ko.json +14 -6
- package/dist/localization/package.nls.pl.json +14 -6
- package/dist/localization/package.nls.pt-br.json +17 -9
- package/dist/localization/package.nls.qps-ploc.json +12 -4
- package/dist/localization/package.nls.ru.json +17 -9
- package/dist/localization/package.nls.tr.json +16 -8
- package/dist/localization/package.nls.zh-cn.json +17 -9
- package/dist/localization/package.nls.zh-tw.json +17 -9
- package/dist/nodeMain.js.map +1 -1
- package/dist/nodeServer.js.map +1 -1
- package/dist/parser/characterStream.js.map +1 -1
- package/dist/parser/characters.js.map +1 -1
- package/dist/parser/parseNodes.js.map +1 -1
- package/dist/parser/parser.js.map +1 -1
- package/dist/parser/stringTokenUtils.js.map +1 -1
- package/dist/parser/tokenizer.js.map +1 -1
- package/dist/parser/tokenizerTypes.js.map +1 -1
- package/dist/parser/unicode.js.map +1 -1
- package/dist/pprof/profiler.js.map +1 -1
- package/dist/pyright.js.map +1 -1
- package/dist/pyrightFileSystem.js.map +1 -1
- package/dist/readonlyAugmentedFileSystem.js.map +1 -1
- package/dist/server.d.ts +2 -1
- package/dist/server.js +9 -7
- package/dist/server.js.map +1 -1
- package/dist/tests/cacheManager.test.js.map +1 -1
- package/dist/tests/chainedSourceFiles.test.js.map +1 -1
- package/dist/tests/checker.test.js.map +1 -1
- package/dist/tests/classDeclaration.test.js.map +1 -1
- package/dist/tests/collectionUtils.test.js.map +1 -1
- package/dist/tests/common.test.js.map +1 -1
- package/dist/tests/completions.test.js +23 -0
- package/dist/tests/completions.test.js.map +1 -1
- package/dist/tests/config.test.js +1 -2
- package/dist/tests/config.test.js.map +1 -1
- package/dist/tests/debug.test.js.map +1 -1
- package/dist/tests/deferred.test.js.map +1 -1
- package/dist/tests/diagnosticOverrides.test.js.map +1 -1
- package/dist/tests/diagnostics.test.js.map +1 -1
- package/dist/tests/docStringConversion.test.js.map +1 -1
- package/dist/tests/docStringUtils.test.js.map +1 -1
- package/dist/tests/documentSymbolCollector.test.js.map +1 -1
- package/dist/tests/envVarUtils.test.d.ts +1 -0
- package/dist/tests/envVarUtils.test.js +130 -0
- package/dist/tests/envVarUtils.test.js.map +1 -0
- package/dist/tests/filesystem.test.js.map +1 -1
- package/dist/tests/fourSlashParser.test.js.map +1 -1
- package/dist/tests/fourSlashRunner.test.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.Lib.NotFound.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.disabled.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.lib.alias.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.builtinOverride.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.classVariable.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.comment.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.class.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.exception.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.for.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.importAlias.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.lambda.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.method.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.overload.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dunderNew.Inheritance.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dunderNew.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.enums.members.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.errorNodes.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.excluded.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.fstring.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.fuzzyMatching.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.importDunderNames.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.importInterimFile.fourslash.disabled.js.map +1 -1
- package/dist/tests/fourslash/completions.importPrivateNoPytyped.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.importPytyped.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.importPytypedLocal.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.importSubmodule.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.importsDuplicates.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.inList.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.included.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.inherited.function.docFromStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.inherited.property.docFromSrc.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.inherited.property.docFromStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.libStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.literals.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.localCode.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.moduleContext.UnknownMemberOnInstance.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.moduleContext.UnknownStaticFunctionOnClass.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.moduleContext.libCodeNoStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.overloads.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.override.default.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.override.default.importStub.js.map +1 -1
- package/dist/tests/fourslash/completions.override.default.imported.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.override.default.stub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.override.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.override.property.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.override.property.stub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.override.stub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.override2.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.parameters.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.params.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.parentFolder.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.parentFolders.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.plainText.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.private.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.property.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.propertyDocStrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.self.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.triggers.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.typeAlias.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.typeshed.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.vardecls.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.variableDocStrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.with.fourslash.js.map +1 -1
- package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.classes.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.fields.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.functions.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.methods.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.modules.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.namespaceImportWithInit.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.overloads.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.parameters.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.variables.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.importalias.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.module.nested.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.modules.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.openFiles.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.parameter.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.variable.fourslash.js.map +1 -1
- package/dist/tests/fourslash/fourslash.js.map +1 -1
- package/dist/tests/fourslash/highlightreferences.attributes.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.async.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.class.docString.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.classNoInit.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.stringFormat.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docstring.alias.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docstring.links.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docstring.overloads.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docstring.parameter.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docstring.split.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.dunderNew.basic.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.dunderNew.inheritance.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.dunderNew.inheritance2.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.dunderNew.overloads.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.dunderNew.withInit.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.formatted.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.import.django.view.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.import.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.inferred.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.inherited.property.docFromSrcWithStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.inherited.property.docFromStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.init.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.libStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.optionalAliasParameter.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.overloadedFunction.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.plainText.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.slots.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.typedDict.key.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.unpackedTypedDict.key.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.variable.docString.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.js.map +1 -1
- package/dist/tests/fourslash/import.multipart.fourslash.js.map +1 -1
- package/dist/tests/fourslash/import.publicSymbols.fourslash.js.map +1 -1
- package/dist/tests/fourslash/import.pytyped.dunderAll.fourslash.js.map +1 -1
- package/dist/tests/fourslash/import.pytyped.privateSymbols.fourslash.js.map +1 -1
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.js.map +1 -1
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.js.map +1 -1
- package/dist/tests/fourslash/import.wildcard.fourslash.js.map +1 -1
- package/dist/tests/fourslash/importnotresolved.fourslash.js.map +1 -1
- package/dist/tests/fourslash/missingModuleSource.disablingInStrictMode.fourslash.js.map +1 -1
- package/dist/tests/fourslash/missingModuleSource.fourslash.js.map +1 -1
- package/dist/tests/fourslash/missingTypeStub.codeAction.fourslash.js.map +1 -1
- package/dist/tests/fourslash/missingTypeStub.command.multipart.fourslash.js.map +1 -1
- package/dist/tests/fourslash/missingTypeStub.command.singlefile.fourslash.js.map +1 -1
- package/dist/tests/fourslash/missingTypeStub.command.singlepart.fourslash.js.map +1 -1
- package/dist/tests/fourslash/missingTypeStub.command.trycatchImport.fourslash.js.map +1 -1
- package/dist/tests/fourslash/missingTypeStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/missingTypeStub.invokeCodeAction.fourslash.js.map +1 -1
- package/dist/tests/fourslash/noerrors.fourslash.js.map +1 -1
- package/dist/tests/fourslash/orderImports1.command.fourslash.js.map +1 -1
- package/dist/tests/fourslash/orderImports2.command.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.externallyHidden.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.externallyHidden.params.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.function.untitledFile.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.init.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.library.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.library.sourceAndStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.multipleDecl.fourslash.d.ts +1 -1
- package/dist/tests/fourslash/rename.multipleDecl.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.parens.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.sourceAndStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.string.excluded.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.string.fourslash.js.map +1 -1
- package/dist/tests/fourslash/shadowedImports.fourslash.js.map +1 -1
- package/dist/tests/fourslash/showcallhierarchy.incomingCalls.aliasedFunction.fourslash.js.map +1 -1
- package/dist/tests/fourslash/showcallhierarchy.incomingCalls.aliasedVariable.fourslash.js.map +1 -1
- package/dist/tests/fourslash/showcallhierarchy.incomingCalls.function.fourslash.js.map +1 -1
- package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.aliasedFunction1.fourslash.js.map +1 -1
- package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.aliasedFunction2.fourslash.js.map +1 -1
- package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.function.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.complicated.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.cornercases.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.docstrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.dunderNew.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.overload.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.simple.fourslash.js.map +1 -1
- package/dist/tests/fourslash/typeVerifier.fourslash.js.map +1 -1
- package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -1
- package/dist/tests/harness/fourslash/fourSlashTypes.js.map +1 -1
- package/dist/tests/harness/fourslash/runner.js +1 -1
- package/dist/tests/harness/fourslash/runner.js.map +1 -1
- package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -1
- package/dist/tests/harness/fourslash/testState.Consts.js.map +1 -1
- package/dist/tests/harness/fourslash/testState.d.ts +0 -13
- package/dist/tests/harness/fourslash/testState.js.map +1 -1
- package/dist/tests/harness/fourslash/testStateUtils.js.map +1 -1
- package/dist/tests/harness/fourslash/workspaceEditTestUtils.js.map +1 -1
- package/dist/tests/harness/testAccessHost.js.map +1 -1
- package/dist/tests/harness/testHost.js.map +1 -1
- package/dist/tests/harness/utils.js.map +1 -1
- package/dist/tests/harness/vfs/factory.js.map +1 -1
- package/dist/tests/harness/vfs/filesystem.js.map +1 -1
- package/dist/tests/harness/vfs/pathValidation.js.map +1 -1
- package/dist/tests/hoverProvider.test.js.map +1 -1
- package/dist/tests/importResolver.test.js.map +1 -1
- package/dist/tests/importStatementUtils.test.js.map +1 -1
- package/dist/tests/ipythonMode.test.js.map +1 -1
- package/dist/tests/languageServer.test.d.ts +1 -0
- package/dist/tests/languageServer.test.js +137 -0
- package/dist/tests/languageServer.test.js.map +1 -0
- package/dist/tests/localizer.test.js.map +1 -1
- package/dist/tests/logger.test.js.map +1 -1
- package/dist/tests/lsp/customLsp.d.ts +112 -0
- package/dist/tests/lsp/customLsp.js +67 -0
- package/dist/tests/lsp/customLsp.js.map +1 -0
- package/dist/tests/lsp/languageServer.d.ts +1 -0
- package/dist/tests/lsp/languageServer.js +326 -0
- package/dist/tests/lsp/languageServer.js.map +1 -0
- package/dist/tests/lsp/languageServerTestUtils.d.ts +100 -0
- package/dist/tests/lsp/languageServerTestUtils.js +803 -0
- package/dist/tests/lsp/languageServerTestUtils.js.map +1 -0
- package/dist/tests/lsp/main.d.ts +1 -0
- package/dist/tests/lsp/main.js +12 -0
- package/dist/tests/lsp/main.js.map +1 -0
- package/dist/tests/lsp/webpack.testserver.config.d.ts +4 -0
- package/dist/tests/lsp/webpack.testserver.config.js +64 -0
- package/dist/tests/lsp/webpack.testserver.config.js.map +1 -0
- package/dist/tests/parseTreeUtils.test.js.map +1 -1
- package/dist/tests/parser.test.js.map +1 -1
- package/dist/tests/pathUtils.test.js.map +1 -1
- package/dist/tests/positionUtils.test.js.map +1 -1
- package/dist/tests/pyrightFileSystem.test.js.map +1 -1
- package/dist/tests/serialization.test.js.map +1 -1
- package/dist/tests/service.test.js.map +1 -1
- package/dist/tests/signatureHelp.test.js.map +1 -1
- package/dist/tests/sourceFile.test.js.map +1 -1
- package/dist/tests/sourceMapperUtils.test.js.map +1 -1
- package/dist/tests/stringUtils.test.js.map +1 -1
- package/dist/tests/symbolNameUtils.test.js.map +1 -1
- package/dist/tests/testState.test.js.map +1 -1
- package/dist/tests/testStateUtils.js.map +1 -1
- package/dist/tests/testUtils.js.map +1 -1
- package/dist/tests/textEditUtil.test.js.map +1 -1
- package/dist/tests/textRange.test.js.map +1 -1
- package/dist/tests/tokenizer.test.js.map +1 -1
- package/dist/tests/typeEvaluator1.test.js +12 -8
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator2.test.js +7 -3
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +2 -2
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +2 -2
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/tests/typeEvaluator5.test.js +1 -1
- package/dist/tests/typeEvaluator5.test.js.map +1 -1
- package/dist/tests/typePrinter.test.js.map +1 -1
- package/dist/tests/uri.test.js +74 -26
- package/dist/tests/uri.test.js.map +1 -1
- package/dist/tests/workspaceEditUtils.test.js.map +1 -1
- package/dist/tests/zipfs.test.js.map +1 -1
- package/dist/workspaceFactory.js +2 -1
- package/dist/workspaceFactory.js.map +1 -1
- package/package.json +20 -12
@@ -0,0 +1,803 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* languageServerTestUtils.ts
|
4
|
+
* Copyright (c) Microsoft Corporation.
|
5
|
+
* Licensed under the MIT license.
|
6
|
+
*
|
7
|
+
* Utilities for running tests against the LSP server.
|
8
|
+
*/
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
14
|
+
}
|
15
|
+
Object.defineProperty(o, k2, desc);
|
16
|
+
}) : (function(o, m, k, k2) {
|
17
|
+
if (k2 === undefined) k2 = k;
|
18
|
+
o[k2] = m[k];
|
19
|
+
}));
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
22
|
+
}) : function(o, v) {
|
23
|
+
o["default"] = v;
|
24
|
+
});
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
26
|
+
if (mod && mod.__esModule) return mod;
|
27
|
+
var result = {};
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
29
|
+
__setModuleDefault(result, mod);
|
30
|
+
return result;
|
31
|
+
};
|
32
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
33
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
34
|
+
};
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
36
|
+
exports.TestHost = exports.getInitializeParams = exports.hover = exports.openFile = exports.sleep = exports.initializeLanguageServer = exports.runPyrightServer = exports.waitForDiagnostics = exports.getParseResults = exports.updateSettingsMap = exports.createFileSystem = exports.getFileLikePath = exports.cleanupAfterAll = exports.logToDiskImpl = exports.logToDisk = exports.TestHostOptions = exports.STALL_SCRIPT_OUTPUT = exports.ERROR_SCRIPT_OUTPUT = exports.DEFAULT_WORKSPACE_ROOT = void 0;
|
37
|
+
const assert_1 = __importDefault(require("assert"));
|
38
|
+
const fs = __importStar(require("fs-extra"));
|
39
|
+
const node_worker_threads_1 = require("node:worker_threads");
|
40
|
+
const path_1 = __importDefault(require("path"));
|
41
|
+
const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
|
42
|
+
const node_1 = require("vscode-languageserver/node");
|
43
|
+
const configOptions_1 = require("../../common/configOptions");
|
44
|
+
const deferred_1 = require("../../common/deferred");
|
45
|
+
const diagnosticSink_1 = require("../../common/diagnosticSink");
|
46
|
+
const fullAccessHost_1 = require("../../common/fullAccessHost");
|
47
|
+
const pathUtils_1 = require("../../common/pathUtils");
|
48
|
+
const positionUtils_1 = require("../../common/positionUtils");
|
49
|
+
const pythonVersion_1 = require("../../common/pythonVersion");
|
50
|
+
const fileUri_1 = require("../../common/uri/fileUri");
|
51
|
+
const uri_1 = require("../../common/uri/uri");
|
52
|
+
const parser_1 = require("../../parser/parser");
|
53
|
+
const fourSlashParser_1 = require("../harness/fourslash/fourSlashParser");
|
54
|
+
const testStateUtils_1 = require("../harness/fourslash/testStateUtils");
|
55
|
+
const host = __importStar(require("../harness/testHost"));
|
56
|
+
const factory_1 = require("../harness/vfs/factory");
|
57
|
+
const vfs = __importStar(require("../harness/vfs/filesystem"));
|
58
|
+
const customLsp_1 = require("./customLsp");
|
59
|
+
// bundled root on test virtual file system.
|
60
|
+
const bundledStubsFolder = (0, pathUtils_1.combinePaths)(vfs.MODULE_PATH, 'bundled', 'stubs');
|
61
|
+
// bundled file path on real file system.
|
62
|
+
const bundledStubsFolderPath = (0, pathUtils_1.resolvePaths)(__dirname, '../../bundled/stubs');
|
63
|
+
const bundledStubsFolderPathTestServer = (0, pathUtils_1.resolvePaths)(__dirname, '../bundled/stubs');
|
64
|
+
// project root on test virtual file system.
|
65
|
+
exports.DEFAULT_WORKSPACE_ROOT = (0, pathUtils_1.combinePaths)('/', 'src');
|
66
|
+
exports.ERROR_SCRIPT_OUTPUT = 'Error: script failed to run';
|
67
|
+
exports.STALL_SCRIPT_OUTPUT = 'Timeout: script never finished running';
|
68
|
+
class TestHostOptions {
|
69
|
+
constructor({ version = pythonVersion_1.PythonVersion.V3_10, platform = configOptions_1.PythonPlatform.Linux, searchPaths = [factory_1.libFolder, factory_1.distlibFolder], runScript = async (pythonPath, scriptPath, args, cwd, token) => {
|
70
|
+
return { stdout: '', stderr: '' };
|
71
|
+
}, } = {}) {
|
72
|
+
this.version = version;
|
73
|
+
this.platform = platform;
|
74
|
+
this.searchPaths = searchPaths;
|
75
|
+
this.runScript = runScript;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
exports.TestHostOptions = TestHostOptions;
|
79
|
+
// Enable this to log to disk for debugging sync issues.
|
80
|
+
const logToDisk = (m, f) => { }; // logToDiskImpl
|
81
|
+
exports.logToDisk = logToDisk;
|
82
|
+
function logToDiskImpl(message, fileName) {
|
83
|
+
const thread = node_worker_threads_1.isMainThread ? 'main' : node_worker_threads_1.threadId.toString();
|
84
|
+
fs.writeFileSync(fileName.getFilePath(), `${Date.now()} : ${thread} : ${message}\n`, {
|
85
|
+
flag: 'a+',
|
86
|
+
});
|
87
|
+
}
|
88
|
+
exports.logToDiskImpl = logToDiskImpl;
|
89
|
+
// Global server worker.
|
90
|
+
let serverWorker;
|
91
|
+
let serverWorkerFile;
|
92
|
+
let lastServerFinished = { name: '', finished: true };
|
93
|
+
function removeAllListeners(worker) {
|
94
|
+
// Only remove the 'message', 'error' and 'close' events
|
95
|
+
worker.rawListeners('message').forEach((listener) => worker.removeListener('message', listener));
|
96
|
+
worker.rawListeners('error').forEach((listener) => worker.removeListener('error', listener));
|
97
|
+
worker.rawListeners('close').forEach((listener) => worker.removeListener('close', listener));
|
98
|
+
}
|
99
|
+
function createServerWorker(file, testServerData) {
|
100
|
+
// Do not terminate the worker if it's the same file. Reuse it.
|
101
|
+
// This makes tests run a lot faster because creating a worker is the same
|
102
|
+
// as starting a new process.
|
103
|
+
if (!serverWorker || serverWorkerFile !== file) {
|
104
|
+
serverWorker === null || serverWorker === void 0 ? void 0 : serverWorker.terminate();
|
105
|
+
serverWorkerFile = file;
|
106
|
+
serverWorker = new node_worker_threads_1.Worker(file);
|
107
|
+
(0, exports.logToDisk)(`Created new server worker for ${file}`, testServerData.logFile);
|
108
|
+
}
|
109
|
+
// Every time we 'create' the worker, refresh its message handlers. This
|
110
|
+
// is essentially the same thing as creating a new worker.
|
111
|
+
removeAllListeners(serverWorker);
|
112
|
+
(0, exports.logToDisk)(`Removed all worker listeners. Test ${testServerData.testName} is starting.\n Last test was ${lastServerFinished.name} and finished: ${lastServerFinished.finished}`, testServerData.logFile);
|
113
|
+
serverWorker.on('error', (e) => {
|
114
|
+
(0, exports.logToDisk)(`Worker error: ${e}`, testServerData.logFile);
|
115
|
+
});
|
116
|
+
serverWorker.on('exit', (code) => {
|
117
|
+
(0, exports.logToDisk)(`Worker exit: ${code}`, testServerData.logFile);
|
118
|
+
});
|
119
|
+
return serverWorker;
|
120
|
+
}
|
121
|
+
async function cleanupAfterAll() {
|
122
|
+
if (serverWorker) {
|
123
|
+
await serverWorker.terminate();
|
124
|
+
serverWorker = undefined;
|
125
|
+
}
|
126
|
+
}
|
127
|
+
exports.cleanupAfterAll = cleanupAfterAll;
|
128
|
+
function getFileLikePath(uri) {
|
129
|
+
return fileUri_1.FileUri.isFileUri(uri) ? uri.getFilePath() : uri.toString();
|
130
|
+
}
|
131
|
+
exports.getFileLikePath = getFileLikePath;
|
132
|
+
function createFileSystem(projectRoot, testData, optionalHost) {
|
133
|
+
const mountedPaths = new Map();
|
134
|
+
if (fs.existsSync(bundledStubsFolderPath)) {
|
135
|
+
mountedPaths.set(bundledStubsFolder, bundledStubsFolderPath);
|
136
|
+
}
|
137
|
+
else if (fs.existsSync(bundledStubsFolderPathTestServer)) {
|
138
|
+
mountedPaths.set(bundledStubsFolder, bundledStubsFolderPathTestServer);
|
139
|
+
}
|
140
|
+
const vfsInfo = (0, testStateUtils_1.createVfsInfoFromFourSlashData)(projectRoot, testData);
|
141
|
+
return (0, factory_1.createFromFileSystem)(optionalHost !== null && optionalHost !== void 0 ? optionalHost : host.HOST, vfsInfo.ignoreCase, { cwd: vfsInfo.projectRoot, files: vfsInfo.files, meta: testData.globalOptions }, mountedPaths);
|
142
|
+
}
|
143
|
+
exports.createFileSystem = createFileSystem;
|
144
|
+
const settingsMap = new Map();
|
145
|
+
function updateSettingsMap(info, settings) {
|
146
|
+
// Normalize the URIs for all of the settings.
|
147
|
+
settings.forEach((s) => {
|
148
|
+
if (s.item.scopeUri) {
|
149
|
+
s.item.scopeUri = uri_1.Uri.parse(s.item.scopeUri, true).toString();
|
150
|
+
}
|
151
|
+
});
|
152
|
+
const current = settingsMap.get(info) || [];
|
153
|
+
settingsMap.set(info, [...settings, ...current]);
|
154
|
+
}
|
155
|
+
exports.updateSettingsMap = updateSettingsMap;
|
156
|
+
function getParseResults(fileContents, isStubFile = false, ipythonMode = 0) {
|
157
|
+
const diagSink = new diagnosticSink_1.DiagnosticSink();
|
158
|
+
const parseOptions = new parser_1.ParseOptions();
|
159
|
+
parseOptions.ipythonMode = ipythonMode;
|
160
|
+
parseOptions.isStubFile = isStubFile;
|
161
|
+
parseOptions.pythonVersion = pythonVersion_1.PythonVersion.V3_10;
|
162
|
+
parseOptions.skipFunctionAndClassBody = false;
|
163
|
+
// Parse the token stream, building the abstract syntax tree.
|
164
|
+
const parser = new parser_1.Parser();
|
165
|
+
return parser.parseSourceFile(fileContents, parseOptions, diagSink);
|
166
|
+
}
|
167
|
+
exports.getParseResults = getParseResults;
|
168
|
+
function createServerConnection(testServerData, disposables) {
|
169
|
+
// Start a worker with the server running in it.
|
170
|
+
const serverPath = path_1.default.join(__dirname, '..', '..', '..', 'out', 'testServer.bundle.js');
|
171
|
+
(0, assert_1.default)(fs.existsSync(serverPath), `Server bundle does not exist: ${serverPath}. Make sure you ran the build script for test bundle (npm run webpack:testserver).`);
|
172
|
+
const serverWorker = createServerWorker(serverPath, testServerData);
|
173
|
+
const options = {};
|
174
|
+
const connection = (0, node_1.createConnection)(new node_1.PortMessageReader(serverWorker), new node_1.PortMessageWriter(serverWorker), options);
|
175
|
+
disposables.push(connection);
|
176
|
+
return connection;
|
177
|
+
}
|
178
|
+
async function waitForDiagnostics(info, timeout = 10000) {
|
179
|
+
const deferred = (0, deferred_1.createDeferred)();
|
180
|
+
const disposable = info.diagnosticsEvent((params) => {
|
181
|
+
if (params.diagnostics.length > 0) {
|
182
|
+
deferred.resolve();
|
183
|
+
}
|
184
|
+
});
|
185
|
+
const timer = setTimeout(() => deferred.reject('Timed out waiting for diagnostics'), timeout);
|
186
|
+
try {
|
187
|
+
await deferred.promise;
|
188
|
+
}
|
189
|
+
finally {
|
190
|
+
clearTimeout(timer);
|
191
|
+
disposable.dispose();
|
192
|
+
}
|
193
|
+
return info.diagnostics;
|
194
|
+
}
|
195
|
+
exports.waitForDiagnostics = waitForDiagnostics;
|
196
|
+
class TestProgressPart {
|
197
|
+
constructor(_context, _token, info, done) {
|
198
|
+
this._context = _context;
|
199
|
+
this._token = _token;
|
200
|
+
info.disposables.push(info.connection.onProgress(node_1.WorkDoneProgress.type, _token, (params) => {
|
201
|
+
var _a;
|
202
|
+
switch (params.kind) {
|
203
|
+
case 'begin':
|
204
|
+
info.progressReporterStatus.set(_token.toString(), 0);
|
205
|
+
break;
|
206
|
+
case 'report':
|
207
|
+
info.progressReporterStatus.set(_token.toString(), (_a = params.percentage) !== null && _a !== void 0 ? _a : 0);
|
208
|
+
break;
|
209
|
+
case 'end':
|
210
|
+
done();
|
211
|
+
break;
|
212
|
+
}
|
213
|
+
}));
|
214
|
+
info.progressReporters.push(this._token.toString());
|
215
|
+
info.progressParts.set(this._token.toString(), this);
|
216
|
+
}
|
217
|
+
sendCancel() {
|
218
|
+
this._context.sendNotification(node_1.WorkDoneProgressCancelNotification.type, { token: this._token });
|
219
|
+
}
|
220
|
+
}
|
221
|
+
async function runPyrightServer(projectRoots, code, callInitialize = true, extraSettings, pythonVersion = pythonVersion_1.PythonVersion.V3_10, backgroundAnalysis) {
|
222
|
+
var _a;
|
223
|
+
// Normalize the URIs for all of the settings.
|
224
|
+
extraSettings === null || extraSettings === void 0 ? void 0 : extraSettings.forEach((s) => {
|
225
|
+
if (s.item.scopeUri) {
|
226
|
+
s.item.scopeUri = uri_1.Uri.parse(s.item.scopeUri, true).toString();
|
227
|
+
}
|
228
|
+
});
|
229
|
+
// Setup the test data we need to send for Test server startup.
|
230
|
+
const projectRootsArray = Array.isArray(projectRoots) ? projectRoots : [projectRoots];
|
231
|
+
const testServerData = {
|
232
|
+
testName: (_a = expect.getState().currentTestName) !== null && _a !== void 0 ? _a : 'NoName',
|
233
|
+
code,
|
234
|
+
projectRoots: projectRootsArray.map((p) => (p.includes(':') ? uri_1.Uri.parse(p, true) : uri_1.Uri.file(p))),
|
235
|
+
pythonVersion,
|
236
|
+
backgroundAnalysis,
|
237
|
+
logFile: uri_1.Uri.file(path_1.default.join(__dirname, `log${process.pid}.txt`)),
|
238
|
+
pid: process.pid.toString(),
|
239
|
+
};
|
240
|
+
(0, exports.logToDisk)(`Starting test ${testServerData.testName}`, testServerData.logFile);
|
241
|
+
lastServerFinished = { name: testServerData.testName, finished: false };
|
242
|
+
// Parse the test data on this side as well. This allows the use of markers and such.
|
243
|
+
const testData = (0, fourSlashParser_1.parseTestData)(testServerData.projectRoots.length === 1
|
244
|
+
? getFileLikePath(testServerData.projectRoots[0])
|
245
|
+
: exports.DEFAULT_WORKSPACE_ROOT, testServerData.code, 'noname.py');
|
246
|
+
// Start listening to the 'client' side of the connection.
|
247
|
+
const disposables = [];
|
248
|
+
const connection = createServerConnection(testServerData, disposables);
|
249
|
+
const serverStarted = (0, deferred_1.createDeferred)();
|
250
|
+
const diagnosticsEmitter = new node_1.Emitter();
|
251
|
+
const workspaceEditsEmitter = new node_1.Emitter();
|
252
|
+
// Setup the server info.
|
253
|
+
const info = {
|
254
|
+
disposables,
|
255
|
+
registrations: [],
|
256
|
+
connection,
|
257
|
+
logs: [],
|
258
|
+
progressReporters: [],
|
259
|
+
progressReporterStatus: new Map(),
|
260
|
+
progressParts: new Map(),
|
261
|
+
signals: new Map(Object.values(customLsp_1.CustomLSP.TestSignalKinds).map((v) => [v, (0, deferred_1.createDeferred)()])),
|
262
|
+
testData,
|
263
|
+
testName: testServerData.testName,
|
264
|
+
telemetry: [],
|
265
|
+
projectRoots: testServerData.projectRoots,
|
266
|
+
diagnostics: [],
|
267
|
+
diagnosticsEvent: diagnosticsEmitter.event,
|
268
|
+
workspaceEdits: [],
|
269
|
+
workspaceEditsEvent: workspaceEditsEmitter.event,
|
270
|
+
getInitializeParams: () => getInitializeParams(testServerData.projectRoots),
|
271
|
+
convertPathToUri: (path) => uri_1.Uri.file(path),
|
272
|
+
dispose: async () => {
|
273
|
+
// Send shutdown. This should disconnect the dispatcher and kill the server.
|
274
|
+
await connection.sendRequest(vscode_languageserver_protocol_1.ShutdownRequest.type, undefined);
|
275
|
+
// Now we can dispose the connection.
|
276
|
+
disposables.forEach((d) => d.dispose());
|
277
|
+
(0, exports.logToDisk)(`Finished test ${testServerData.testName}`, testServerData.logFile);
|
278
|
+
},
|
279
|
+
};
|
280
|
+
info.disposables.push(info.connection.onNotification(customLsp_1.CustomLSP.Notifications.TestStartServerResponse, (p) => {
|
281
|
+
serverStarted.resolve(p.testName);
|
282
|
+
}), info.connection.onRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, (p) => {
|
283
|
+
info.registrations.push(...p.registrations);
|
284
|
+
}), info.connection.onNotification(customLsp_1.CustomLSP.Notifications.TestSignal, (p) => {
|
285
|
+
info.signals.get(p.kind).resolve(true);
|
286
|
+
}), info.connection.onNotification(vscode_languageserver_protocol_1.LogMessageNotification.type, (p) => {
|
287
|
+
info.logs.push(p);
|
288
|
+
}), info.connection.onRequest(vscode_languageserver_protocol_1.SemanticTokensRefreshRequest.type, () => {
|
289
|
+
// empty. Sliently ignore for now.
|
290
|
+
}), info.connection.onRequest(vscode_languageserver_protocol_1.InlayHintRefreshRequest.type, () => {
|
291
|
+
// empty. Sliently ignore for now.
|
292
|
+
}), info.connection.onRequest(vscode_languageserver_protocol_1.ApplyWorkspaceEditRequest.type, (p) => {
|
293
|
+
info.workspaceEdits.push(p);
|
294
|
+
workspaceEditsEmitter.fire(p);
|
295
|
+
return { applied: true };
|
296
|
+
}), info.connection.onRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, (p) => {
|
297
|
+
const unregisterIds = p.unregisterations.map((u) => u.id);
|
298
|
+
info.registrations = info.registrations.filter((r) => !unregisterIds.includes(r.id));
|
299
|
+
}), info.connection.onRequest(node_1.WorkDoneProgressCreateRequest.type, (p) => {
|
300
|
+
// Save the progress reporter so we can send progress updates.
|
301
|
+
info.progressReporters.push(p.token.toString());
|
302
|
+
info.disposables.push(info.connection.onProgress(node_1.WorkDoneProgress.type, p.token, (params) => {
|
303
|
+
var _a;
|
304
|
+
switch (params.kind) {
|
305
|
+
case 'begin':
|
306
|
+
info.progressReporterStatus.set(p.token.toString(), 0);
|
307
|
+
break;
|
308
|
+
case 'report':
|
309
|
+
info.progressReporterStatus.set(p.token.toString(), (_a = params.percentage) !== null && _a !== void 0 ? _a : 0);
|
310
|
+
break;
|
311
|
+
case 'end':
|
312
|
+
break;
|
313
|
+
}
|
314
|
+
}));
|
315
|
+
}), info.connection.onNotification(vscode_languageserver_protocol_1.PublishDiagnosticsNotification.type, (p) => {
|
316
|
+
info.diagnostics.push(p);
|
317
|
+
diagnosticsEmitter.fire(p);
|
318
|
+
}), info.connection.onNotification(vscode_languageserver_protocol_1.TelemetryEventNotification.type, (p) => {
|
319
|
+
info.telemetry.push(p);
|
320
|
+
}));
|
321
|
+
info.disposables.push(info.connection.onRequest(vscode_languageserver_protocol_1.ConfigurationRequest.type, (p) => {
|
322
|
+
const result = [];
|
323
|
+
const mappedSettings = settingsMap.get(info) || [];
|
324
|
+
for (const item of p.items) {
|
325
|
+
const setting = mappedSettings.find((s) => (s.item.scopeUri === item.scopeUri || s.item.scopeUri === undefined) &&
|
326
|
+
s.item.section === item.section);
|
327
|
+
result.push(setting === null || setting === void 0 ? void 0 : setting.value);
|
328
|
+
}
|
329
|
+
return result;
|
330
|
+
}));
|
331
|
+
// Merge the extra settings.
|
332
|
+
const settings = [];
|
333
|
+
if (extraSettings) {
|
334
|
+
for (const extra of extraSettings) {
|
335
|
+
const existing = settings.find((s) => s.item.section === extra.item.section && s.item.scopeUri === extra.item.scopeUri);
|
336
|
+
if (existing) {
|
337
|
+
existing.value = { ...existing.value, ...extra.value };
|
338
|
+
}
|
339
|
+
else {
|
340
|
+
settings.push(extra);
|
341
|
+
}
|
342
|
+
}
|
343
|
+
}
|
344
|
+
settingsMap.set(info, settings);
|
345
|
+
// Wait for the server to be started.
|
346
|
+
connection.listen();
|
347
|
+
(0, exports.logToDisk)(`Sending start notification for ${testServerData.testName}`, testServerData.logFile);
|
348
|
+
customLsp_1.CustomLSP.sendNotification(connection, customLsp_1.CustomLSP.Notifications.TestStartServer, testServerData);
|
349
|
+
const serverTestName = await serverStarted.promise;
|
350
|
+
assert_1.default.equal(serverTestName, testServerData.testName, 'Server started for wrong test');
|
351
|
+
(0, exports.logToDisk)(`Started test ${testServerData.testName}`, testServerData.logFile);
|
352
|
+
// Initialize the server if requested.
|
353
|
+
if (callInitialize) {
|
354
|
+
await initializeLanguageServer(info);
|
355
|
+
(0, exports.logToDisk)(`Initialized test ${testServerData.testName}`, testServerData.logFile);
|
356
|
+
}
|
357
|
+
if (lastServerFinished.name === testServerData.testName) {
|
358
|
+
lastServerFinished.finished = true;
|
359
|
+
}
|
360
|
+
else {
|
361
|
+
(0, exports.logToDisk)(`Last server finished was incorrectly updated to ${lastServerFinished.name}`, testServerData.logFile);
|
362
|
+
}
|
363
|
+
return info;
|
364
|
+
}
|
365
|
+
exports.runPyrightServer = runPyrightServer;
|
366
|
+
async function initializeLanguageServer(info) {
|
367
|
+
var _a;
|
368
|
+
const params = info.getInitializeParams();
|
369
|
+
// Send the initialize request.
|
370
|
+
const result = await info.connection.sendRequest(vscode_languageserver_protocol_1.InitializeRequest.type, params, vscode_languageserver_protocol_1.CancellationToken.None);
|
371
|
+
info.connection.sendNotification(vscode_languageserver_protocol_1.InitializedNotification.type, {});
|
372
|
+
if ((_a = params.workspaceFolders) === null || _a === void 0 ? void 0 : _a.length) {
|
373
|
+
info.connection.sendNotification(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type, {
|
374
|
+
event: {
|
375
|
+
added: params.workspaceFolders,
|
376
|
+
removed: [],
|
377
|
+
},
|
378
|
+
});
|
379
|
+
// Wait until workspace initialization is done.
|
380
|
+
// This is required since some tests check status of server directly. In such case, even if the client sent notification,
|
381
|
+
// server might not have processed it and still in the event queue.
|
382
|
+
// This check makes sure server at least processed initialization before test checking server status directly.
|
383
|
+
// If test only uses response from client.sendRequest, then this won't be needed.
|
384
|
+
await info.signals.get(customLsp_1.CustomLSP.TestSignalKinds.Initialization).promise;
|
385
|
+
}
|
386
|
+
return result;
|
387
|
+
}
|
388
|
+
exports.initializeLanguageServer = initializeLanguageServer;
|
389
|
+
async function sleep(timeout) {
|
390
|
+
return new Promise((resolve) => {
|
391
|
+
setTimeout(() => resolve(timeout), timeout);
|
392
|
+
});
|
393
|
+
}
|
394
|
+
exports.sleep = sleep;
|
395
|
+
function openFile(info, markerName, text) {
|
396
|
+
const marker = (0, testStateUtils_1.getMarkerByName)(info.testData, markerName);
|
397
|
+
const uri = marker.fileUri.toString();
|
398
|
+
text = text !== null && text !== void 0 ? text : info.testData.files.find((f) => f.fileName === marker.fileName).content;
|
399
|
+
info.connection.sendNotification(vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.type, {
|
400
|
+
textDocument: { uri, languageId: 'python', version: 1, text },
|
401
|
+
});
|
402
|
+
}
|
403
|
+
exports.openFile = openFile;
|
404
|
+
async function hover(info, markerName) {
|
405
|
+
const marker = info.testData.markerPositions.get('marker');
|
406
|
+
const fileUri = marker.fileUri;
|
407
|
+
const text = info.testData.files.find((d) => d.fileName === marker.fileName).content;
|
408
|
+
const parseResult = getParseResults(text);
|
409
|
+
const hoverResult = await info.connection.sendRequest(node_1.HoverRequest.type, {
|
410
|
+
textDocument: { uri: fileUri.toString() },
|
411
|
+
position: (0, positionUtils_1.convertOffsetToPosition)(marker.position, parseResult.tokenizerOutput.lines),
|
412
|
+
}, vscode_languageserver_protocol_1.CancellationToken.None);
|
413
|
+
return hoverResult;
|
414
|
+
}
|
415
|
+
exports.hover = hover;
|
416
|
+
function getInitializeParams(projectRoots) {
|
417
|
+
// cloned vscode "1.71.0-insider"'s initialize params.
|
418
|
+
const workspaceFolders = projectRoots
|
419
|
+
? projectRoots.map((root, i) => ({ name: root.fileName, uri: projectRoots[i].toString() }))
|
420
|
+
: [];
|
421
|
+
const params = {
|
422
|
+
processId: process.pid,
|
423
|
+
clientInfo: {
|
424
|
+
name: `Pylance Unit Test ${expect.getState().currentTestName}`,
|
425
|
+
version: '1.71.0-insider',
|
426
|
+
},
|
427
|
+
locale: 'en-us',
|
428
|
+
rootPath: null,
|
429
|
+
rootUri: null,
|
430
|
+
capabilities: {
|
431
|
+
workspace: {
|
432
|
+
applyEdit: true,
|
433
|
+
workspaceEdit: {
|
434
|
+
documentChanges: true,
|
435
|
+
resourceOperations: ['create', 'rename', 'delete'],
|
436
|
+
failureHandling: 'textOnlyTransactional',
|
437
|
+
normalizesLineEndings: true,
|
438
|
+
changeAnnotationSupport: {
|
439
|
+
groupsOnLabel: true,
|
440
|
+
},
|
441
|
+
},
|
442
|
+
configuration: true,
|
443
|
+
didChangeWatchedFiles: {
|
444
|
+
dynamicRegistration: true,
|
445
|
+
relativePatternSupport: true,
|
446
|
+
},
|
447
|
+
symbol: {
|
448
|
+
dynamicRegistration: true,
|
449
|
+
symbolKind: {
|
450
|
+
valueSet: [
|
451
|
+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
|
452
|
+
26,
|
453
|
+
],
|
454
|
+
},
|
455
|
+
tagSupport: {
|
456
|
+
valueSet: [1],
|
457
|
+
},
|
458
|
+
resolveSupport: {
|
459
|
+
properties: ['location.range'],
|
460
|
+
},
|
461
|
+
},
|
462
|
+
codeLens: {
|
463
|
+
refreshSupport: true,
|
464
|
+
},
|
465
|
+
executeCommand: {
|
466
|
+
dynamicRegistration: true,
|
467
|
+
},
|
468
|
+
didChangeConfiguration: {
|
469
|
+
dynamicRegistration: true,
|
470
|
+
},
|
471
|
+
workspaceFolders: true,
|
472
|
+
semanticTokens: {
|
473
|
+
refreshSupport: true,
|
474
|
+
},
|
475
|
+
fileOperations: {
|
476
|
+
dynamicRegistration: true,
|
477
|
+
didCreate: true,
|
478
|
+
didRename: true,
|
479
|
+
didDelete: true,
|
480
|
+
willCreate: true,
|
481
|
+
willRename: true,
|
482
|
+
willDelete: true,
|
483
|
+
},
|
484
|
+
inlineValue: {
|
485
|
+
refreshSupport: true,
|
486
|
+
},
|
487
|
+
inlayHint: {
|
488
|
+
refreshSupport: true,
|
489
|
+
},
|
490
|
+
diagnostics: {
|
491
|
+
refreshSupport: true,
|
492
|
+
},
|
493
|
+
},
|
494
|
+
textDocument: {
|
495
|
+
publishDiagnostics: {
|
496
|
+
relatedInformation: true,
|
497
|
+
versionSupport: false,
|
498
|
+
tagSupport: {
|
499
|
+
valueSet: [1, 2],
|
500
|
+
},
|
501
|
+
codeDescriptionSupport: true,
|
502
|
+
dataSupport: true,
|
503
|
+
},
|
504
|
+
synchronization: {
|
505
|
+
dynamicRegistration: true,
|
506
|
+
willSave: true,
|
507
|
+
willSaveWaitUntil: true,
|
508
|
+
didSave: true,
|
509
|
+
},
|
510
|
+
completion: {
|
511
|
+
dynamicRegistration: true,
|
512
|
+
contextSupport: true,
|
513
|
+
completionItem: {
|
514
|
+
snippetSupport: true,
|
515
|
+
commitCharactersSupport: true,
|
516
|
+
documentationFormat: ['markdown', 'plaintext'],
|
517
|
+
deprecatedSupport: true,
|
518
|
+
preselectSupport: true,
|
519
|
+
tagSupport: {
|
520
|
+
valueSet: [1],
|
521
|
+
},
|
522
|
+
insertReplaceSupport: true,
|
523
|
+
resolveSupport: {
|
524
|
+
properties: ['documentation', 'detail', 'additionalTextEdits'],
|
525
|
+
},
|
526
|
+
insertTextModeSupport: {
|
527
|
+
valueSet: [1, 2],
|
528
|
+
},
|
529
|
+
labelDetailsSupport: true,
|
530
|
+
},
|
531
|
+
insertTextMode: 2,
|
532
|
+
completionItemKind: {
|
533
|
+
valueSet: [
|
534
|
+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
|
535
|
+
],
|
536
|
+
},
|
537
|
+
completionList: {
|
538
|
+
itemDefaults: ['commitCharacters', 'editRange', 'insertTextFormat', 'insertTextMode'],
|
539
|
+
},
|
540
|
+
},
|
541
|
+
hover: {
|
542
|
+
dynamicRegistration: true,
|
543
|
+
contentFormat: ['markdown', 'plaintext'],
|
544
|
+
},
|
545
|
+
signatureHelp: {
|
546
|
+
dynamicRegistration: true,
|
547
|
+
signatureInformation: {
|
548
|
+
documentationFormat: ['markdown', 'plaintext'],
|
549
|
+
parameterInformation: {
|
550
|
+
labelOffsetSupport: true,
|
551
|
+
},
|
552
|
+
activeParameterSupport: true,
|
553
|
+
},
|
554
|
+
contextSupport: true,
|
555
|
+
},
|
556
|
+
definition: {
|
557
|
+
dynamicRegistration: true,
|
558
|
+
linkSupport: true,
|
559
|
+
},
|
560
|
+
references: {
|
561
|
+
dynamicRegistration: true,
|
562
|
+
},
|
563
|
+
documentHighlight: {
|
564
|
+
dynamicRegistration: true,
|
565
|
+
},
|
566
|
+
documentSymbol: {
|
567
|
+
dynamicRegistration: true,
|
568
|
+
symbolKind: {
|
569
|
+
valueSet: [
|
570
|
+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
|
571
|
+
26,
|
572
|
+
],
|
573
|
+
},
|
574
|
+
hierarchicalDocumentSymbolSupport: true,
|
575
|
+
tagSupport: {
|
576
|
+
valueSet: [1],
|
577
|
+
},
|
578
|
+
labelSupport: true,
|
579
|
+
},
|
580
|
+
codeAction: {
|
581
|
+
dynamicRegistration: true,
|
582
|
+
isPreferredSupport: true,
|
583
|
+
disabledSupport: true,
|
584
|
+
dataSupport: true,
|
585
|
+
resolveSupport: {
|
586
|
+
properties: ['edit'],
|
587
|
+
},
|
588
|
+
codeActionLiteralSupport: {
|
589
|
+
codeActionKind: {
|
590
|
+
valueSet: [
|
591
|
+
'',
|
592
|
+
'quickfix',
|
593
|
+
'refactor',
|
594
|
+
'refactor.extract',
|
595
|
+
'refactor.inline',
|
596
|
+
'refactor.rewrite',
|
597
|
+
'source',
|
598
|
+
'source.organizeImports',
|
599
|
+
],
|
600
|
+
},
|
601
|
+
},
|
602
|
+
honorsChangeAnnotations: false,
|
603
|
+
},
|
604
|
+
codeLens: {
|
605
|
+
dynamicRegistration: true,
|
606
|
+
},
|
607
|
+
formatting: {
|
608
|
+
dynamicRegistration: true,
|
609
|
+
},
|
610
|
+
rangeFormatting: {
|
611
|
+
dynamicRegistration: true,
|
612
|
+
},
|
613
|
+
onTypeFormatting: {
|
614
|
+
dynamicRegistration: true,
|
615
|
+
},
|
616
|
+
rename: {
|
617
|
+
dynamicRegistration: true,
|
618
|
+
prepareSupport: true,
|
619
|
+
prepareSupportDefaultBehavior: 1,
|
620
|
+
honorsChangeAnnotations: true,
|
621
|
+
},
|
622
|
+
documentLink: {
|
623
|
+
dynamicRegistration: true,
|
624
|
+
tooltipSupport: true,
|
625
|
+
},
|
626
|
+
typeDefinition: {
|
627
|
+
dynamicRegistration: true,
|
628
|
+
linkSupport: true,
|
629
|
+
},
|
630
|
+
implementation: {
|
631
|
+
dynamicRegistration: true,
|
632
|
+
linkSupport: true,
|
633
|
+
},
|
634
|
+
colorProvider: {
|
635
|
+
dynamicRegistration: true,
|
636
|
+
},
|
637
|
+
foldingRange: {
|
638
|
+
dynamicRegistration: true,
|
639
|
+
rangeLimit: 5000,
|
640
|
+
lineFoldingOnly: true,
|
641
|
+
foldingRangeKind: {
|
642
|
+
valueSet: ['comment', 'imports', 'region'],
|
643
|
+
},
|
644
|
+
foldingRange: {
|
645
|
+
collapsedText: false,
|
646
|
+
},
|
647
|
+
},
|
648
|
+
declaration: {
|
649
|
+
dynamicRegistration: true,
|
650
|
+
linkSupport: true,
|
651
|
+
},
|
652
|
+
selectionRange: {
|
653
|
+
dynamicRegistration: true,
|
654
|
+
},
|
655
|
+
callHierarchy: {
|
656
|
+
dynamicRegistration: true,
|
657
|
+
},
|
658
|
+
semanticTokens: {
|
659
|
+
dynamicRegistration: true,
|
660
|
+
tokenTypes: [
|
661
|
+
'namespace',
|
662
|
+
'type',
|
663
|
+
'class',
|
664
|
+
'enum',
|
665
|
+
'interface',
|
666
|
+
'struct',
|
667
|
+
'typeParameter',
|
668
|
+
'parameter',
|
669
|
+
'variable',
|
670
|
+
'property',
|
671
|
+
'enumMember',
|
672
|
+
'event',
|
673
|
+
'function',
|
674
|
+
'method',
|
675
|
+
'macro',
|
676
|
+
'keyword',
|
677
|
+
'modifier',
|
678
|
+
'comment',
|
679
|
+
'string',
|
680
|
+
'number',
|
681
|
+
'regexp',
|
682
|
+
'operator',
|
683
|
+
'decorator',
|
684
|
+
],
|
685
|
+
tokenModifiers: [
|
686
|
+
'declaration',
|
687
|
+
'definition',
|
688
|
+
'readonly',
|
689
|
+
'static',
|
690
|
+
'deprecated',
|
691
|
+
'abstract',
|
692
|
+
'async',
|
693
|
+
'modification',
|
694
|
+
'documentation',
|
695
|
+
'defaultLibrary',
|
696
|
+
],
|
697
|
+
formats: ['relative'],
|
698
|
+
requests: {
|
699
|
+
range: true,
|
700
|
+
full: {
|
701
|
+
delta: true,
|
702
|
+
},
|
703
|
+
},
|
704
|
+
multilineTokenSupport: false,
|
705
|
+
overlappingTokenSupport: false,
|
706
|
+
serverCancelSupport: true,
|
707
|
+
augmentsSyntaxTokens: true,
|
708
|
+
},
|
709
|
+
linkedEditingRange: {
|
710
|
+
dynamicRegistration: true,
|
711
|
+
},
|
712
|
+
typeHierarchy: {
|
713
|
+
dynamicRegistration: true,
|
714
|
+
},
|
715
|
+
inlineValue: {
|
716
|
+
dynamicRegistration: true,
|
717
|
+
},
|
718
|
+
inlayHint: {
|
719
|
+
dynamicRegistration: true,
|
720
|
+
resolveSupport: {
|
721
|
+
properties: ['tooltip', 'textEdits', 'label.tooltip', 'label.location', 'label.command'],
|
722
|
+
},
|
723
|
+
},
|
724
|
+
diagnostic: {
|
725
|
+
dynamicRegistration: true,
|
726
|
+
relatedDocumentSupport: false,
|
727
|
+
},
|
728
|
+
},
|
729
|
+
window: {
|
730
|
+
showMessage: {
|
731
|
+
messageActionItem: {
|
732
|
+
additionalPropertiesSupport: true,
|
733
|
+
},
|
734
|
+
},
|
735
|
+
showDocument: {
|
736
|
+
support: true,
|
737
|
+
},
|
738
|
+
workDoneProgress: true,
|
739
|
+
},
|
740
|
+
general: {
|
741
|
+
staleRequestSupport: {
|
742
|
+
cancel: true,
|
743
|
+
retryOnContentModified: [
|
744
|
+
'textDocument/semanticTokens/full',
|
745
|
+
'textDocument/semanticTokens/range',
|
746
|
+
'textDocument/semanticTokens/full/delta',
|
747
|
+
],
|
748
|
+
},
|
749
|
+
regularExpressions: {
|
750
|
+
engine: 'ECMAScript',
|
751
|
+
version: 'ES2020',
|
752
|
+
},
|
753
|
+
markdown: {
|
754
|
+
parser: 'marked',
|
755
|
+
version: '1.1.0',
|
756
|
+
},
|
757
|
+
positionEncodings: ['utf-16'],
|
758
|
+
},
|
759
|
+
notebookDocument: {
|
760
|
+
synchronization: {
|
761
|
+
dynamicRegistration: true,
|
762
|
+
executionSummarySupport: true,
|
763
|
+
},
|
764
|
+
},
|
765
|
+
},
|
766
|
+
initializationOptions: {
|
767
|
+
autoFormatStrings: true,
|
768
|
+
},
|
769
|
+
workspaceFolders,
|
770
|
+
};
|
771
|
+
return params;
|
772
|
+
}
|
773
|
+
exports.getInitializeParams = getInitializeParams;
|
774
|
+
class TestHost extends fullAccessHost_1.LimitedAccessHost {
|
775
|
+
constructor(fs, testFs, testData, projectRoots, options) {
|
776
|
+
super();
|
777
|
+
this.fs = fs;
|
778
|
+
this.testFs = testFs;
|
779
|
+
this.testData = testData;
|
780
|
+
this.projectRoots = projectRoots;
|
781
|
+
this._options = options !== null && options !== void 0 ? options : new TestHostOptions();
|
782
|
+
}
|
783
|
+
get kind() {
|
784
|
+
return 0 /* HostKind.FullAccess */;
|
785
|
+
}
|
786
|
+
getPythonVersion(pythonPath, logInfo) {
|
787
|
+
return this._options.version;
|
788
|
+
}
|
789
|
+
getPythonPlatform(logInfo) {
|
790
|
+
return this._options.platform;
|
791
|
+
}
|
792
|
+
getPythonSearchPaths(pythonPath, logInfo) {
|
793
|
+
return {
|
794
|
+
paths: this._options.searchPaths,
|
795
|
+
prefix: uri_1.Uri.empty(),
|
796
|
+
};
|
797
|
+
}
|
798
|
+
runScript(pythonPath, scriptPath, args, cwd, token) {
|
799
|
+
return this._options.runScript(pythonPath, scriptPath, args, cwd, token);
|
800
|
+
}
|
801
|
+
}
|
802
|
+
exports.TestHost = TestHost;
|
803
|
+
//# sourceMappingURL=languageServerTestUtils.js.map
|