Some checks failed
Run mypy_primer on push / Run mypy_primer on push (push) Has been cancelled
Validation / Typecheck (push) Has been cancelled
Validation / Style (push) Has been cancelled
Validation / Test macos-latest (push) Has been cancelled
Validation / Test ubuntu-latest (push) Has been cancelled
Validation / Test windows-latest (push) Has been cancelled
Validation / Build (push) Has been cancelled
Validation / Required (push) Has been cancelled
39 KiB
39 KiB
Subsystem: analyzer
Source files under analyzer/. Grouped by the functional area each file was assigned to during semantic lifting.
- Files: 82
- Symbols (leaves): 1776
Constraint Solving and Type Variables
- analyzer/constraintSolution.ts — Holds mappings from type variables to resolved types and manages multiple constraint solution sets
- analyzer/constraintSolver.ts — Solves TypeVar, TypeVarTuple, and ParamSpec constraints to infer concrete types based on collected constraints
- analyzer/constraintTracker.ts — Tracks and manages constraint sets and bounds for type variables used by the constraint solver
Diagnostics and Configuration
- analyzer/deprecatedSymbols.ts — Maps implicitly deprecated typing and collection symbols to the Python version and suggested replacement
Documentation and Comments
- analyzer/commentUtils.ts — Parses pyright-specific comments to adjust diagnostic rule settings and collect comment diagnostics
- analyzer/docStringConversion.ts — Converts Python docstrings into Markdown or cleaned plaintext for documentation and display
- analyzer/docStringUtils.ts — Parses Python docstrings and extracts parameter and attribute docs in Epytext, reST, and Google styles
Flow Narrowing and Type Guards
- analyzer/codeFlowEngine.ts — Determines narrowed types for variables and expressions and computes statement reachability via the code flow graph
- analyzer/codeFlowTypes.ts — Types and helpers for tracking code-flow nodes and reference keys used in Pyright's code flow analysis
- analyzer/codeFlowUtils.ts — Generates an ASCII diagram of a control flow graph from FlowNode structures
- analyzer/patternMatching.ts — Type evaluation and narrowing utilities for Python structural pattern matching (PEP 634) in Pyright
- analyzer/staticExpressions.ts — Evaluates parse-node expressions to determine static boolean, version, and platform string outcomes
- analyzer/typeGuards.ts — Narrow types based on conditional expressions, isinstance checks, and user-defined type guards
Import Resolution and Packaging
- analyzer/importLogger.ts — Provides a simple logger for collecting and retrieving import resolution messages
- analyzer/importResolver.ts — Resolves Python imports to filesystem modules, packages, typeshed and stub sources for static type analysis
- analyzer/importResolverFileSystem.ts — Cached file-system adapter for import resolution, exposing directory/file queries and resolvable name lookups
- analyzer/importResolverTypes.ts — Type declarations for import resolver helpers including typeshed info provider and a minimal cached filesystem facade
- analyzer/importResult.ts — Represents Python import resolution results with metadata, resolved URIs, and implicit import info
- analyzer/importStatementUtils.ts — Summarizes and manipulates Python import statements and generates edits for auto-imports and formatting
- analyzer/packageTypeReport.ts — Defines types and a factory for package type verification reports, symbols, modules, and diagnostics
- analyzer/packageTypeVerifier.ts — Validates public exports of a package to ensure exported types are complete and reports problems
- analyzer/pyTypedUtils.ts — Determines whether a py.typed file exists and if it marks the package as partially typed
- analyzer/pythonPathUtils.ts — Resolves Python interpreter and typeshed search paths, site-packages locations, and .pth-derived paths
- analyzer/sourceEnumerator.ts — Enumerates Python source files with include/exclude rules, tracking symlinked directories and auto-excluding virtualenvs
- analyzer/sourceMapper.ts — Maps .pyi stub files to corresponding .py implementation files and provides binding utilities
- analyzer/sourceMapperUtils.ts — Finds an import chain between two Uri nodes and returns the sequence of Uris
- analyzer/typeStubWriter.ts — Emit Python .pyi type stub files from parsed and analyzed Python source files
- analyzer/typeshedInfoProvider.ts — Provides typeshed root/subdirectory lookup, third-party package mapping, and stdlib version info
Parser, Binder, and Symbols
- analyzer/analyzerNodeInfo.ts — Stores and manages analysis metadata (scopes, declarations, control-flow, imports, and all) for parse nodes
- analyzer/binder.ts — Performs Python parse-tree name binding and creates scopes and symbol tables for static analysis
- analyzer/declaration.ts — Describes declaration kinds and interfaces that record symbol locations, nodes, and import/alias resolution metadata
- analyzer/declarationUtils.ts — Utilities for inspecting, comparing, and resolving declarations and alias references in the analyzer
- analyzer/parseTreeCleaner.ts — Walks a Module parse tree and clears analyzer-specific analysis info from each parse node
- analyzer/parseTreeUtils.ts — Utilities for traversing, querying, and printing Python parse tree nodes and their evaluation ranges
- analyzer/parseTreeWalker.ts — Traverses a Python parse tree and provides visitor/walker classes to visit and process parse nodes
- analyzer/scope.ts — Models evaluation scopes and provides symbol table, binding info, and recursive lookup for Python analysis
- analyzer/scopeUtils.ts — Utilities for locating and inspecting analysis scopes and scope hierarchies for parse tree nodes
- analyzer/symbol.ts — Represents program symbols, tracking their flags, declarations, and synthesized type information
- analyzer/symbolNameUtils.ts — Classify Python symbol names (private, protected, dunder, constant, type alias, public constant/type alias)
- analyzer/symbolUtils.ts — Helpers for Symbol declaration queries, visibility checks, TypedDict index access, and class-var/final semantics
- analyzer/testWalker.ts — Validates parse-tree node parent/range invariants and evaluates NameNode types using a TypeEvaluator
Program Analysis and Scheduling
- analyzer/analysis.ts — Exports types and analyzeProgram to run a Program analysis, gather diagnostics, and invoke a completion callback
- analyzer/analyzerFileInfo.ts — Provides interfaces and utilities for storing per-source-file analysis metadata and import lookup in the analyzer
- analyzer/backgroundAnalysisProgram.ts — Manages a Program with optional background analysis, syncing config, imports, file state and diagnostics
- analyzer/cacheManager.ts — Tracks cache owners and heap usage to trigger cache eviction when memory usage approaches the heap limit
- analyzer/cellChainIndex.ts — Provides a lazily-built index mapping notebook CellDocs cells to their chain tails for fast later-cell lookups
- analyzer/circularDependency.ts — Represents circular import chains as ordered lists of file URIs, normalizing start and comparing equality
- analyzer/parentDirectoryCache.ts — Cache for storing parent-directory import lookup results to avoid repeated folder searches
- analyzer/program.ts — Tracks and manages the project's source files, imports, and analysis state for Pyright's type checker
- analyzer/programTypes.ts — Defines ISourceFileFactory interface and a type guard for creating SourceFile instances
- analyzer/service.ts — Analyzes Python files and manages background analysis, programs, configuration, and import resolution
- analyzer/serviceUtils.ts — Helpers to locate pyproject.toml and project config files starting from a given Uri
- analyzer/sourceFile.ts — Represents a single Python source or stub file and manages its parsing, analysis, and diagnostics
- analyzer/sourceFileInfo.ts — Holds per-file metadata and mutable program relations like imports, diagnostics, and edit-mode snapshots
- analyzer/sourceFileInfoUtils.ts — Utilities for SourceFileInfo: import/chain relationships, cycle checks, and parsing open IPython notebook cells
Shared Runtime Infrastructure
- analyzer/sentinel.ts — Produces a PEP 661 Sentinel class instance type for sentinel declarations during type evaluation
- analyzer/tracePrinter.ts — Converts AST nodes, declarations, symbols, and types into concise string representations
Type Evaluation
- analyzer/checker.ts — Performs static type checking and traverses parse trees to validate and report diagnostics for a source file
- analyzer/constructorTransform.ts — Transforms objects created by constructors for special-case behaviors like functools.partial and TypedDicts
- analyzer/constructors.ts — Evaluates Python constructor and metaclass calls, validating new/init arguments and inferring resulting instance types
- analyzer/dataClasses.ts — Handles special-case analysis and synthesis for Python dataclasses and dataclass_transform behaviors
- analyzer/decorators.ts — Evaluates and applies function/class decorators, adjusting types, flags, overloads, properties, and dataclass behavior
- analyzer/enums.ts — Provides type analysis and special-case handling for Python Enum classes and enum members
- analyzer/functionTransform.ts — Adds missing comparison methods to classes decorated with functools.total_ordering
- analyzer/namedTuples.ts — Constructs and manages Python namedtuple class types with named fields and optional type annotations
- analyzer/operations.ts — Evaluates types and validates semantics for unary, binary, augmented assignment, and ternary Python operators
- analyzer/parameterUtils.ts — Utilities for analyzing and handling function parameters, param lists, and related parameter typing in the analyzer
- analyzer/properties.ts — Evaluates and constructs Python property types and manages getter/setter/deleter method typing and symbol table entries
- analyzer/protocols.ts — Provides type evaluation logic for protocol (structural subtyping) classes
- analyzer/tuples.ts — Tuple type analysis utilities: construct, infer, slice, expand, and assign tuple types for the type evaluator
- analyzer/typeCacheUtils.ts — Tracks speculative type contexts and caches speculative type results for nodes during speculative analysis
- analyzer/typeComplexity.ts — Computes a complexity score for types to rank candidate types during constraint solving
- analyzer/typeDocStringUtils.ts — Retrieves and resolves docstrings for modules, classes, functions, variables, and properties including inherited stubs
- analyzer/typeEvaluator.ts — Evaluates types of parse tree nodes within a Python program
- analyzer/typeEvaluatorTypes.ts — Type evaluator interfaces, helper types, constants, and utilities for Pyright's analyzer
- analyzer/typeEvaluatorWithTracker.ts — Wraps the type evaluator with logging and timing to track performance of type evaluation entry points
- analyzer/typePrinter.ts — Produces human-readable string representations of Pyright type objects for diagnostics and display
- analyzer/typePrinterUtils.ts — Formats and escapes string and bytes literals for the type printer
- analyzer/typeUtils.ts — Utilities and transformers for analyzing and manipulating Type objects used by the type checker
- analyzer/typeWalker.ts — Walks components of a Type graph to visit contained types while preventing infinite recursion
- analyzer/typedDicts.ts — Provides TypedDict type creation, member resolution, assignment and helper utilities for the analyzer
- analyzer/types.ts — Represents and manipulates Python type abstractions used by the Pyright analyzer
Cross-subsystem dependencies
Imported by (external):
- src/backgroundAnalysis.ts
- src/backgroundAnalysisBase.ts
- src/backgroundThreadBase.ts
- commands/createTypeStub.ts
- commands/dumpFileDebugInfoCommand.ts
- common/configOptions.ts
- common/docStringService.ts
- common/extensibility.ts
- common/fullAccessHost.ts
- common/host.ts
- common/languageInfoUtils.ts
- common/languageServerInterface.ts
- common/lspUtils.ts
- common/serviceKeys.ts
- common/serviceProviderExtensions.ts
- common/textEditTracker.ts
- common/workspaceEditUtils.ts
- src/languageServerBase.ts
- languageService/analyzerServiceExecutor.ts
- languageService/autoImporter.ts
- languageService/callHierarchyProvider.ts
- languageService/completionProvider.ts
- languageService/completionProviderUtils.ts
- languageService/definitionProvider.ts
- languageService/documentHighlightProvider.ts
- languageService/documentSymbolCollector.ts
- languageService/documentSymbolProvider.ts
- languageService/hoverProvider.ts
- languageService/importSorter.ts
- languageService/referencesProvider.ts
- languageService/renameProvider.ts
- languageService/signatureHelpProvider.ts
- languageService/symbolIndexer.ts
- languageService/tooltipUtils.ts
- languageService/workspaceSymbolProvider.ts
- src/partialStubService.ts
- src/pyright.ts
- src/server.ts
- src/workspaceFactory.ts
Imports (external):
- src/backgroundAnalysisBase.ts
- commands/commands.ts
- common/cancellationUtils.ts
- common/collectionUtils.ts
- common/commandLineOptions.ts
- common/configOptions.ts
- common/console.ts
- common/core.ts
- common/debug.ts
- common/diagnostic.ts
- common/diagnosticRules.ts
- common/diagnosticSink.ts
- common/editAction.ts
- common/extensibility.ts
- common/fileSystem.ts
- common/fileWatcher.ts
- common/fullAccessHost.ts
- common/host.ts
- common/logTracker.ts
- common/memUtils.ts
- common/pathConsts.ts
- common/pathUtils.ts
- common/positionUtils.ts
- common/pythonVersion.ts
- common/serviceKeys.ts
- common/serviceProvider.ts
- common/serviceProviderExtensions.ts
- common/stringUtils.ts
- common/textRange.ts
- common/textRangeCollection.ts
- common/timing.ts
- common/tomlUtils.ts
- uri/uri.ts
- uri/uriMap.ts
- uri/uriUtils.ts
- localization/localize.ts
- parser/parseNodeUtils.ts
- parser/parseNodes.ts
- parser/parser.ts
- parser/stringTokenUtils.ts
- parser/tokenizer.ts
- parser/tokenizerTypes.ts