graph LR
rope_base_pycore["rope.base.pycore"]
rope_base_pynames["rope.base.pynames"]
rope_base_pyscopes["rope.base.pyscopes"]
rope_base_evaluate["rope.base.evaluate"]
rope_refactor_occurrences["rope.refactor.occurrences"]
rope_contrib_findit["rope.contrib.findit"]
rope_contrib_codeassist["rope.contrib.codeassist"]
rope_contrib_finderrors["rope.contrib.finderrors"]
rope_contrib_findit -- "utilizes" --> rope_refactor_occurrences
rope_contrib_codeassist -- "utilizes" --> rope_refactor_occurrences
rope_contrib_finderrors -- "utilizes" --> rope_refactor_occurrences
rope_refactor_occurrences -- "queries" --> rope_base_pycore
rope_refactor_occurrences -- "uses" --> rope_base_pynames
rope_contrib_findit -- "accesses" --> rope_base_pycore
rope_contrib_codeassist -- "queries" --> rope_base_pyscopes
rope_contrib_codeassist -- "accesses" --> rope_base_pycore
rope_contrib_finderrors -- "relies on" --> rope_base_evaluate
rope_contrib_finderrors -- "accesses" --> rope_base_pycore
rope_base_evaluate -- "utilizes" --> rope_base_pyscopes
rope_base_evaluate -- "produces" --> rope_base_pynames
rope_base_evaluate -- "depends on" --> rope_base_pycore
rope_base_pyscopes -- "contains" --> rope_base_pynames
rope_base_pyscopes -- "relies on" --> rope_base_pycore
The rope analysis subsystem is built around a core semantic model managed by rope.base.pycore, which provides a comprehensive representation of the Python project's code, including parsed modules and resource change tracking. This core model is leveraged by rope.base.pynames for symbol representation and resolution, and by rope.base.pyscopes for managing code context and name visibility. rope.base.evaluate acts as the expression evaluation engine, inferring types and resolving symbols by interacting with pyscopes and pynames. Building upon these foundational components, rope.refactor.occurrences provides a project-wide search capability. Higher-level rope.contrib modules, such as rope.contrib.findit (for code navigation), rope.contrib.codeassist (for intelligent completion), and rope.contrib.finderrors (for static analysis), utilize these core services to deliver their respective functionalities, forming a cohesive system for advanced Python code analysis and manipulation.
Represents the core of rope's Project & Semantic Model. It manages the project's Python code, providing access to parsed modules (PyObjects) and handling caching and resource change notifications. It serves as the central hub for all components needing to interact with the parsed code structure.
Related Classes/Methods:
rope.base.pycore:PyCorerope.base.pycore:_ModuleCacherope.base.pycore:_ExtensionCacherope.base.pycore:resource_to_pyobject
Defines and manages the representation of Python names (symbols) within the project's code. It provides a hierarchy of PyName types (e.g., DefinedName, ImportedName, EvaluatedName) to accurately track and resolve references to PyObjects.
Related Classes/Methods:
rope.base.pynames:PyNamerope.base.pynames:DefinedNamerope.base.pynames:EvaluatedNamerope.base.pynames:ImportedModulerope.base.pynames:ImportedName
Manages the hierarchical structure of Python code scopes (e.g., module, class, function, comprehension). It enables context-sensitive name lookup and provides information about the visibility and boundaries of code elements.
Related Classes/Methods:
rope.base.pyscopes:Scoperope.base.pyscopes:GlobalScoperope.base.pyscopes:FunctionScoperope.base.pyscopes:ClassScoperope.base.pyscopes:lookup
Implements the core logic for evaluating Python expressions and inferring the PyObject or PyName they refer to. It uses scope information and AST traversal to resolve symbols and determine their types, supporting static analysis and code understanding features.
Related Classes/Methods:
rope.base.evaluate:eval_locationrope.base.evaluate:eval_noderope.base.evaluate:eval_strrope.base.evaluate:ScopeNameFinderrope.base.evaluate:StatementEvaluator
Acts as the fundamental search engine for the subsystem. It is responsible for finding all occurrences of Python names and patterns within the project's source code, supporting various filtering mechanisms. This component is crucial for any feature requiring code element lookup.
Related Classes/Methods: None
Provides high-level, user-facing interfaces for code navigation. It abstracts the underlying search mechanisms to offer functionalities like finding definitions, implementations, and general occurrences of symbols, making code exploration intuitive.
Related Classes/Methods: None
Implements intelligent code completion and call tip functionalities. It analyzes the current code context and cursor position to offer relevant suggestions and function signatures, enhancing developer productivity.
Related Classes/Methods: None
Focuses on static code analysis. Its responsibility is to identify and report potential errors, bad practices, or undefined names within the codebase, contributing to code quality and reliability.
Related Classes/Methods: None