You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
Is your feature request related to a problem? Please describe.
The current implementation of the PyModuleLoader and SymbolGraph classes is designed to work with a single file path. This limitation restricts the ability to handle multiple projects or directories. Extending these classes to support multiple user-specified directories would increase flexibility and usability.
Describe the solution you'd like
I propose to introduce a PyModuleLoaderManager class to manage multiple instances of PyModuleLoader, each responsible for a different directory. This manager would have methods to add loaders, fetch AST modules, and delegate other operations as needed.
For the SymbolGraph class, additional work will be needed to ensure that it can handle symbols and relationships across multiple directories.
Here is a rough sketch of the proposed PyModuleLoaderManager:
classPyModuleLoaderManager:
def__init__(self):
self.loaders: List[PyModuleLoader] = []
defadd_loader(self, root_fpath: str, project_name: str):
loader=PyModuleLoader()
loader.initialize(root_fpath, project_name)
self.loaders.append(loader)
deffetch_ast_module(self, module_dotpath: str) ->Optional[Module]:
forloaderinself.loaders:
ifmodule_dotpathinloader:
returnloader.fetch_ast_module(module_dotpath)
returnNone# Add similar delegate methods for other operations as needed# Usage example:manager=PyModuleLoaderManager()
manager.add_loader("/path/to/project1", "project1")
manager.add_loader("/path/to/project2", "project2")
module=manager.fetch_ast_module("some.dot.path")
Describe alternatives you've considered
An alternative approach could be to refactor the existing classes to handle multiple directories directly, but introducing a manager class provides a cleaner separation of concerns and aligns with the Single Responsibility Principle.
Additional context
The proposed changes are crucial for projects that need to work with multiple directories or sub-projects. Care must be taken to ensure that existing functionalities remain intact and that the new features are adequately tested.
Please adjust the issue's content as needed, based on your project's specific requirements and guidelines.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is your feature request related to a problem? Please describe.
The current implementation of the
PyModuleLoader
andSymbolGraph
classes is designed to work with a single file path. This limitation restricts the ability to handle multiple projects or directories. Extending these classes to support multiple user-specified directories would increase flexibility and usability.Describe the solution you'd like
I propose to introduce a
PyModuleLoaderManager
class to manage multiple instances ofPyModuleLoader
, each responsible for a different directory. This manager would have methods to add loaders, fetch AST modules, and delegate other operations as needed.For the
SymbolGraph
class, additional work will be needed to ensure that it can handle symbols and relationships across multiple directories.Here is a rough sketch of the proposed
PyModuleLoaderManager
:Describe alternatives you've considered
An alternative approach could be to refactor the existing classes to handle multiple directories directly, but introducing a manager class provides a cleaner separation of concerns and aligns with the Single Responsibility Principle.
Additional context
The proposed changes are crucial for projects that need to work with multiple directories or sub-projects. Care must be taken to ensure that existing functionalities remain intact and that the new features are adequately tested.
Please adjust the issue's content as needed, based on your project's specific requirements and guidelines.
The text was updated successfully, but these errors were encountered: