@zzzen/pyright-internal 1.2.0-dev.20221016 → 1.2.0-dev.20221204
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/backgroundAnalysisProgram.d.ts +7 -9
- package/dist/analyzer/backgroundAnalysisProgram.js +14 -52
- package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -1
- package/dist/analyzer/binder.js +43 -32
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/checker.d.ts +15 -3
- package/dist/analyzer/checker.js +260 -143
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/codeFlowEngine.d.ts +2 -2
- package/dist/analyzer/codeFlowEngine.js +85 -88
- package/dist/analyzer/codeFlowEngine.js.map +1 -1
- package/dist/analyzer/codeFlowTypes.d.ts +1 -0
- package/dist/analyzer/codeFlowTypes.js +3 -1
- package/dist/analyzer/codeFlowTypes.js.map +1 -1
- package/dist/analyzer/constraintSolver.js +11 -1
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/dataClasses.d.ts +3 -3
- package/dist/analyzer/dataClasses.js +92 -59
- package/dist/analyzer/dataClasses.js.map +1 -1
- package/dist/analyzer/declaration.js.map +1 -1
- package/dist/analyzer/declarationUtils.d.ts +1 -1
- package/dist/analyzer/declarationUtils.js +6 -4
- package/dist/analyzer/declarationUtils.js.map +1 -1
- package/dist/analyzer/docStringConversion.js +7 -5
- package/dist/analyzer/docStringConversion.js.map +1 -1
- package/dist/analyzer/importResolver.d.ts +3 -0
- package/dist/analyzer/importResolver.js +50 -8
- package/dist/analyzer/importResolver.js.map +1 -1
- package/dist/analyzer/importResult.d.ts +1 -0
- package/dist/analyzer/namedTuples.js +1 -1
- package/dist/analyzer/namedTuples.js.map +1 -1
- package/dist/analyzer/packageTypeVerifier.d.ts +2 -1
- package/dist/analyzer/packageTypeVerifier.js +16 -10
- package/dist/analyzer/packageTypeVerifier.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.d.ts +2 -1
- package/dist/analyzer/parseTreeUtils.js +38 -3
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/parseTreeWalker.d.ts +86 -79
- package/dist/analyzer/parseTreeWalker.js +384 -201
- package/dist/analyzer/parseTreeWalker.js.map +1 -1
- package/dist/analyzer/program.d.ts +4 -7
- package/dist/analyzer/program.js +84 -79
- package/dist/analyzer/program.js.map +1 -1
- package/dist/analyzer/properties.js +10 -3
- package/dist/analyzer/properties.js.map +1 -1
- package/dist/analyzer/protocols.js +1 -1
- package/dist/analyzer/protocols.js.map +1 -1
- package/dist/analyzer/regions.d.ts +11 -0
- package/dist/analyzer/regions.js +57 -0
- package/dist/analyzer/regions.js.map +1 -0
- package/dist/analyzer/service.d.ts +11 -6
- package/dist/analyzer/service.js +127 -65
- package/dist/analyzer/service.js.map +1 -1
- package/dist/analyzer/sourceFile.d.ts +5 -2
- package/dist/analyzer/sourceFile.js +23 -10
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/sourceFileInfoUtils.d.ts +1 -1
- package/dist/analyzer/sourceFileInfoUtils.js +1 -1
- package/dist/analyzer/sourceFileInfoUtils.js.map +1 -1
- package/dist/analyzer/sourceMapper.d.ts +6 -1
- package/dist/analyzer/sourceMapper.js +28 -5
- package/dist/analyzer/sourceMapper.js.map +1 -1
- package/dist/analyzer/sourceMapperUtils.d.ts +2 -1
- package/dist/analyzer/sourceMapperUtils.js +17 -5
- package/dist/analyzer/sourceMapperUtils.js.map +1 -1
- package/dist/analyzer/staticExpressions.js +19 -9
- package/dist/analyzer/staticExpressions.js.map +1 -1
- package/dist/analyzer/symbolUtils.d.ts +1 -0
- package/dist/analyzer/symbolUtils.js +5 -1
- package/dist/analyzer/symbolUtils.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +664 -257
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.d.ts +16 -4
- package/dist/analyzer/typeGuards.js +9 -0
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typePrinter.d.ts +3 -1
- package/dist/analyzer/typePrinter.js +143 -28
- package/dist/analyzer/typePrinter.js.map +1 -1
- package/dist/analyzer/typeStubWriter.js +5 -1
- package/dist/analyzer/typeStubWriter.js.map +1 -1
- package/dist/analyzer/typeUtils.d.ts +4 -2
- package/dist/analyzer/typeUtils.js +114 -20
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/typedDicts.js +8 -6
- package/dist/analyzer/typedDicts.js.map +1 -1
- package/dist/analyzer/types.d.ts +7 -5
- package/dist/analyzer/types.js +45 -20
- package/dist/analyzer/types.js.map +1 -1
- package/dist/backgroundAnalysisBase.d.ts +6 -4
- package/dist/backgroundAnalysisBase.js +30 -9
- package/dist/backgroundAnalysisBase.js.map +1 -1
- package/dist/backgroundThreadBase.d.ts +2 -1
- package/dist/backgroundThreadBase.js +4 -0
- package/dist/backgroundThreadBase.js.map +1 -1
- package/dist/commands/createTypeStub.js +3 -1
- package/dist/commands/createTypeStub.js.map +1 -1
- package/dist/common/configOptions.d.ts +1 -0
- package/dist/common/configOptions.js +4 -0
- package/dist/common/configOptions.js.map +1 -1
- package/dist/common/core.d.ts +2 -0
- package/dist/common/core.js +24 -3
- package/dist/common/core.js.map +1 -1
- package/dist/common/diagnostic.d.ts +8 -0
- package/dist/common/diagnostic.js +5 -1
- package/dist/common/diagnostic.js.map +1 -1
- package/dist/common/diagnosticRules.d.ts +2 -1
- package/dist/common/diagnosticRules.js +1 -0
- package/dist/common/diagnosticRules.js.map +1 -1
- package/dist/common/fileSystem.d.ts +1 -0
- package/dist/common/fileSystem.js.map +1 -1
- package/dist/common/pathUtils.d.ts +1 -0
- package/dist/common/pathUtils.js +17 -4
- package/dist/common/pathUtils.js.map +1 -1
- package/dist/common/pythonVersion.d.ts +1 -1
- package/dist/common/pythonVersion.js +1 -1
- package/dist/common/realFileSystem.js +12 -3
- package/dist/common/realFileSystem.js.map +1 -1
- package/dist/common/workspaceEditUtils.d.ts +6 -1
- package/dist/common/workspaceEditUtils.js +72 -1
- package/dist/common/workspaceEditUtils.js.map +1 -1
- package/dist/languageServerBase.d.ts +16 -8
- package/dist/languageServerBase.js +76 -32
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/analyzerServiceExecutor.d.ts +6 -2
- package/dist/languageService/analyzerServiceExecutor.js +8 -6
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
- package/dist/languageService/autoImporter.js +2 -1
- package/dist/languageService/autoImporter.js.map +1 -1
- package/dist/languageService/codeActionProvider.js +30 -0
- package/dist/languageService/codeActionProvider.js.map +1 -1
- package/dist/languageService/completionProvider.d.ts +2 -0
- package/dist/languageService/completionProvider.js +84 -32
- package/dist/languageService/completionProvider.js.map +1 -1
- package/dist/languageService/definitionProvider.d.ts +2 -0
- package/dist/languageService/definitionProvider.js +3 -0
- package/dist/languageService/definitionProvider.js.map +1 -1
- package/dist/languageService/documentSymbolCollector.js +7 -3
- package/dist/languageService/documentSymbolCollector.js.map +1 -1
- package/dist/languageService/documentSymbolProvider.js +1 -1
- package/dist/languageService/documentSymbolProvider.js.map +1 -1
- package/dist/languageService/hoverProvider.d.ts +1 -1
- package/dist/languageService/hoverProvider.js +73 -38
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/languageService/indentationUtils.d.ts +3 -0
- package/dist/languageService/indentationUtils.js +4 -3
- package/dist/languageService/indentationUtils.js.map +1 -1
- package/dist/languageService/referencesProvider.js +2 -1
- package/dist/languageService/referencesProvider.js.map +1 -1
- package/dist/languageService/signatureHelpProvider.js +1 -2
- package/dist/languageService/signatureHelpProvider.js.map +1 -1
- package/dist/languageService/tooltipUtils.js +30 -19
- package/dist/languageService/tooltipUtils.js.map +1 -1
- package/dist/localization/localize.d.ts +29 -4
- package/dist/localization/localize.js +20 -5
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.en-us.json +18 -3
- package/dist/parser/parseNodes.d.ts +2 -1
- package/dist/parser/parseNodes.js +6 -1
- package/dist/parser/parseNodes.js.map +1 -1
- package/dist/parser/parser.js +29 -15
- package/dist/parser/parser.js.map +1 -1
- package/dist/parser/tokenizer.js +19 -9
- package/dist/parser/tokenizer.js.map +1 -1
- package/dist/pyright.js +4 -4
- package/dist/pyright.js.map +1 -1
- package/dist/pyrightFileSystem.d.ts +1 -0
- package/dist/pyrightFileSystem.js +3 -0
- package/dist/pyrightFileSystem.js.map +1 -1
- package/dist/readonlyAugmentedFileSystem.d.ts +1 -0
- package/dist/readonlyAugmentedFileSystem.js +3 -0
- package/dist/readonlyAugmentedFileSystem.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/tests/chainedSourceFiles.test.js +2 -0
- package/dist/tests/chainedSourceFiles.test.js.map +1 -1
- package/dist/tests/checker.test.js +26 -3
- package/dist/tests/checker.test.js.map +1 -1
- package/dist/tests/config.test.js +11 -0
- package/dist/tests/config.test.js.map +1 -1
- package/dist/tests/diagnostics.test.d.ts +1 -0
- package/dist/tests/diagnostics.test.js +37 -0
- package/dist/tests/diagnostics.test.js.map +1 -0
- package/dist/tests/docStringConversion.test.js +71 -12
- package/dist/tests/docStringConversion.test.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.js +1 -1
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.js +5 -5
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.classVariable.fourslash.js +119 -24
- package/dist/tests/fourslash/completions.classVariable.fourslash.js.map +1 -1
- package/dist/tests/fourslash/{signature.paramspec.fourslash.d.ts → completions.dunderNew.Inheritance.fourslash.d.ts} +0 -0
- package/dist/tests/fourslash/completions.dunderNew.Inheritance.fourslash.js +29 -0
- package/dist/tests/fourslash/completions.dunderNew.Inheritance.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dunderNew.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dunderNew.fourslash.js +20 -0
- package/dist/tests/fourslash/completions.dunderNew.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fourslash.js +2 -2
- package/dist/tests/fourslash/completions.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.js +1 -1
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.js +1 -1
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.libStub.fourslash.js +1 -1
- package/dist/tests/fourslash/completions.libStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.localCode.fourslash.js +2 -2
- package/dist/tests/fourslash/completions.localCode.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.plainText.fourslash.js +2 -2
- package/dist/tests/fourslash/completions.plainText.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.self.fourslash.js +2 -2
- package/dist/tests/fourslash/completions.self.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.js +1 -1
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.js +2 -2
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.namespaceImportWithInit.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.namespaceImportWithInit.fourslash.js +32 -0
- package/dist/tests/fourslash/findDefinitions.namespaceImportWithInit.fourslash.js.map +1 -0
- package/dist/tests/fourslash/fourslash.d.ts +2 -1
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.js +2 -2
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.js +4 -4
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.js +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 +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 +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.js +2 -2
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docstring.alias.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docstring.alias.fourslash.js +24 -0
- package/dist/tests/fourslash/hover.docstring.alias.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docstring.links.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.docstring.links.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.docstring.split.fourslash.js +3 -3
- package/dist/tests/fourslash/hover.docstring.split.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.dunderNew.basic.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.dunderNew.basic.fourslash.js +13 -0
- package/dist/tests/fourslash/hover.dunderNew.basic.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.dunderNew.inheritance.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.dunderNew.inheritance.fourslash.js +15 -0
- package/dist/tests/fourslash/hover.dunderNew.inheritance.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.dunderNew.inheritance2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.dunderNew.inheritance2.fourslash.js +21 -0
- package/dist/tests/fourslash/hover.dunderNew.inheritance2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.dunderNew.overloads.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.dunderNew.overloads.fourslash.js +17 -0
- package/dist/tests/fourslash/hover.dunderNew.overloads.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.dunderNew.withInit.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.dunderNew.withInit.fourslash.js +15 -0
- package/dist/tests/fourslash/hover.dunderNew.withInit.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.js +3 -3
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.js +2 -2
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.js +2 -2
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.init.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.init.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.libStub.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.libStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.plainText.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.plainText.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.js.map +1 -1
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.js +1 -1
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.js.map +1 -1
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.js +1 -1
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.js.map +1 -1
- package/dist/tests/fourslash/shadowedImports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/shadowedImports.fourslash.js +75 -0
- package/dist/tests/fourslash/shadowedImports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.dunderNew.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.dunderNew.fourslash.js +24 -0
- package/dist/tests/fourslash/signature.dunderNew.fourslash.js.map +1 -0
- 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.d.ts +3 -1
- package/dist/tests/harness/fourslash/testLanguageService.js +5 -4
- package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -1
- package/dist/tests/harness/fourslash/testState.d.ts +7 -7
- package/dist/tests/harness/fourslash/testState.js +79 -163
- package/dist/tests/harness/fourslash/testState.js.map +1 -1
- package/dist/tests/harness/fourslash/workspaceEditTestUtils.d.ts +16 -0
- package/dist/tests/harness/fourslash/workspaceEditTestUtils.js +159 -0
- package/dist/tests/harness/fourslash/workspaceEditTestUtils.js.map +1 -0
- package/dist/tests/harness/vfs/filesystem.d.ts +1 -0
- package/dist/tests/harness/vfs/filesystem.js +3 -0
- package/dist/tests/harness/vfs/filesystem.js.map +1 -1
- package/dist/tests/indentationUtils.ptvs.test.js +1 -1
- package/dist/tests/indentationUtils.test.js +4 -4
- package/dist/tests/ipythonMode.test.js +39 -0
- package/dist/tests/ipythonMode.test.js.map +1 -1
- package/dist/tests/logger.test.js +3 -1
- package/dist/tests/logger.test.js.map +1 -1
- package/dist/tests/parser.test.js +3 -3
- package/dist/tests/pathUtils.test.js +7 -0
- package/dist/tests/pathUtils.test.js.map +1 -1
- package/dist/tests/service.test.d.ts +1 -0
- package/dist/tests/service.test.js +159 -0
- package/dist/tests/service.test.js.map +1 -0
- package/dist/tests/sourceFile.test.js +34 -1
- package/dist/tests/sourceFile.test.js.map +1 -1
- package/dist/tests/sourceMapperUtils.test.js +39 -4
- package/dist/tests/sourceMapperUtils.test.js.map +1 -1
- package/dist/tests/tokenizer.test.js +6 -2
- package/dist/tests/tokenizer.test.js.map +1 -1
- package/dist/tests/typeEvaluator1.test.js +16 -6
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator2.test.js +15 -3
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +51 -11
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +11 -7
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/tests/typeEvaluator5.test.js +48 -0
- package/dist/tests/typeEvaluator5.test.js.map +1 -1
- package/dist/tests/typePrinter.test.d.ts +1 -0
- package/dist/tests/typePrinter.test.js +148 -0
- package/dist/tests/typePrinter.test.js.map +1 -0
- package/dist/tests/workspaceEditUtils.test.d.ts +1 -0
- package/dist/tests/workspaceEditUtils.test.js +167 -0
- package/dist/tests/workspaceEditUtils.test.js.map +1 -0
- package/dist/workspaceMap.d.ts +4 -1
- package/dist/workspaceMap.js +64 -16
- package/dist/workspaceMap.js.map +1 -1
- package/package.json +3 -3
- package/dist/tests/fourslash/signature.paramspec.fourslash.js +0 -30
- package/dist/tests/fourslash/signature.paramspec.fourslash.js.map +0 -1
@@ -69,7 +69,6 @@ function runFourSlashTestContent(basePath, fileName, content, cb, mountPaths, ho
|
|
69
69
|
throw new Error(`Syntax error in ${absoluteBasePath}: ${output.diagnostics[0].messageText}`);
|
70
70
|
}
|
71
71
|
runCode(output.outputText, state, cb);
|
72
|
-
state.dispose();
|
73
72
|
}
|
74
73
|
exports.runFourSlashTestContent = runFourSlashTestContent;
|
75
74
|
async function runCode(code, state, cb) {
|
@@ -89,6 +88,7 @@ ${code}
|
|
89
88
|
if (cb) {
|
90
89
|
cb(...args);
|
91
90
|
}
|
91
|
+
state.dispose();
|
92
92
|
}
|
93
93
|
}
|
94
94
|
//# sourceMappingURL=runner.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../../../../src/tests/harness/fourslash/runner.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAiC;AAEjC,yDAAyD;AACzD,kDAAoC;AACpC,uDAAkD;AAElD,2CAA8D;AAC9D,yDAA4C;AAS5C;;;;;GAKG;AACH,SAAgB,gBAAgB,CAC5B,QAAgB,EAChB,QAAgB,EAChB,EAAsB,EACtB,UAAgC,EAChC,oBAA2C,EAC3C,gBAAmC;IAEnC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAE,CAAC;IAC9C,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,oBAAoB,EAAE,gBAAgB,CAAC,CAAC;AACjH,CAAC;AAVD,4CAUC;AAED;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CACnC,QAAgB,EAChB,QAAgB,EAChB,OAAe,EACf,EAAsB,EACtB,UAAgC,EAChC,oBAA2C,EAC3C,gBAAmC;IAEnC,+DAA+D;I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W,EAAE,CAAC,CAAC;KACjG;IAED,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AAC1C,CAAC;AA5BD,0DA4BC;AAED,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,KAAgB,EAAE,EAAsB;IACzE,+BAA+B;IAC/B,IAAI;QACA,MAAM,WAAW,GAAG;EAC1B,IAAI;GACH,CAAC;QACI,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;QAC5B,MAAM,CAAC,CAAC,KAAK,EAAE,yBAAM,CAAC,CAAC;QACvB,QAAQ,EAAE,CAAC;KACd;IAAC,OAAO,EAAE,EAAE;QACT,QAAQ,CAAC,EAAE,CAAC,CAAC;KAChB;IAED,SAAS,QAAQ,CAAC,GAAG,IAAW;QAC5B,IAAI,EAAE,EAAE;YACJ,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;SACf;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;AACL,CAAC"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { CancellationToken, CodeAction, ExecuteCommandParams } from 'vscode-languageserver';
|
2
|
+
import { BackgroundAnalysisProgramFactory } from '../../../analyzer/backgroundAnalysisProgram';
|
2
3
|
import { ImportResolverFactory } from '../../../analyzer/importResolver';
|
3
4
|
import { BackgroundAnalysisBase } from '../../../backgroundAnalysisBase';
|
4
5
|
import { ConsoleInterface } from '../../../common/console';
|
@@ -8,6 +9,7 @@ import { LanguageServerInterface, MessageAction, ServerSettings, WindowInterface
|
|
8
9
|
import { HostSpecificFeatures } from './testState';
|
9
10
|
export declare class TestFeatures implements HostSpecificFeatures {
|
10
11
|
importResolverFactory: ImportResolverFactory;
|
12
|
+
backgroundAnalysisProgramFactory: BackgroundAnalysisProgramFactory;
|
11
13
|
runIndexer(workspace: WorkspaceServiceInstance, noStdLib: boolean, options?: string): void;
|
12
14
|
getCodeActionsForPosition(workspace: WorkspaceServiceInstance, filePath: string, range: Range, token: CancellationToken): Promise<CodeAction[]>;
|
13
15
|
execute(ls: LanguageServerInterface, params: ExecuteCommandParams, token: CancellationToken): Promise<any>;
|
@@ -22,7 +24,7 @@ export declare class TestLanguageService implements LanguageServerInterface {
|
|
22
24
|
decodeTextDocumentUri(uriString: string): string;
|
23
25
|
getWorkspaceForFile(filePath: string): Promise<WorkspaceServiceInstance>;
|
24
26
|
getSettings(workspace: WorkspaceServiceInstance): Promise<ServerSettings>;
|
25
|
-
createBackgroundAnalysis(): BackgroundAnalysisBase | undefined;
|
27
|
+
createBackgroundAnalysis(serviceId: string): BackgroundAnalysisBase | undefined;
|
26
28
|
reanalyze(): void;
|
27
29
|
restart(): void;
|
28
30
|
readonly rootPath: string;
|
@@ -28,11 +28,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
29
|
exports.TestLanguageService = exports.TestFeatures = void 0;
|
30
30
|
const path = __importStar(require("path"));
|
31
|
+
const backgroundAnalysisProgram_1 = require("../../../analyzer/backgroundAnalysisProgram");
|
31
32
|
const service_1 = require("../../../analyzer/service");
|
32
33
|
const commandController_1 = require("../../../commands/commandController");
|
33
34
|
const configOptions_1 = require("../../../common/configOptions");
|
34
35
|
const debug = __importStar(require("../../../common/debug"));
|
35
|
-
const deferred_1 = require("../../../common/deferred");
|
36
36
|
const uriParser_1 = require("../../../common/uriParser");
|
37
37
|
const languageServerBase_1 = require("../../../languageServerBase");
|
38
38
|
const codeActionProvider_1 = require("../../../languageService/codeActionProvider");
|
@@ -40,6 +40,8 @@ const testAccessHost_1 = require("../testAccessHost");
|
|
40
40
|
class TestFeatures {
|
41
41
|
constructor() {
|
42
42
|
this.importResolverFactory = service_1.AnalyzerService.createImportResolver;
|
43
|
+
this.backgroundAnalysisProgramFactory = (serviceId, console, configOptions, importResolver, extension, backgroundAnalysis, maxAnalysisTime, cacheManager) => new backgroundAnalysisProgram_1.BackgroundAnalysisProgram(console, configOptions, importResolver, extension, backgroundAnalysis, maxAnalysisTime,
|
44
|
+
/* disableChecker */ undefined, cacheManager);
|
43
45
|
}
|
44
46
|
runIndexer(workspace, noStdLib, options) {
|
45
47
|
/* empty */
|
@@ -77,9 +79,8 @@ class TestLanguageService {
|
|
77
79
|
disableLanguageServices: false,
|
78
80
|
disableOrganizeImports: false,
|
79
81
|
disableWorkspaceSymbol: false,
|
80
|
-
isInitialized: (0,
|
82
|
+
isInitialized: (0, languageServerBase_1.createInitStatus)(),
|
81
83
|
searchPathsToWatch: [],
|
82
|
-
owns: (f) => true,
|
83
84
|
};
|
84
85
|
}
|
85
86
|
decodeTextDocumentUri(uriString) {
|
@@ -103,7 +104,7 @@ class TestLanguageService {
|
|
103
104
|
};
|
104
105
|
return Promise.resolve(settings);
|
105
106
|
}
|
106
|
-
createBackgroundAnalysis() {
|
107
|
+
createBackgroundAnalysis(serviceId) {
|
107
108
|
// worker thread doesn't work in Jest
|
108
109
|
// by returning undefined, analysis will run inline
|
109
110
|
return undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"testLanguageService.js","sourceRoot":"","sources":["../../../../../src/tests/harness/fourslash/testLanguageService.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;
|
1
|
+
{"version":3,"file":"testLanguageService.js","sourceRoot":"","sources":["../../../../../src/tests/harness/fourslash/testLanguageService.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;AAG7B,2FAGqD;AAIrD,uDAA4D;AAE5D,2EAAwE;AACxE,iEAA8D;AAE9D,6DAA+C;AAI/C,yDAAsD;AACtD,oEAQqC;AACrC,oFAAiF;AACjF,sDAAmD;AAGnD,MAAa,YAAY;IAAzB;QACI,0BAAqB,GAA0B,yBAAe,CAAC,oBAAoB,CAAC;QACpF,qCAAgC,GAAqC,CACjE,SAAiB,EACjB,OAAyB,EACzB,aAA4B,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pF,sBAAsB,EAAE,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,gBAAgB,EAAE,CAAC,sBAAsB;YACjG,uBAAuB,EAAE,IAAI,CAAC,UAAU,CAAC,uBAAuB;YAChE,qBAAqB,EAAE,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,gBAAgB,EAAE,CAAC,qBAAqB;SAClG,CAAC;QAEF,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;IAED,wBAAwB,CAAC,SAAiB;QACtC,qCAAqC;QACrC,mDAAmD;QACnD,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,SAAS;QACL,oBAAoB;IACxB,CAAC;IAED,OAAO;QACH,oBAAoB;IACxB,CAAC;CAKJ;AAtED,kDAsEC;AAED,MAAM,UAAU;IAGZ,gBAAgB,CAAC,OAAe,EAAE,GAAG,OAAwB;QACzD,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACtC,CAAC;IAID,kBAAkB,CAAC,OAAe,EAAE,GAAG,OAAwB;QAC3D,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACtC,CAAC;IAID,sBAAsB,CAAC,OAAe,EAAE,GAAG,OAAwB;QAC/D,oBAAoB;IACxB,CAAC;CACJ"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { CancellationToken, CodeAction, Command, CompletionItem, DocumentHighlight, DocumentHighlightKind, ExecuteCommandParams, MarkupKind, TextEdit, WorkspaceEdit } from 'vscode-languageserver';
|
2
|
+
import { BackgroundAnalysisProgramFactory } from '../../../analyzer/backgroundAnalysisProgram';
|
2
3
|
import { ImportResolver, ImportResolverFactory } from '../../../analyzer/importResolver';
|
3
4
|
import { Program } from '../../../analyzer/program';
|
4
5
|
import { ConfigOptions } from '../../../common/configOptions';
|
@@ -18,6 +19,7 @@ export interface TextChange {
|
|
18
19
|
}
|
19
20
|
export interface HostSpecificFeatures {
|
20
21
|
importResolverFactory: ImportResolverFactory;
|
22
|
+
backgroundAnalysisProgramFactory: BackgroundAnalysisProgramFactory;
|
21
23
|
runIndexer(workspace: WorkspaceServiceInstance, noStdLib: boolean, options?: string): void;
|
22
24
|
getCodeActionsForPosition(workspace: WorkspaceServiceInstance, filePath: string, range: PositionRange, token: CancellationToken): Promise<CodeAction[]>;
|
23
25
|
execute(ls: LanguageServerInterface, params: ExecuteCommandParams, token: CancellationToken): Promise<any>;
|
@@ -64,6 +66,7 @@ export declare class TestState {
|
|
64
66
|
convertPositionRange(range: Range): PositionRange;
|
65
67
|
convertPathToUri(path: string): string;
|
66
68
|
getDirectoryPath(path: string): string;
|
69
|
+
getPathSep(): string;
|
67
70
|
goToPosition(positionOrLineAndColumn: number | Position): void;
|
68
71
|
select(startMarker: string, endMarker: string): void;
|
69
72
|
selectAllInFile(fileName: string): void;
|
@@ -108,12 +111,6 @@ export declare class TestState {
|
|
108
111
|
[filePath: string]: string;
|
109
112
|
}): Promise<any>;
|
110
113
|
verifyWorkspaceEdit(expected: WorkspaceEdit, actual: WorkspaceEdit): void;
|
111
|
-
private _verifyChangeAnnotations;
|
112
|
-
private _textDocumentAreSame;
|
113
|
-
private _verifyDocumentEdits;
|
114
|
-
private _verifyTextEditMap;
|
115
|
-
private _textEditsAreSame;
|
116
|
-
private _textEditAreSame;
|
117
114
|
verifyInvokeCodeAction(map: {
|
118
115
|
[marker: string]: {
|
119
116
|
title: string;
|
@@ -213,7 +210,7 @@ export declare class TestState {
|
|
213
210
|
private _displayExpectedAndActualString;
|
214
211
|
private _makeWhitespaceVisible;
|
215
212
|
private _updatePosition;
|
216
|
-
|
213
|
+
analyze(): void;
|
217
214
|
private _getDiagnosticsPerFile;
|
218
215
|
private _createAnalysisService;
|
219
216
|
private _deepEqual;
|
@@ -238,3 +235,6 @@ export declare function createVfsInfoFromFourSlashData(projectRoot: string, test
|
|
238
235
|
ignoreCase: boolean;
|
239
236
|
rawConfigJson: string;
|
240
237
|
};
|
238
|
+
export declare function getMarkerName(testData: FourSlashData, markerToFind: Marker): string;
|
239
|
+
export declare function getMarkerByName(testData: FourSlashData, markerName: string): Marker;
|
240
|
+
export declare function getMarkerNames(testData: FourSlashData): string[];
|
@@ -1,12 +1,4 @@
|
|
1
1
|
"use strict";
|
2
|
-
/*
|
3
|
-
* testState.ts
|
4
|
-
* Copyright (c) Microsoft Corporation.
|
5
|
-
* Licensed under the MIT license.
|
6
|
-
*
|
7
|
-
* TestState wraps currently test states and provides a way to query and manipulate
|
8
|
-
* the test states.
|
9
|
-
*/
|
10
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
11
3
|
if (k2 === undefined) k2 = k;
|
12
4
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
@@ -30,9 +22,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
31
23
|
};
|
32
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
33
|
-
exports.createVfsInfoFromFourSlashData = exports.getNodeAtMarker = exports.getNodeForRange = exports.parseAndGetTestState = exports.TestState = void 0;
|
25
|
+
exports.getMarkerNames = exports.getMarkerByName = exports.getMarkerName = exports.createVfsInfoFromFourSlashData = exports.getNodeAtMarker = exports.getNodeForRange = exports.parseAndGetTestState = exports.TestState = void 0;
|
26
|
+
/*
|
27
|
+
* testState.ts
|
28
|
+
* Copyright (c) Microsoft Corporation.
|
29
|
+
* Licensed under the MIT license.
|
30
|
+
*
|
31
|
+
* TestState wraps currently test states and provides a way to query and manipulate
|
32
|
+
* the test states.
|
33
|
+
*/
|
34
34
|
const assert_1 = __importDefault(require("assert"));
|
35
35
|
const JSONC = __importStar(require("jsonc-parser"));
|
36
|
+
const path = __importStar(require("path"));
|
36
37
|
const vscode_languageserver_1 = require("vscode-languageserver");
|
37
38
|
const parseTreeUtils_1 = require("../../../analyzer/parseTreeUtils");
|
38
39
|
const service_1 = require("../../../analyzer/service");
|
@@ -42,7 +43,6 @@ const configOptions_1 = require("../../../common/configOptions");
|
|
42
43
|
const console_1 = require("../../../common/console");
|
43
44
|
const core_1 = require("../../../common/core");
|
44
45
|
const debug = __importStar(require("../../../common/debug"));
|
45
|
-
const deferred_1 = require("../../../common/deferred");
|
46
46
|
const pathUtils_1 = require("../../../common/pathUtils");
|
47
47
|
const positionUtils_1 = require("../../../common/positionUtils");
|
48
48
|
const stringUtils_1 = require("../../../common/stringUtils");
|
@@ -60,6 +60,7 @@ const vfs = __importStar(require("../vfs/filesystem"));
|
|
60
60
|
const fourSlashParser_1 = require("./fourSlashParser");
|
61
61
|
const fourSlashTypes_1 = require("./fourSlashTypes");
|
62
62
|
const testLanguageService_1 = require("./testLanguageService");
|
63
|
+
const workspaceEditTestUtils_1 = require("./workspaceEditTestUtils");
|
63
64
|
const testAccessHost = new testAccessHost_1.TestAccessHost(vfs.MODULE_PATH, [factory_1.libFolder, factory_1.distlibFolder]);
|
64
65
|
class TestState {
|
65
66
|
constructor(projectRoot, testData, mountPaths, hostSpecificFeatures) {
|
@@ -84,7 +85,7 @@ class TestState {
|
|
84
85
|
configOptions.initializeFromJson(this.rawConfigJson, 'basic', this.console, this.fs, testAccessHost);
|
85
86
|
this._applyTestConfigOptions(configOptions);
|
86
87
|
}
|
87
|
-
const service = this._createAnalysisService(this.console, this._hostSpecificFeatures.importResolverFactory, configOptions);
|
88
|
+
const service = this._createAnalysisService(this.console, this._hostSpecificFeatures.importResolverFactory, this._hostSpecificFeatures.backgroundAnalysisProgramFactory, configOptions);
|
88
89
|
this.workspace = {
|
89
90
|
workspaceName: 'test workspace',
|
90
91
|
rootPath: vfsInfo.projectRoot,
|
@@ -95,9 +96,8 @@ class TestState {
|
|
95
96
|
disableLanguageServices: false,
|
96
97
|
disableOrganizeImports: false,
|
97
98
|
disableWorkspaceSymbol: false,
|
98
|
-
isInitialized: (0,
|
99
|
+
isInitialized: (0, languageServerBase_1.createInitStatus)(),
|
99
100
|
searchPathsToWatch: [],
|
100
|
-
owns: (f) => true,
|
101
101
|
};
|
102
102
|
const indexer = (0, core_1.toBoolean)(testData.globalOptions["indexer" /* indexer */]);
|
103
103
|
const indexerWithoutStdLib = (0, core_1.toBoolean)(testData.globalOptions["indexerwithoutstdlib" /* indexerWithoutStdLib */]);
|
@@ -158,32 +158,17 @@ class TestState {
|
|
158
158
|
return this.fs.getMappedFilePath(path);
|
159
159
|
}
|
160
160
|
getMarkerName(m) {
|
161
|
-
|
162
|
-
this.testData.markerPositions.forEach((marker, name) => {
|
163
|
-
if (marker === m) {
|
164
|
-
found = name;
|
165
|
-
}
|
166
|
-
});
|
167
|
-
assert_1.default.ok(found);
|
168
|
-
return found;
|
161
|
+
return getMarkerName(this.testData, m);
|
169
162
|
}
|
170
163
|
getMarkerByName(markerName) {
|
171
|
-
|
172
|
-
if (markerPos === undefined) {
|
173
|
-
throw new Error(`Unknown marker "${markerName}" Available markers: ${this.getMarkerNames()
|
174
|
-
.map((m) => '"' + m + '"')
|
175
|
-
.join(', ')}`);
|
176
|
-
}
|
177
|
-
else {
|
178
|
-
return markerPos;
|
179
|
-
}
|
164
|
+
return getMarkerByName(this.testData, markerName);
|
180
165
|
}
|
181
166
|
getMarkers() {
|
182
167
|
// Return a copy of the list
|
183
168
|
return this.testData.markers.slice(0);
|
184
169
|
}
|
185
170
|
getMarkerNames() {
|
186
|
-
return
|
171
|
+
return getMarkerNames(this.testData);
|
187
172
|
}
|
188
173
|
getPositionRange(markerString) {
|
189
174
|
const marker = this.getMarkerByName(markerString);
|
@@ -217,6 +202,9 @@ class TestState {
|
|
217
202
|
getDirectoryPath(path) {
|
218
203
|
return (0, pathUtils_1.getDirectoryPath)(path);
|
219
204
|
}
|
205
|
+
getPathSep() {
|
206
|
+
return path.sep;
|
207
|
+
}
|
220
208
|
goToPosition(positionOrLineAndColumn) {
|
221
209
|
const pos = (0, core_1.isNumber)(positionOrLineAndColumn)
|
222
210
|
? positionOrLineAndColumn
|
@@ -380,7 +368,7 @@ class TestState {
|
|
380
368
|
this._checkPostEditInvariants();
|
381
369
|
}
|
382
370
|
verifyDiagnostics(map) {
|
383
|
-
this.
|
371
|
+
this.analyze();
|
384
372
|
// organize things per file
|
385
373
|
const resultPerFile = this._getDiagnosticsPerFile();
|
386
374
|
const rangePerFile = this.createMultiMap(this.getRanges(), (r) => r.fileName);
|
@@ -415,8 +403,12 @@ class TestState {
|
|
415
403
|
? result.warnings
|
416
404
|
: category === 'information'
|
417
405
|
? result.information
|
418
|
-
:
|
419
|
-
|
406
|
+
: category === 'unused'
|
407
|
+
? result.unused
|
408
|
+
: category === 'none'
|
409
|
+
? []
|
410
|
+
: this.raiseError(`unexpected category ${category}`);
|
411
|
+
if (expected.length !== actual.length && category !== 'none') {
|
420
412
|
this.raiseError(`contains unexpected result - expected: ${(0, utils_1.stringify)(expected)}, actual: ${(0, utils_1.stringify)(actual)}`);
|
421
413
|
}
|
422
414
|
for (const range of expected) {
|
@@ -425,13 +417,19 @@ class TestState {
|
|
425
417
|
const diagnosticSpan = textRange_1.TextRange.fromBounds((0, positionUtils_1.convertPositionToOffset)(d.range.start, lines), (0, positionUtils_1.convertPositionToOffset)(d.range.end, lines));
|
426
418
|
return this._deepEqual(diagnosticSpan, rangeSpan);
|
427
419
|
});
|
428
|
-
|
420
|
+
// If the map is provided, it might say
|
421
|
+
// a marker should have none.
|
422
|
+
const name = map ? this.getMarkerName(range.marker) : '';
|
423
|
+
const message = map ? map[name].message : undefined;
|
424
|
+
const expectMatches = !!message;
|
425
|
+
if (expectMatches && matches.length === 0) {
|
429
426
|
this.raiseError(`doesn't contain expected range: ${(0, utils_1.stringify)(range)}`);
|
430
427
|
}
|
428
|
+
else if (!expectMatches && matches.length !== 0) {
|
429
|
+
this.raiseError(`${name} should not contain any matches`);
|
430
|
+
}
|
431
431
|
// if map is provided, check message as well
|
432
|
-
if (
|
433
|
-
const name = this.getMarkerName(range.marker);
|
434
|
-
const message = map[name].message;
|
432
|
+
if (message) {
|
435
433
|
if (matches.filter((d) => message === d.message).length !== 1) {
|
436
434
|
this.raiseError(`message doesn't match: ${message} of ${name} - ${(0, utils_1.stringify)(range)}, actual: ${(0, utils_1.stringify)(matches)}`);
|
437
435
|
}
|
@@ -454,7 +452,7 @@ class TestState {
|
|
454
452
|
async verifyCodeActions(map, verifyCodeActionCount) {
|
455
453
|
// make sure we don't use cache built from other tests
|
456
454
|
this.workspace.serviceInstance.invalidateAndForceReanalysis();
|
457
|
-
this.
|
455
|
+
this.analyze();
|
458
456
|
for (const range of this.getRanges()) {
|
459
457
|
const name = this.getMarkerName(range.marker);
|
460
458
|
if (!map[name]) {
|
@@ -504,7 +502,7 @@ class TestState {
|
|
504
502
|
}
|
505
503
|
}
|
506
504
|
async verifyCommand(command, files) {
|
507
|
-
this.
|
505
|
+
this.analyze();
|
508
506
|
const commandResult = await this._hostSpecificFeatures.execute(new testLanguageService_1.TestLanguageService(this.workspace, this.console, this.fs), { command: command.command, arguments: command.arguments || [] }, vscode_languageserver_1.CancellationToken.None);
|
509
507
|
if (command.command === 'pyright.createtypestub') {
|
510
508
|
await this._verifyFiles(files);
|
@@ -524,123 +522,11 @@ class TestState {
|
|
524
522
|
return commandResult;
|
525
523
|
}
|
526
524
|
verifyWorkspaceEdit(expected, actual) {
|
527
|
-
|
528
|
-
this._verifyTextEditMap(expected.changes, actual.changes);
|
529
|
-
}
|
530
|
-
else {
|
531
|
-
(0, assert_1.default)(!expected.changes);
|
532
|
-
}
|
533
|
-
if (actual.documentChanges) {
|
534
|
-
this._verifyDocumentEdits(expected.documentChanges, actual.documentChanges);
|
535
|
-
}
|
536
|
-
else {
|
537
|
-
(0, assert_1.default)(!expected.documentChanges);
|
538
|
-
}
|
539
|
-
if (actual.changeAnnotations) {
|
540
|
-
this._verifyChangeAnnotations(expected.changeAnnotations, actual.changeAnnotations);
|
541
|
-
}
|
542
|
-
else {
|
543
|
-
(0, assert_1.default)(!expected.changeAnnotations);
|
544
|
-
}
|
545
|
-
}
|
546
|
-
_verifyChangeAnnotations(expected, actual) {
|
547
|
-
assert_1.default.strictEqual(Object.entries(expected).length, Object.entries(actual).length);
|
548
|
-
for (const key of Object.keys(expected)) {
|
549
|
-
const expectedAnnotation = expected[key];
|
550
|
-
const actualAnnotation = actual[key];
|
551
|
-
// We need to improve it to test localized strings.
|
552
|
-
assert_1.default.strictEqual(expectedAnnotation.label, actualAnnotation.label);
|
553
|
-
assert_1.default.strictEqual(expectedAnnotation.description, actualAnnotation.description);
|
554
|
-
assert_1.default.strictEqual(expectedAnnotation.needsConfirmation, actualAnnotation.needsConfirmation);
|
555
|
-
}
|
556
|
-
}
|
557
|
-
_textDocumentAreSame(expected, actual) {
|
558
|
-
return expected.version === actual.version && expected.uri === actual.uri;
|
559
|
-
}
|
560
|
-
_verifyDocumentEdits(expected, actual) {
|
561
|
-
assert_1.default.strictEqual(expected.length, actual.length);
|
562
|
-
for (const op of expected) {
|
563
|
-
(0, assert_1.default)(actual.some((a) => {
|
564
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
565
|
-
const expectedKind = vscode_languageserver_1.TextDocumentEdit.is(op) ? 'edit' : op.kind;
|
566
|
-
const actualKind = vscode_languageserver_1.TextDocumentEdit.is(a) ? 'edit' : a.kind;
|
567
|
-
if (expectedKind !== actualKind) {
|
568
|
-
return false;
|
569
|
-
}
|
570
|
-
switch (expectedKind) {
|
571
|
-
case 'edit': {
|
572
|
-
const expectedEdit = op;
|
573
|
-
const actualEdit = a;
|
574
|
-
if (!this._textDocumentAreSame(expectedEdit.textDocument, actualEdit.textDocument)) {
|
575
|
-
return false;
|
576
|
-
}
|
577
|
-
return this._textEditsAreSame(expectedEdit.edits, actualEdit.edits);
|
578
|
-
}
|
579
|
-
case 'create': {
|
580
|
-
const expectedOp = op;
|
581
|
-
const actualOp = a;
|
582
|
-
return (expectedOp.kind === actualOp.kind &&
|
583
|
-
expectedOp.annotationId === actualOp.annotationId &&
|
584
|
-
expectedOp.uri === actualOp.uri &&
|
585
|
-
((_a = expectedOp.options) === null || _a === void 0 ? void 0 : _a.ignoreIfExists) === ((_b = actualOp.options) === null || _b === void 0 ? void 0 : _b.ignoreIfExists) &&
|
586
|
-
((_c = expectedOp.options) === null || _c === void 0 ? void 0 : _c.overwrite) === ((_d = actualOp.options) === null || _d === void 0 ? void 0 : _d.overwrite));
|
587
|
-
}
|
588
|
-
case 'rename': {
|
589
|
-
const expectedOp = op;
|
590
|
-
const actualOp = a;
|
591
|
-
return (expectedOp.kind === actualOp.kind &&
|
592
|
-
expectedOp.annotationId === actualOp.annotationId &&
|
593
|
-
expectedOp.oldUri === actualOp.oldUri &&
|
594
|
-
expectedOp.newUri === actualOp.newUri &&
|
595
|
-
((_e = expectedOp.options) === null || _e === void 0 ? void 0 : _e.ignoreIfExists) === ((_f = actualOp.options) === null || _f === void 0 ? void 0 : _f.ignoreIfExists) &&
|
596
|
-
((_g = expectedOp.options) === null || _g === void 0 ? void 0 : _g.overwrite) === ((_h = actualOp.options) === null || _h === void 0 ? void 0 : _h.overwrite));
|
597
|
-
}
|
598
|
-
case 'delete': {
|
599
|
-
const expectedOp = op;
|
600
|
-
const actualOp = a;
|
601
|
-
return (expectedOp.annotationId === actualOp.annotationId &&
|
602
|
-
expectedOp.kind === actualOp.kind &&
|
603
|
-
expectedOp.uri === actualOp.uri &&
|
604
|
-
((_j = expectedOp.options) === null || _j === void 0 ? void 0 : _j.ignoreIfNotExists) === ((_k = actualOp.options) === null || _k === void 0 ? void 0 : _k.ignoreIfNotExists) &&
|
605
|
-
((_l = expectedOp.options) === null || _l === void 0 ? void 0 : _l.recursive) === ((_m = actualOp.options) === null || _m === void 0 ? void 0 : _m.recursive));
|
606
|
-
}
|
607
|
-
default:
|
608
|
-
debug.assertNever(expectedKind);
|
609
|
-
}
|
610
|
-
}));
|
611
|
-
}
|
612
|
-
}
|
613
|
-
_verifyTextEditMap(expected, actual) {
|
614
|
-
assert_1.default.strictEqual(Object.entries(expected).length, Object.entries(actual).length);
|
615
|
-
for (const key of Object.keys(expected)) {
|
616
|
-
(0, assert_1.default)(this._textEditsAreSame(expected[key], actual[key]));
|
617
|
-
}
|
618
|
-
}
|
619
|
-
_textEditsAreSame(expectedEdits, actualEdits) {
|
620
|
-
if (expectedEdits.length !== actualEdits.length) {
|
621
|
-
return false;
|
622
|
-
}
|
623
|
-
for (const edit of expectedEdits) {
|
624
|
-
if (!actualEdits.some((a) => this._textEditAreSame(edit, a))) {
|
625
|
-
return false;
|
626
|
-
}
|
627
|
-
}
|
628
|
-
return true;
|
629
|
-
}
|
630
|
-
_textEditAreSame(expected, actual) {
|
631
|
-
if (!(0, textRange_1.rangesAreEqual)(expected.range, actual.range)) {
|
632
|
-
return false;
|
633
|
-
}
|
634
|
-
if (expected.newText !== actual.newText) {
|
635
|
-
return false;
|
636
|
-
}
|
637
|
-
const expectedAnnotation = vscode_languageserver_1.AnnotatedTextEdit.is(expected) ? expected.annotationId : '';
|
638
|
-
const actualAnnotation = vscode_languageserver_1.AnnotatedTextEdit.is(actual) ? actual.annotationId : '';
|
639
|
-
return expectedAnnotation === actualAnnotation;
|
525
|
+
return (0, workspaceEditTestUtils_1.verifyWorkspaceEdit)(expected, actual);
|
640
526
|
}
|
641
527
|
async verifyInvokeCodeAction(map, verifyCodeActionCount) {
|
642
528
|
var _a;
|
643
|
-
this.
|
529
|
+
this.analyze();
|
644
530
|
for (const range of this.getRanges()) {
|
645
531
|
const name = this.getMarkerName(range.marker);
|
646
532
|
if (!map[name]) {
|
@@ -733,7 +619,7 @@ class TestState {
|
|
733
619
|
}
|
734
620
|
async verifyCompletion(verifyMode, docFormat, map, abbrMap) {
|
735
621
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
736
|
-
this.
|
622
|
+
this.analyze();
|
737
623
|
for (const marker of this.getMarkers()) {
|
738
624
|
const markerName = this.getMarkerName(marker);
|
739
625
|
if (!map[markerName]) {
|
@@ -750,6 +636,7 @@ class TestState {
|
|
750
636
|
autoImport: true,
|
751
637
|
extraCommitChars: true,
|
752
638
|
importFormat: "absolute" /* Absolute */,
|
639
|
+
includeUserSymbolsInAutoImport: false,
|
753
640
|
};
|
754
641
|
const nameMap = abbrMap ? new Map(Object.entries(abbrMap)) : undefined;
|
755
642
|
const result = await this.workspace.serviceInstance.getCompletionsForPosition(filePath, completionPosition, this.workspace.path, options, nameMap, vscode_languageserver_1.CancellationToken.None);
|
@@ -825,7 +712,7 @@ class TestState {
|
|
825
712
|
}
|
826
713
|
}
|
827
714
|
verifySignature(docFormat, map) {
|
828
|
-
this.
|
715
|
+
this.analyze();
|
829
716
|
for (const marker of this.getMarkers()) {
|
830
717
|
const fileName = marker.fileName;
|
831
718
|
const name = this.getMarkerName(marker);
|
@@ -870,7 +757,7 @@ class TestState {
|
|
870
757
|
}
|
871
758
|
verifyFindAllReferences(map) {
|
872
759
|
var _a;
|
873
|
-
this.
|
760
|
+
this.analyze();
|
874
761
|
for (const marker of this.getMarkers()) {
|
875
762
|
const fileName = marker.fileName;
|
876
763
|
const name = this.getMarkerName(marker);
|
@@ -902,7 +789,7 @@ class TestState {
|
|
902
789
|
}
|
903
790
|
verifyHighlightReferences(map) {
|
904
791
|
var _a;
|
905
|
-
this.
|
792
|
+
this.analyze();
|
906
793
|
for (const name of Object.keys(map)) {
|
907
794
|
const marker = this.getMarkerByName(name);
|
908
795
|
const fileName = marker.fileName;
|
@@ -921,7 +808,7 @@ class TestState {
|
|
921
808
|
}
|
922
809
|
verifyFindDefinitions(map, filter = definitionProvider_1.DefinitionFilter.All) {
|
923
810
|
var _a;
|
924
|
-
this.
|
811
|
+
this.analyze();
|
925
812
|
for (const marker of this.getMarkers()) {
|
926
813
|
const fileName = marker.fileName;
|
927
814
|
const name = this.getMarkerName(marker);
|
@@ -939,7 +826,7 @@ class TestState {
|
|
939
826
|
}
|
940
827
|
verifyFindTypeDefinitions(map) {
|
941
828
|
var _a;
|
942
|
-
this.
|
829
|
+
this.analyze();
|
943
830
|
for (const marker of this.getMarkers()) {
|
944
831
|
const fileName = marker.fileName;
|
945
832
|
const name = this.getMarkerName(marker);
|
@@ -957,7 +844,7 @@ class TestState {
|
|
957
844
|
}
|
958
845
|
verifyRename(map) {
|
959
846
|
var _a;
|
960
|
-
this.
|
847
|
+
this.analyze();
|
961
848
|
for (const marker of this.getMarkers()) {
|
962
849
|
const fileName = marker.fileName;
|
963
850
|
const name = this.getMarkerName(marker);
|
@@ -1222,7 +1109,7 @@ class TestState {
|
|
1222
1109
|
// If inside the edit, return -1 to mark as invalid
|
1223
1110
|
return position <= editStart ? position : position < editEnd ? -1 : position + length - +(editEnd - editStart);
|
1224
1111
|
}
|
1225
|
-
|
1112
|
+
analyze() {
|
1226
1113
|
while (this.program.analyze()) {
|
1227
1114
|
// Continue to call analyze until it completes. Since we're not
|
1228
1115
|
// specifying a timeout, it should complete the first time.
|
@@ -1240,6 +1127,7 @@ class TestState {
|
|
1240
1127
|
errors: diagnostics.filter((diag) => diag.category === 0 /* Error */),
|
1241
1128
|
warnings: diagnostics.filter((diag) => diag.category === 1 /* Warning */),
|
1242
1129
|
information: diagnostics.filter((diag) => diag.category === 2 /* Information */),
|
1130
|
+
unused: diagnostics.filter((diag) => diag.category === 3 /* UnusedCode */),
|
1243
1131
|
};
|
1244
1132
|
return [filePath, value];
|
1245
1133
|
}
|
@@ -1249,12 +1137,13 @@ class TestState {
|
|
1249
1137
|
});
|
1250
1138
|
return new Map(results);
|
1251
1139
|
}
|
1252
|
-
_createAnalysisService(nullConsole, importResolverFactory, configOptions) {
|
1140
|
+
_createAnalysisService(nullConsole, importResolverFactory, backgroundAnalysisProgramFactory, configOptions) {
|
1253
1141
|
// we do not initiate automatic analysis or file watcher in test.
|
1254
1142
|
const service = new service_1.AnalyzerService('test service', this.fs, {
|
1255
1143
|
console: nullConsole,
|
1256
1144
|
hostFactory: () => testAccessHost,
|
1257
1145
|
importResolverFactory,
|
1146
|
+
backgroundAnalysisProgramFactory,
|
1258
1147
|
configOptions,
|
1259
1148
|
});
|
1260
1149
|
// directly set files to track rather than using fileSpec from config
|
@@ -1411,6 +1300,33 @@ function createVfsInfoFromFourSlashData(projectRoot, testData) {
|
|
1411
1300
|
return { files, sourceFileNames, projectRoot, ignoreCase, rawConfigJson };
|
1412
1301
|
}
|
1413
1302
|
exports.createVfsInfoFromFourSlashData = createVfsInfoFromFourSlashData;
|
1303
|
+
function getMarkerName(testData, markerToFind) {
|
1304
|
+
let found;
|
1305
|
+
testData.markerPositions.forEach((marker, name) => {
|
1306
|
+
if (marker === markerToFind) {
|
1307
|
+
found = name;
|
1308
|
+
}
|
1309
|
+
});
|
1310
|
+
assert_1.default.ok(found);
|
1311
|
+
return found;
|
1312
|
+
}
|
1313
|
+
exports.getMarkerName = getMarkerName;
|
1314
|
+
function getMarkerByName(testData, markerName) {
|
1315
|
+
const markerPos = testData.markerPositions.get(markerName);
|
1316
|
+
if (markerPos === undefined) {
|
1317
|
+
throw new Error(`Unknown marker "${markerName}" Available markers: ${getMarkerNames(testData)
|
1318
|
+
.map((m) => '"' + m + '"')
|
1319
|
+
.join(', ')}`);
|
1320
|
+
}
|
1321
|
+
else {
|
1322
|
+
return markerPos;
|
1323
|
+
}
|
1324
|
+
}
|
1325
|
+
exports.getMarkerByName = getMarkerByName;
|
1326
|
+
function getMarkerNames(testData) {
|
1327
|
+
return [...testData.markerPositions.keys()];
|
1328
|
+
}
|
1329
|
+
exports.getMarkerNames = getMarkerNames;
|
1414
1330
|
function isConfig(file, ignoreCase) {
|
1415
1331
|
const comparer = (0, stringUtils_1.getStringComparer)(ignoreCase);
|
1416
1332
|
return service_1.configFileNames.some((f) => comparer((0, pathUtils_1.getBaseFileName)(file.fileName), f) === 0 /* EqualTo */);
|