@zzzen/pyright-internal 1.2.0-dev.20221009 → 1.2.0-dev.20221127
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 +10 -10
- package/dist/analyzer/backgroundAnalysisProgram.js +21 -54
- 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/cacheManager.d.ts +7 -7
- package/dist/analyzer/cacheManager.js +17 -15
- package/dist/analyzer/cacheManager.js.map +1 -1
- package/dist/analyzer/checker.d.ts +16 -3
- package/dist/analyzer/checker.js +295 -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 +1 -1
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/dataClasses.d.ts +3 -3
- package/dist/analyzer/dataClasses.js +77 -57
- 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 +4 -3
- package/dist/analyzer/docStringConversion.js.map +1 -1
- package/dist/analyzer/importResolver.d.ts +4 -0
- package/dist/analyzer/importResolver.js +53 -10
- 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 +9 -9
- package/dist/analyzer/program.js +90 -86
- 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 +69 -30
- package/dist/analyzer/service.js.map +1 -1
- package/dist/analyzer/sourceFile.d.ts +5 -2
- package/dist/analyzer/sourceFile.js +21 -8
- 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 +11 -3
- package/dist/analyzer/sourceMapper.js +61 -14
- package/dist/analyzer/sourceMapper.js.map +1 -1
- package/dist/analyzer/sourceMapperUtils.d.ts +10 -0
- package/dist/analyzer/sourceMapperUtils.js +57 -0
- package/dist/analyzer/sourceMapperUtils.js.map +1 -0
- 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 +654 -258
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.d.ts +15 -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 +135 -26
- 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 +112 -25
- 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 +8 -5
- package/dist/analyzer/types.js +49 -20
- package/dist/analyzer/types.js.map +1 -1
- package/dist/backgroundAnalysisBase.d.ts +6 -4
- package/dist/backgroundAnalysisBase.js +30 -8
- 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 +13 -3
- 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 +9 -5
- package/dist/languageServerBase.js +35 -21
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/analyzerServiceExecutor.d.ts +6 -2
- package/dist/languageService/analyzerServiceExecutor.js +7 -4
- 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 +1 -0
- package/dist/languageService/completionProvider.js +66 -28
- 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/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 +33 -4
- package/dist/localization/localize.js +22 -5
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.en-us.json +20 -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 +19 -13
- package/dist/parser/parser.js.map +1 -1
- package/dist/parser/tokenizer.js +2 -1
- 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/checker.test.js +25 -2
- 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 +25 -0
- 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 +28 -6
- 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.builtinClass.fourslash.js +8 -6
- package/dist/tests/fourslash/findDefinitions.builtinClass.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 -0
- 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 +4 -2
- package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -1
- package/dist/tests/harness/fourslash/testState.d.ts +8 -7
- package/dist/tests/harness/fourslash/testState.js +80 -161
- 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/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/pathUtils.test.js +7 -0
- package/dist/tests/pathUtils.test.js.map +1 -1
- package/dist/tests/sourceFile.test.js +34 -1
- package/dist/tests/sourceFile.test.js.map +1 -1
- package/dist/tests/sourceMapperUtils.test.d.ts +1 -0
- package/dist/tests/sourceMapperUtils.test.js +138 -0
- package/dist/tests/sourceMapperUtils.test.js.map +1 -0
- 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 +19 -3
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +44 -10
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +11 -3
- 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 +2 -0
- package/dist/workspaceMap.js +45 -15
- 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
@@ -6,26 +6,26 @@ import { ConsoleInterface } from '../common/console';
|
|
6
6
|
import { Diagnostic } from '../common/diagnostic';
|
7
7
|
import { LanguageServiceExtension } from '../common/extensibility';
|
8
8
|
import { Range } from '../common/textRange';
|
9
|
-
import { IndexResults } from '../languageService/documentSymbolProvider';
|
10
9
|
import { AnalysisCompleteCallback } from './analysis';
|
10
|
+
import { CacheManager } from './cacheManager';
|
11
11
|
import { ImportResolver } from './importResolver';
|
12
|
-
import { MaxAnalysisTime, OpenFileOptions, Program } from './program';
|
12
|
+
import { Indices, MaxAnalysisTime, OpenFileOptions, Program } from './program';
|
13
13
|
export declare class BackgroundAnalysisProgram {
|
14
14
|
private _console;
|
15
15
|
private _configOptions;
|
16
16
|
private _importResolver;
|
17
|
-
|
17
|
+
protected _backgroundAnalysis?: BackgroundAnalysisBase | undefined;
|
18
18
|
private _maxAnalysisTime?;
|
19
19
|
private _disableChecker?;
|
20
20
|
private _program;
|
21
21
|
private _onAnalysisCompletion;
|
22
|
-
|
23
|
-
constructor(_console: ConsoleInterface, _configOptions: ConfigOptions, _importResolver: ImportResolver, extension?: LanguageServiceExtension, _backgroundAnalysis?: BackgroundAnalysisBase | undefined, _maxAnalysisTime?: MaxAnalysisTime | undefined, _disableChecker?: boolean | undefined);
|
22
|
+
constructor(_console: ConsoleInterface, _configOptions: ConfigOptions, _importResolver: ImportResolver, extension?: LanguageServiceExtension, _backgroundAnalysis?: BackgroundAnalysisBase | undefined, _maxAnalysisTime?: MaxAnalysisTime | undefined, _disableChecker?: boolean | undefined, cacheManager?: CacheManager);
|
24
23
|
get configOptions(): ConfigOptions;
|
25
24
|
get importResolver(): ImportResolver;
|
26
25
|
get program(): Program;
|
27
26
|
get host(): import("../common/host").Host;
|
28
27
|
get backgroundAnalysis(): BackgroundAnalysisBase | undefined;
|
28
|
+
contains(filePath: string): boolean;
|
29
29
|
setConfigOptions(configOptions: ConfigOptions): void;
|
30
30
|
setImportResolver(importResolver: ImportResolver): void;
|
31
31
|
setTrackedFiles(filePaths: string[]): void;
|
@@ -34,22 +34,22 @@ export declare class BackgroundAnalysisProgram {
|
|
34
34
|
getChainedFilePath(filePath: string): string | undefined;
|
35
35
|
updateChainedFilePath(filePath: string, chainedFilePath: string | undefined): void;
|
36
36
|
updateOpenFileContents(path: string, version: number | null, contents: TextDocumentContentChangeEvent[], options: OpenFileOptions): void;
|
37
|
-
setFileClosed(filePath: string): void;
|
37
|
+
setFileClosed(filePath: string, isTracked?: boolean): void;
|
38
38
|
markAllFilesDirty(evenIfContentsAreSame: boolean, indexingNeeded?: boolean): void;
|
39
39
|
markFilesDirty(filePaths: string[], evenIfContentsAreSame: boolean, indexingNeeded?: boolean): void;
|
40
40
|
setCompletionCallback(callback?: AnalysisCompleteCallback): void;
|
41
41
|
startAnalysis(token: CancellationToken): boolean;
|
42
|
-
test_setIndexing(workspaceIndices: Map<string, IndexResults>, libraryIndices: Map<string | undefined, Map<string, IndexResults>>): void;
|
43
42
|
startIndexing(indexOptions: IndexOptions): void;
|
44
43
|
refreshIndexing(): void;
|
45
44
|
cancelIndexing(): void;
|
46
|
-
getIndexing(filePath: string): Map<string, IndexResults> | undefined;
|
45
|
+
getIndexing(filePath: string): Map<string, import("../languageService/documentSymbolProvider").IndexResults> | undefined;
|
47
46
|
getDiagnosticsForRange(filePath: string, range: Range, token: CancellationToken): Promise<Diagnostic[]>;
|
48
47
|
writeTypeStub(targetImportPath: string, targetIsSingleFile: boolean, stubPath: string, token: CancellationToken): Promise<any>;
|
49
48
|
invalidateAndForceReanalysis(rebuildUserFileIndexing: boolean, rebuildLibraryIndexing: boolean): void;
|
50
49
|
restart(): void;
|
50
|
+
dispose(): void;
|
51
51
|
private _ensurePartialStubPackages;
|
52
|
-
private _getIndices;
|
53
52
|
private _reportDiagnosticsForRemovedFiles;
|
53
|
+
protected _getIndices(): Indices | undefined;
|
54
54
|
}
|
55
|
-
export declare type BackgroundAnalysisProgramFactory = (console: ConsoleInterface, configOptions: ConfigOptions, importResolver: ImportResolver, extension?: LanguageServiceExtension, backgroundAnalysis?: BackgroundAnalysisBase, maxAnalysisTime?: MaxAnalysisTime) => BackgroundAnalysisProgram;
|
55
|
+
export declare type BackgroundAnalysisProgramFactory = (serviceId: string, console: ConsoleInterface, configOptions: ConfigOptions, importResolver: ImportResolver, extension?: LanguageServiceExtension, backgroundAnalysis?: BackgroundAnalysisBase, maxAnalysisTime?: MaxAnalysisTime, cacheManager?: CacheManager) => BackgroundAnalysisProgram;
|
@@ -12,14 +12,14 @@ exports.BackgroundAnalysisProgram = void 0;
|
|
12
12
|
const analysis_1 = require("./analysis");
|
13
13
|
const program_1 = require("./program");
|
14
14
|
class BackgroundAnalysisProgram {
|
15
|
-
constructor(_console, _configOptions, _importResolver, extension, _backgroundAnalysis, _maxAnalysisTime, _disableChecker) {
|
15
|
+
constructor(_console, _configOptions, _importResolver, extension, _backgroundAnalysis, _maxAnalysisTime, _disableChecker, cacheManager) {
|
16
16
|
this._console = _console;
|
17
17
|
this._configOptions = _configOptions;
|
18
18
|
this._importResolver = _importResolver;
|
19
19
|
this._backgroundAnalysis = _backgroundAnalysis;
|
20
20
|
this._maxAnalysisTime = _maxAnalysisTime;
|
21
21
|
this._disableChecker = _disableChecker;
|
22
|
-
this._program = new program_1.Program(this._importResolver, this._configOptions, this._console, extension, undefined, this._disableChecker);
|
22
|
+
this._program = new program_1.Program(this._importResolver, this._configOptions, this._console, extension, undefined, this._disableChecker, cacheManager);
|
23
23
|
}
|
24
24
|
get configOptions() {
|
25
25
|
return this._configOptions;
|
@@ -36,6 +36,9 @@ class BackgroundAnalysisProgram {
|
|
36
36
|
get backgroundAnalysis() {
|
37
37
|
return this._backgroundAnalysis;
|
38
38
|
}
|
39
|
+
contains(filePath) {
|
40
|
+
return !!this._program.getSourceFile(filePath);
|
41
|
+
}
|
39
42
|
setConfigOptions(configOptions) {
|
40
43
|
var _a;
|
41
44
|
this._configOptions = configOptions;
|
@@ -79,10 +82,10 @@ class BackgroundAnalysisProgram {
|
|
79
82
|
this._program.setFileOpened(path, version, contents, options);
|
80
83
|
this.markFilesDirty([path], /* evenIfContentsAreSame */ true);
|
81
84
|
}
|
82
|
-
setFileClosed(filePath) {
|
85
|
+
setFileClosed(filePath, isTracked) {
|
83
86
|
var _a;
|
84
|
-
(_a = this._backgroundAnalysis) === null || _a === void 0 ? void 0 : _a.setFileClosed(filePath);
|
85
|
-
const diagnostics = this._program.setFileClosed(filePath);
|
87
|
+
(_a = this._backgroundAnalysis) === null || _a === void 0 ? void 0 : _a.setFileClosed(filePath, isTracked);
|
88
|
+
const diagnostics = this._program.setFileClosed(filePath, isTracked);
|
86
89
|
this._reportDiagnosticsForRemovedFiles(diagnostics);
|
87
90
|
}
|
88
91
|
markAllFilesDirty(evenIfContentsAreSame, indexingNeeded = true) {
|
@@ -102,37 +105,26 @@ class BackgroundAnalysisProgram {
|
|
102
105
|
}
|
103
106
|
startAnalysis(token) {
|
104
107
|
if (this._backgroundAnalysis) {
|
105
|
-
this._backgroundAnalysis.startAnalysis(this.
|
108
|
+
this._backgroundAnalysis.startAnalysis(this._getIndices(), token);
|
106
109
|
return false;
|
107
110
|
}
|
108
111
|
return (0, analysis_1.analyzeProgram)(this._program, this._maxAnalysisTime, this._configOptions, this._onAnalysisCompletion, this._console, token);
|
109
112
|
}
|
110
|
-
test_setIndexing(workspaceIndices, libraryIndices) {
|
111
|
-
const indices = this._getIndices();
|
112
|
-
for (const [filePath, indexResults] of workspaceIndices) {
|
113
|
-
indices.setWorkspaceIndex(filePath, indexResults);
|
114
|
-
}
|
115
|
-
for (const [execEnvRoot, map] of libraryIndices) {
|
116
|
-
for (const [libraryPath, indexResults] of map) {
|
117
|
-
indices.setIndex(execEnvRoot, libraryPath, indexResults);
|
118
|
-
}
|
119
|
-
}
|
120
|
-
}
|
121
113
|
startIndexing(indexOptions) {
|
122
114
|
var _a;
|
123
|
-
(_a = this._backgroundAnalysis) === null || _a === void 0 ? void 0 : _a.startIndexing(indexOptions, this._configOptions, this.importResolver, this.host.kind
|
115
|
+
(_a = this._backgroundAnalysis) === null || _a === void 0 ? void 0 : _a.startIndexing(indexOptions, this._configOptions, this.importResolver, this.host.kind);
|
124
116
|
}
|
125
117
|
refreshIndexing() {
|
126
118
|
var _a;
|
127
|
-
(_a = this._backgroundAnalysis) === null || _a === void 0 ? void 0 : _a.refreshIndexing(this._configOptions, this.importResolver, this.host.kind
|
119
|
+
(_a = this._backgroundAnalysis) === null || _a === void 0 ? void 0 : _a.refreshIndexing(this._configOptions, this.importResolver, this.host.kind);
|
128
120
|
}
|
129
121
|
cancelIndexing() {
|
130
122
|
var _a;
|
131
|
-
(_a = this._backgroundAnalysis) === null || _a === void 0 ? void 0 : _a.cancelIndexing(
|
123
|
+
(_a = this._backgroundAnalysis) === null || _a === void 0 ? void 0 : _a.cancelIndexing();
|
132
124
|
}
|
133
125
|
getIndexing(filePath) {
|
134
126
|
var _a;
|
135
|
-
return (_a = this.
|
127
|
+
return (_a = this._getIndices()) === null || _a === void 0 ? void 0 : _a.getIndex(this._configOptions.findExecEnvironment(filePath).root);
|
136
128
|
}
|
137
129
|
async getDiagnosticsForRange(filePath, range, token) {
|
138
130
|
if (this._backgroundAnalysis) {
|
@@ -164,44 +156,16 @@ class BackgroundAnalysisProgram {
|
|
164
156
|
var _a;
|
165
157
|
(_a = this._backgroundAnalysis) === null || _a === void 0 ? void 0 : _a.restart();
|
166
158
|
}
|
159
|
+
dispose() {
|
160
|
+
var _a;
|
161
|
+
this._program.dispose();
|
162
|
+
(_a = this._backgroundAnalysis) === null || _a === void 0 ? void 0 : _a.shutdown();
|
163
|
+
}
|
167
164
|
_ensurePartialStubPackages(execEnv) {
|
168
165
|
var _a;
|
169
166
|
(_a = this._backgroundAnalysis) === null || _a === void 0 ? void 0 : _a.ensurePartialStubPackages(execEnv.root);
|
170
167
|
return this._importResolver.ensurePartialStubPackages(execEnv);
|
171
168
|
}
|
172
|
-
_getIndices() {
|
173
|
-
if (!this._indices) {
|
174
|
-
const program = this._program;
|
175
|
-
// The map holds onto index results of library files per execution root.
|
176
|
-
// The map will be refreshed together when library files are re-scanned.
|
177
|
-
// It can't be cached by sourceFile since some of library files won't have
|
178
|
-
// corresponding sourceFile created.
|
179
|
-
const map = new Map();
|
180
|
-
this._indices = {
|
181
|
-
setWorkspaceIndex(path, indexResults) {
|
182
|
-
var _a;
|
183
|
-
// Index result of workspace file will be cached by each sourceFile
|
184
|
-
// and it will go away when the source file goes away.
|
185
|
-
(_a = program.getSourceFile(path)) === null || _a === void 0 ? void 0 : _a.cacheIndexResults(indexResults);
|
186
|
-
},
|
187
|
-
getIndex(execEnv) {
|
188
|
-
return map.get(execEnv);
|
189
|
-
},
|
190
|
-
setIndex(execEnv, path, indexResults) {
|
191
|
-
let indicesMap = map.get(execEnv);
|
192
|
-
if (!indicesMap) {
|
193
|
-
indicesMap = new Map();
|
194
|
-
map.set(execEnv, indicesMap);
|
195
|
-
}
|
196
|
-
indicesMap.set(path, indexResults);
|
197
|
-
},
|
198
|
-
reset() {
|
199
|
-
map.clear();
|
200
|
-
},
|
201
|
-
};
|
202
|
-
}
|
203
|
-
return this._indices;
|
204
|
-
}
|
205
169
|
_reportDiagnosticsForRemovedFiles(fileDiags) {
|
206
170
|
if (fileDiags.length > 0) {
|
207
171
|
// If analysis is running in the foreground process, report any
|
@@ -220,6 +184,9 @@ class BackgroundAnalysisProgram {
|
|
220
184
|
}
|
221
185
|
}
|
222
186
|
}
|
187
|
+
_getIndices() {
|
188
|
+
return undefined;
|
189
|
+
}
|
223
190
|
}
|
224
191
|
exports.BackgroundAnalysisProgram = BackgroundAnalysisProgram;
|
225
192
|
//# sourceMappingURL=backgroundAnalysisProgram.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"backgroundAnalysisProgram.js","sourceRoot":"","sources":["../../../src/analyzer/backgroundAnalysisProgram.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;
|
1
|
+
{"version":3,"file":"backgroundAnalysisProgram.js","sourceRoot":"","sources":["../../../src/analyzer/backgroundAnal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QAChD,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC;IACnE,CAAC;IAED,OAAO;;QACH,MAAA,IAAI,CAAC,mBAAmB,0CAAE,OAAO,EAAE,CAAC;IACxC,CAAC;IAED,OAAO;;QACH,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,MAAA,IAAI,CAAC,mBAAmB,0CAAE,QAAQ,EAAE,CAAC;IACzC,CAAC;IAEO,0BAA0B,CAAC,OAA6B;;QAC5D,MAAA,IAAI,CAAC,mBAAmB,0CAAE,yBAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC,eAAe,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACnE,CAAC;IAEO,iCAAiC,CAAC,SAA4B;QAClE,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YACtB,+DAA+D;YAC/D,8DAA8D;YAC9D,qDAAqD;YACrD,IAAI,CAAC,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,qBAAqB,EAAE;gBACzD,IAAI,CAAC,qBAAqB,CAAC;oBACvB,WAAW,EAAE,SAAS;oBACtB,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;oBAC5C,sBAAsB,EAAE,IAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE;oBAC9D,qBAAqB,EAAE,IAAI,CAAC,QAAQ,CAAC,uBAAuB,EAAE;oBAC9D,kBAAkB,EAAE,KAAK;oBACzB,wBAAwB,EAAE,KAAK;oBAC/B,WAAW,EAAE,CAAC;iBACjB,CAAC,CAAC;aACN;SACJ;IACL,CAAC;IAES,WAAW;QACjB,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAxOD,8DAwOC"}
|
package/dist/analyzer/binder.js
CHANGED
@@ -43,7 +43,6 @@ const diagnosticRules_1 = require("../common/diagnosticRules");
|
|
43
43
|
const pathUtils_1 = require("../common/pathUtils");
|
44
44
|
const positionUtils_1 = require("../common/positionUtils");
|
45
45
|
const textRange_1 = require("../common/textRange");
|
46
|
-
const textRange_2 = require("../common/textRange");
|
47
46
|
const localize_1 = require("../localization/localize");
|
48
47
|
const AnalyzerNodeInfo = __importStar(require("./analyzerNodeInfo"));
|
49
48
|
const codeFlowTypes_1 = require("./codeFlowTypes");
|
@@ -111,7 +110,6 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
111
110
|
AnalyzerNodeInfo.setFlowNode(node, this._currentFlowNode);
|
112
111
|
// Bind implicit names.
|
113
112
|
// List taken from https://docs.python.org/3/reference/import.html#__name__
|
114
|
-
this._addImplicitSymbolToCurrentScope('__doc__', node, 'str | None');
|
115
113
|
this._addImplicitSymbolToCurrentScope('__name__', node, 'str');
|
116
114
|
this._addImplicitSymbolToCurrentScope('__qualname__', node, 'str');
|
117
115
|
this._addImplicitSymbolToCurrentScope('__loader__', node, 'Any');
|
@@ -123,6 +121,10 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
123
121
|
this._addImplicitSymbolToCurrentScope('__dict__', node, 'Dict[str, Any]');
|
124
122
|
this._addImplicitSymbolToCurrentScope('__annotations__', node, 'Dict[str, Any]');
|
125
123
|
this._addImplicitSymbolToCurrentScope('__builtins__', node, 'Any');
|
124
|
+
// If there is a static docstring provided in the module, assume
|
125
|
+
// that the type of `__doc__` is `str` rather than `str | None`.
|
126
|
+
const moduleDocString = ParseTreeUtils.getDocString(node.statements);
|
127
|
+
this._addImplicitSymbolToCurrentScope('__doc__', node, moduleDocString ? 'str' : 'str | None');
|
126
128
|
// Create a start node for the module.
|
127
129
|
this._currentFlowNode = this._createStartFlowNode();
|
128
130
|
this._walkStatementsAndReportUnreachable(node.statements);
|
@@ -212,7 +214,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
212
214
|
type: 6 /* Class */,
|
213
215
|
node,
|
214
216
|
path: this._fileInfo.filePath,
|
215
|
-
range: (0, positionUtils_1.
|
217
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(node.name, this._fileInfo.lines),
|
216
218
|
moduleName: this._fileInfo.moduleName,
|
217
219
|
isInExceptSuite: this._isInExceptSuite,
|
218
220
|
};
|
@@ -257,7 +259,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
257
259
|
isMethod: !!containingClassNode,
|
258
260
|
isGenerator: false,
|
259
261
|
path: this._fileInfo.filePath,
|
260
|
-
range: (0, positionUtils_1.
|
262
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(node.name, this._fileInfo.lines),
|
261
263
|
moduleName: this._fileInfo.moduleName,
|
262
264
|
isInExceptSuite: this._isInExceptSuite,
|
263
265
|
};
|
@@ -311,7 +313,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
311
313
|
type: 2 /* Parameter */,
|
312
314
|
node: paramNode,
|
313
315
|
path: this._fileInfo.filePath,
|
314
|
-
range: (0, positionUtils_1.
|
316
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(paramNode, this._fileInfo.lines),
|
315
317
|
moduleName: this._fileInfo.moduleName,
|
316
318
|
isInExceptSuite: this._isInExceptSuite,
|
317
319
|
};
|
@@ -368,7 +370,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
368
370
|
type: 2 /* Parameter */,
|
369
371
|
node: paramNode,
|
370
372
|
path: this._fileInfo.filePath,
|
371
|
-
range: (0, positionUtils_1.
|
373
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(paramNode, this._fileInfo.lines),
|
372
374
|
moduleName: this._fileInfo.moduleName,
|
373
375
|
isInExceptSuite: this._isInExceptSuite,
|
374
376
|
};
|
@@ -478,6 +480,9 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
478
480
|
if (param.boundExpression) {
|
479
481
|
this.walk(param.boundExpression);
|
480
482
|
}
|
483
|
+
if (param.defaultExpression) {
|
484
|
+
this.walk(param.defaultExpression);
|
485
|
+
}
|
481
486
|
});
|
482
487
|
node.parameters.forEach((param) => {
|
483
488
|
const name = param.name;
|
@@ -486,7 +491,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
486
491
|
type: 3 /* TypeParameter */,
|
487
492
|
node: param,
|
488
493
|
path: this._fileInfo.filePath,
|
489
|
-
range: (0, positionUtils_1.
|
494
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(node, this._fileInfo.lines),
|
490
495
|
moduleName: this._fileInfo.moduleName,
|
491
496
|
isInExceptSuite: this._isInExceptSuite,
|
492
497
|
};
|
@@ -512,7 +517,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
512
517
|
type: 4 /* TypeAlias */,
|
513
518
|
node,
|
514
519
|
path: this._fileInfo.filePath,
|
515
|
-
range: (0, positionUtils_1.
|
520
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(node.name, this._fileInfo.lines),
|
516
521
|
moduleName: this._fileInfo.moduleName,
|
517
522
|
isInExceptSuite: this._isInExceptSuite,
|
518
523
|
};
|
@@ -552,13 +557,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
552
557
|
}
|
553
558
|
}
|
554
559
|
}
|
555
|
-
|
556
|
-
// we need to evaluate the type annotation first.
|
557
|
-
const bindVariableBeforeRhsEvaluation = node.leftExpression.nodeType === 54 /* TypeAnnotation */ &&
|
558
|
-
ParseTreeUtils.getEnclosingClass(node, /* stopAtFunction */ true) !== undefined;
|
559
|
-
if (!bindVariableBeforeRhsEvaluation) {
|
560
|
-
this.walk(node.rightExpression);
|
561
|
-
}
|
560
|
+
this.walk(node.rightExpression);
|
562
561
|
let isPossibleTypeAlias = true;
|
563
562
|
if (ParseTreeUtils.getEnclosingFunction(node)) {
|
564
563
|
// We will assume that type aliases are defined only at the module level
|
@@ -578,9 +577,6 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
578
577
|
this._addInferredTypeAssignmentForVariable(node.leftExpression, node.rightExpression, isPossibleTypeAlias);
|
579
578
|
// If we didn't create assignment target flow nodes above, do so now.
|
580
579
|
this._createAssignmentTargetFlowNodes(node.leftExpression, /* walkTargets */ true, /* unbound */ false);
|
581
|
-
if (bindVariableBeforeRhsEvaluation) {
|
582
|
-
this.walk(node.rightExpression);
|
583
|
-
}
|
584
580
|
// Is this an assignment to dunder all?
|
585
581
|
if (this._currentScope.type === 3 /* Module */) {
|
586
582
|
if ((node.leftExpression.nodeType === 38 /* Name */ && node.leftExpression.value === '__all__') ||
|
@@ -762,13 +758,23 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
762
758
|
return false;
|
763
759
|
}
|
764
760
|
visitTypeAnnotation(node) {
|
761
|
+
var _a;
|
765
762
|
if (this._handleTypingStubAssignmentOrAnnotation(node)) {
|
766
763
|
return false;
|
767
764
|
}
|
768
|
-
this
|
765
|
+
// If this is an annotated variable assignment within a class body,
|
766
|
+
// we need to evaluate the type annotation first.
|
767
|
+
const bindVariableBeforeAnnotationEvaluation = ((_a = node.parent) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* Assignment */ &&
|
768
|
+
ParseTreeUtils.getEnclosingClass(node, /* stopAtFunction */ true) !== undefined;
|
769
|
+
if (!bindVariableBeforeAnnotationEvaluation) {
|
770
|
+
this.walk(node.typeAnnotation);
|
771
|
+
}
|
769
772
|
this._createVariableAnnotationFlowNode();
|
770
773
|
this._bindPossibleTupleNamedTarget(node.valueExpression);
|
771
774
|
this._addTypeDeclarationForVariable(node.valueExpression, node.typeAnnotation);
|
775
|
+
if (bindVariableBeforeAnnotationEvaluation) {
|
776
|
+
this.walk(node.typeAnnotation);
|
777
|
+
}
|
772
778
|
// For type annotations that are not part of assignments (e.g. simple variable
|
773
779
|
// annotations), we need to populate the reference map. Otherwise the type
|
774
780
|
// analyzer's code flow engine won't run and detect cases where the variable
|
@@ -973,7 +979,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
973
979
|
isConstant: (0, symbolNameUtils_1.isConstantName)(node.name.value),
|
974
980
|
inferredTypeSource: node,
|
975
981
|
path: this._fileInfo.filePath,
|
976
|
-
range: (0, positionUtils_1.
|
982
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(node.name, this._fileInfo.lines),
|
977
983
|
moduleName: this._fileInfo.moduleName,
|
978
984
|
isInExceptSuite: this._isInExceptSuite,
|
979
985
|
};
|
@@ -1248,6 +1254,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1248
1254
|
return true;
|
1249
1255
|
}
|
1250
1256
|
visitImportFrom(node) {
|
1257
|
+
var _a;
|
1251
1258
|
const typingSymbolsOfInterest = ['Final', 'TypeAlias', 'ClassVar', 'Required', 'NotRequired', 'Annotated'];
|
1252
1259
|
const dataclassesSymbolsOfInterest = ['InitVar'];
|
1253
1260
|
const importInfo = AnalyzerNodeInfo.getImportInfo(node.module);
|
@@ -1280,6 +1287,9 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1280
1287
|
}
|
1281
1288
|
if (importInfo) {
|
1282
1289
|
const names = [];
|
1290
|
+
// Note that this scope uses a wildcard import, so we cannot shortcut
|
1291
|
+
// any code flow checks. All expressions are potentially in play.
|
1292
|
+
(_a = this._currentScopeCodeFlowExpressions) === null || _a === void 0 ? void 0 : _a.add(codeFlowTypes_1.wildcardImportReferenceKey);
|
1283
1293
|
const lookupInfo = this._fileInfo.importLookup(resolvedPath);
|
1284
1294
|
if (lookupInfo) {
|
1285
1295
|
const wildcardNames = this._getWildcardImportNames(lookupInfo);
|
@@ -1343,6 +1353,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1343
1353
|
isInExceptSuite: this._isInExceptSuite,
|
1344
1354
|
};
|
1345
1355
|
localSymbol.addDeclaration(aliasDecl);
|
1356
|
+
names.push(name);
|
1346
1357
|
}
|
1347
1358
|
}
|
1348
1359
|
}
|
@@ -1401,7 +1412,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1401
1412
|
node: importSymbolNode,
|
1402
1413
|
path: implicitImport.path,
|
1403
1414
|
loadSymbolsFromPath: true,
|
1404
|
-
range: (0,
|
1415
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(importSymbolNode, this._fileInfo.lines),
|
1405
1416
|
usesLocalName: false,
|
1406
1417
|
moduleName: this._fileInfo.moduleName,
|
1407
1418
|
isInExceptSuite: this._isInExceptSuite,
|
@@ -1423,7 +1434,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1423
1434
|
usesLocalName: !!importSymbolNode.alias,
|
1424
1435
|
symbolName: importedName,
|
1425
1436
|
submoduleFallback,
|
1426
|
-
range: (0,
|
1437
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(nameNode, this._fileInfo.lines),
|
1427
1438
|
moduleName: this._fileInfo.moduleName,
|
1428
1439
|
isInExceptSuite: this._isInExceptSuite,
|
1429
1440
|
isNativeLib: importInfo === null || importInfo === void 0 ? void 0 : importInfo.isNativeLib,
|
@@ -1707,7 +1718,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1707
1718
|
isConstant: (0, symbolNameUtils_1.isConstantName)(node.target.value),
|
1708
1719
|
inferredTypeSource: node,
|
1709
1720
|
path: this._fileInfo.filePath,
|
1710
|
-
range: (0, positionUtils_1.
|
1721
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(node.target, this._fileInfo.lines),
|
1711
1722
|
moduleName: this._fileInfo.moduleName,
|
1712
1723
|
isInExceptSuite: this._isInExceptSuite,
|
1713
1724
|
};
|
@@ -1772,7 +1783,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1772
1783
|
isConstant: (0, symbolNameUtils_1.isConstantName)(slotName),
|
1773
1784
|
isDefinedBySlots: true,
|
1774
1785
|
path: this._fileInfo.filePath,
|
1775
|
-
range: (0, positionUtils_1.
|
1786
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(slotNameNode, this._fileInfo.lines),
|
1776
1787
|
moduleName: this._fileInfo.moduleName,
|
1777
1788
|
isInExceptSuite: this._isInExceptSuite,
|
1778
1789
|
};
|
@@ -1814,7 +1825,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1814
1825
|
isConstant: (0, symbolNameUtils_1.isConstantName)(target.value),
|
1815
1826
|
inferredTypeSource: target.parent,
|
1816
1827
|
path: this._fileInfo.filePath,
|
1817
|
-
range: (0, positionUtils_1.
|
1828
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(target, this._fileInfo.lines),
|
1818
1829
|
moduleName: this._fileInfo.moduleName,
|
1819
1830
|
isInExceptSuite: this._isInExceptSuite,
|
1820
1831
|
};
|
@@ -1894,7 +1905,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1894
1905
|
node,
|
1895
1906
|
path: pathOfLastSubmodule,
|
1896
1907
|
loadSymbolsFromPath: false,
|
1897
|
-
range: (0, textRange_1.getEmptyRange)(),
|
1908
|
+
range: importAlias ? (0, positionUtils_1.convertTextRangeToRange)(importAlias, this._fileInfo.lines) : (0, textRange_1.getEmptyRange)(),
|
1898
1909
|
usesLocalName: !!importAlias,
|
1899
1910
|
moduleName: importInfo.importName,
|
1900
1911
|
firstNamePart: firstNamePartValue,
|
@@ -1910,7 +1921,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
1910
1921
|
node,
|
1911
1922
|
path: pathOfLastSubmodule,
|
1912
1923
|
loadSymbolsFromPath: true,
|
1913
|
-
range: (0, textRange_1.getEmptyRange)(),
|
1924
|
+
range: importAlias ? (0, positionUtils_1.convertTextRangeToRange)(importAlias, this._fileInfo.lines) : (0, textRange_1.getEmptyRange)(),
|
1914
1925
|
usesLocalName: !!importAlias,
|
1915
1926
|
moduleName: (_a = importInfo === null || importInfo === void 0 ? void 0 : importInfo.importName) !== null && _a !== void 0 ? _a : '',
|
1916
1927
|
firstNamePart: firstNamePartValue,
|
@@ -2649,7 +2660,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
2649
2660
|
isInferenceAllowedInPyTyped: this._isInferenceAllowedInPyTyped(name.value),
|
2650
2661
|
typeAliasName: isPossibleTypeAlias ? target : undefined,
|
2651
2662
|
path: this._fileInfo.filePath,
|
2652
|
-
range: (0, positionUtils_1.
|
2663
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(name, this._fileInfo.lines),
|
2653
2664
|
moduleName: this._fileInfo.moduleName,
|
2654
2665
|
isInExceptSuite: this._isInExceptSuite,
|
2655
2666
|
docString: this._getVariableDocString(target),
|
@@ -2692,7 +2703,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
2692
2703
|
inferredTypeSource: source,
|
2693
2704
|
isDefinedByMemberAccess: true,
|
2694
2705
|
path: this._fileInfo.filePath,
|
2695
|
-
range: (0, positionUtils_1.
|
2706
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(target.memberName, this._fileInfo.lines),
|
2696
2707
|
moduleName: this._fileInfo.moduleName,
|
2697
2708
|
isInExceptSuite: this._isInExceptSuite,
|
2698
2709
|
docString: this._getVariableDocString(target),
|
@@ -2790,7 +2801,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
2790
2801
|
typeAliasName: isExplicitTypeAlias ? target : undefined,
|
2791
2802
|
path: this._fileInfo.filePath,
|
2792
2803
|
typeAnnotationNode,
|
2793
|
-
range: (0, positionUtils_1.
|
2804
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(name, this._fileInfo.lines),
|
2794
2805
|
moduleName: this._fileInfo.moduleName,
|
2795
2806
|
isInExceptSuite: this._isInExceptSuite,
|
2796
2807
|
docString: this._getVariableDocString(target),
|
@@ -2854,7 +2865,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
2854
2865
|
isFinal: finalInfo.isFinal,
|
2855
2866
|
path: this._fileInfo.filePath,
|
2856
2867
|
typeAnnotationNode: finalInfo.isFinal && !finalInfo.finalTypeNode ? undefined : typeAnnotation,
|
2857
|
-
range: (0, positionUtils_1.
|
2868
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(target.memberName, this._fileInfo.lines),
|
2858
2869
|
moduleName: this._fileInfo.moduleName,
|
2859
2870
|
isInExceptSuite: this._isInExceptSuite,
|
2860
2871
|
docString: this._getVariableDocString(target),
|
@@ -3206,7 +3217,7 @@ class Binder extends parseTreeWalker_1.ParseTreeWalker {
|
|
3206
3217
|
type: 7 /* SpecialBuiltInClass */,
|
3207
3218
|
node: annotationNode,
|
3208
3219
|
path: this._fileInfo.filePath,
|
3209
|
-
range: (0, positionUtils_1.
|
3220
|
+
range: (0, positionUtils_1.convertTextRangeToRange)(annotationNode, this._fileInfo.lines),
|
3210
3221
|
moduleName: this._fileInfo.moduleName,
|
3211
3222
|
isInExceptSuite: this._isInExceptSuite,
|
3212
3223
|
});
|