Pylance Documentation Index

July 9, 2026 ยท View on GitHub

This is the complete index of Pylance documentation. Use it to find guides, settings references, and diagnostic rule explanations.


How-To Guides

Step-by-step guides for common Pylance workflows and troubleshooting.

GuideDescription
Auto-Import GuideControl auto-import suggestions: settings, indexing, and common issues
Bundled Third-Party StubsOverride bundled package stubs with workspace-local custom stubs
CI Type CheckingRun Pyright in CI to enforce type checking
Copilot + Pylance WorkflowUse Pylance MCP tools with Copilot to diagnose and fix Python issues
Dependency ManagementReconcile requirements.txt, pyproject.toml, lockfiles, and PEP 723 with what Pylance sees
Docstring Resolution OrderHow a language server picks which docstring to show among modules, classes, functions, __init__/__new__, overloads, overrides, and multiple inheritance
Editable InstallsMake pip install -e work with Pylance
Extra Paths Glob ResolutionUse glob patterns in extraPaths, with deterministic ordering and performance notes
Generated CodeHandle generated or dynamic code that Pylance cannot analyze statically
Gradual Strict AdoptionMove from off to strict type checking incrementally
Monorepo SetupConfigure Pylance for monorepos, multi-root workspaces, and execution environments
Notebook TroubleshootingFix common Pylance issues in Jupyter notebooks
Performance TuningReduce memory use and improve responsiveness
Python EnvironmentsPick the right interpreter, switch venvs, and handle multiple environments (venv, conda, uv, poetry)
Reading Pylance LogsUse trace logging to diagnose import resolution and settings
Remote DevelopmentUse Pylance with SSH, WSL, containers, and Codespaces
Settings TroubleshootingDiagnose settings precedence, config file overrides, and common conflicts
Type NarrowingUse isinstance, is None, and type guards to fix type errors
Unresolved ImportsFix reportMissingImports and related import errors
Workspace vs Open-Files DiagnosticsGet errors across the whole workspace instead of only open files

Settings Reference

Each page explains one python.analysis.* setting: what it does, accepted values, and when to use it.

Core Settings

SettingDescription
typeCheckingModeBaseline strictness level (off, basic, standard, strict)
diagnosticModeCheck open files only or the whole workspace
diagnosticSeverityOverridesOverride severity of individual diagnostic rules
languageServerModeTrade features for performance (light, default, full)

Import and Path Settings

SettingDescription
autoImportCompletionsEnable or disable auto-import suggestions in completions
autoSearchPathsAuto-detect src/ directories
extraPathsAdditional directories for import resolution
importFormatPrefer absolute or relative imports in auto-imports
stubPathDirectory for custom .pyi stub files
typeshedPathsCustom typeshed location
enableEditableInstallsResolve PEP 660 editable installs on Python 3.13+

File Scope Settings

SettingDescription
includeFiles and directories to analyze
excludeFiles and directories to skip
ignoreFiles to analyze but suppress diagnostics for

Indexing and Completions

SettingDescription
indexingEnable background indexing for auto-imports and workspace symbols
packageIndexDepthsControl indexing depth for specific packages
showOnlyDirectDependenciesInAutoImportLimit auto-import completions to direct dependencies
persistAllIndicesCache all indices to disk
regenerateStdLibIndicesForce re-index of standard library
userFileIndexingLimitMaximum number of user files to index
includeAliasesFromUserFilesInclude re-exported aliases in completions
includeExtraPathSymbolsInSymbolSearchInclude extraPaths symbols in workspace search
includeVenvInWorkspaceSymbolsInclude virtual environment symbols in workspace search
completeFunctionParensAdd parentheses to function completions
gotoDefinitionInStringLiteralGo to Definition on module-like string literals
userFileIndexFollowSymlinkedFoldersFollow symlinked folders when indexing user files

Code Actions and Hints

SettingDescription
fixAllCode actions applied on save or fix-all
inlayHints.callArgumentNamesShow parameter names at call sites
inlayHints.functionReturnTypesShow inferred return types
inlayHints.pytestParametersShow pytest fixture parameter types
inlayHints.variableTypesShow inferred variable types
enablePytestSupportEnable pytest-aware analysis
enableColorPickerShow a color picker for hex color strings
enableTroubleshootMissingImportsQuick Fix to troubleshoot unresolved imports

Editor and Typing

SettingDescription
autoIndentAdjust indentation automatically based on Python semantics
autoSplitStringsAdd quotes and continuation characters when splitting strings
autoFormatStringsAdd an f prefix when inserting a placeholder in a string

AI Features

SettingDescription
aiCodeActionsEnable AI-assisted Quick Fixes (requires GitHub Copilot Chat)
generateWithTypeAnnotationInclude type annotations in generated code
autoTranslateDocstringsTranslate hover docstrings via GitHub Copilot
supportRestructuredTextRender reStructuredText formatting in docstrings

Diagnostics Display

SettingDescription
excludeLibraryDiagnosticsSuppress diagnostics for library files, keep them for user files
disableTaggedHintsTurn off grayed-out / strike-through hint diagnostics
displayEnglishDiagnosticsAlways show diagnostics in English

Type Evaluation Settings

SettingDescription
typeEvaluation.analyzeUnannotatedFunctionsAnalyze functions without type annotations
typeEvaluation.deprecateTypingAliasesFlag deprecated typing aliases (e.g., typing.List)
typeEvaluation.disableBytesTypePromotionsDisable implicit bytes promotions
typeEvaluation.enableExperimentalFeaturesEnable experimental type-checking features
typeEvaluation.enableReachabilityAnalysisDetect unreachable code
typeEvaluation.enableTypeIgnoreCommentsControl # type: ignore comments
typeEvaluation.strictDictionaryInferenceInfer literal dict key/value types
typeEvaluation.strictListInferenceInfer literal list element types
typeEvaluation.strictParameterNoneValueRequire explicit None type for None default parameters
typeEvaluation.strictSetInferenceInfer literal set element types

Advanced Settings

SettingDescription
useLibraryCodeForTypesInfer types from library source when stubs are missing
useNearestConfigurationUse nearest pyrightconfig.json for each file
nodeArgumentsExtra Node.js arguments for the language server
nodeExecutableCustom Node.js executable path
logLevelVerbosity of the Pylance Output panel log
pyrightVersionPin the Pyright version used for diagnostics
supportAllPythonDocumentsExtend IntelliSense to non-file Python documents

Diagnostic Rules

Each page explains one Pyright diagnostic rule: what triggers it, code examples, and how to fix or suppress it.

All rules can be configured via diagnosticSeverityOverrides or in pyrightconfig.json.

RuleDescription
reportAbstractUsageInstantiating abstract classes or using abstract methods directly
reportArgumentTypeArgument type incompatible with parameter type
reportAssertAlwaysTrueAssert statement condition is always true
reportAssertTypeFailureassert_type() type mismatch
reportAssignmentTypeAssignment type incompatible with target
reportAttributeAccessIssueAccessing undefined attributes
reportCallInDefaultInitializerFunction calls in default parameter values
reportCallIssueProblems with function or method calls
reportConstantRedefinitionRedefining a Final constant
reportDeprecatedUsing deprecated functions, classes, or parameters
reportDuplicateImportSame module imported more than once
reportFunctionMemberAccessAccessing non-standard attributes on functions
reportGeneralTypeIssuesGeneral type incompatibility issues
reportImplicitOverrideMethod overrides without @override decorator
reportImplicitStringConcatenationImplicit string literal concatenation
reportImportCyclesCircular import chains
reportIncompatibleMethodOverrideMethod override incompatible with base class
reportIncompatibleVariableOverrideVariable override incompatible with base class
reportIncompleteStubStub file has __getattr__ fallback
reportInconsistentOverloadOverloaded function inconsistencies
reportIndexIssueInvalid subscript or index operations
reportInvalidStringEscapeSequenceUnrecognized escape sequence in string
reportInvalidStubStatementInvalid statements in .pyi stub files
reportInvalidTypeArgumentsInvalid generic type arguments
reportInvalidTypeFormInvalid type expression syntax
reportInvalidTypeVarUseIncorrect TypeVar usage
reportMatchNotExhaustivematch statement missing cases
reportMissingImportsImport could not be resolved
reportMissingModuleSourceModule found as stub only, no source
reportMissingParameterTypeFunction parameter missing type annotation
reportMissingSuperCall__init__ missing super().__init__() call
reportMissingTypeArgumentGeneric type used without type arguments
reportMissingTypeStubsNo type stubs found for a library
reportOperatorIssueInvalid operator usage for given types
reportOptionalCallCalling a possibly None value
reportOptionalContextManagerUsing possibly None as context manager
reportOptionalIterableIterating over possibly None value
reportOptionalMemberAccessAccessing attribute on possibly None value
reportOptionalOperandUsing possibly None in an operation
reportOptionalSubscriptIndexing a possibly None value
reportOverlappingOverloadOverloads with ambiguous overlap
reportPossiblyUnboundVariableVariable may not be bound in all code paths
reportPrivateImportUsageImporting a private symbol from a typed library
reportPrivateUsageAccessing private members (underscore-prefixed)
reportPropertyTypeMismatchProperty getter/setter type mismatch
reportRedeclarationVariable declared with incompatible types
reportReturnTypeReturn value incompatible with declared return type
reportTypeCommentUsageUsing # type: comments instead of annotations
reportTypedDictNotRequiredAccessAccessing optional TypedDict keys without check
reportUnboundVariableUsing an unbound variable
reportUndefinedVariableUsing an undefined variable
reportUnhashableUsing unhashable type as dict key or set member
reportUninitializedInstanceVariableInstance variable not initialized in __init__
reportUnknownArgumentTypeArgument has unknown type (strict mode)
reportUnknownLambdaTypeLambda has unknown parameter or return type
reportUnknownMemberTypeAttribute access returns unknown type
reportUnknownParameterTypeFunction parameter has unknown type
reportUnknownVariableTypeVariable has unknown type (strict mode)
reportUnnecessaryCastcast() call that has no effect
reportUnnecessaryComparisonComparison that always has the same result
reportUnnecessaryContainsin check that always has the same result
reportUnnecessaryIsInstanceisinstance() check that is always true or false
reportUnnecessaryTypeIgnoreComment# type: ignore on a line with no error
reportUnsupportedDunderAllUnsupported operations on __all__
reportUntypedBaseClassInheriting from a class with no type information
reportUntypedClassDecoratorClass decorator with no type information
reportUntypedFunctionDecoratorFunction decorator with no type information
reportUntypedNamedTupleUsing untyped namedtuple() instead of NamedTuple
reportUnusedCallResultIgnoring return value of a function call
reportUnusedClassClass defined but never used
reportUnusedCoroutineCoroutine created but never awaited
reportUnusedExpressionExpression result is unused
reportUnusedFunctionFunction defined but never called
reportUnusedImportImport not used in the file
reportUnusedVariableVariable assigned but never used
reportWildcardImportFromLibraryUsing from lib import * with a library

Type Server Protocol (TSP)

DocumentDescription
Type Server ProtocolProtocol overview and compatibility contract for type servers