Directory
Directory representation for codebase. GraphSitter abstraction of a file directory that can be used to look for files and symbols within a specific directory.
Attributes
classes
Get a recursive list of all classes in files container.
dirpath
str
Relative path of the directory.
exports
Get a recursive list of all exports in files container.
functions
Get a recursive list of all functions in files container.
global_vars
Get a recursive list of all global variables in files container.
import_statements
Get a recursive list of all import statements in files container.
imports
Get a recursive list of all imports in files container.
item_names
list[str]
Get a list of all file and subdirectory names in the directory.
name
str
Get the base name of the directory's path.
parent
Get the parent directory of the current directory.
path
Path
Absolute path of the directory.
symbols
Get a recursive list of all symbols in files container.
tree
Get a recursive list of all files and subdirectories in the directory.
Methods
files
Gets a list of all top level files in the directory.
Returns
list[TFile]
A sorted list of source files in the codebase.
get_class
Get a class by name in files container.
Returns
get_export
Get an export by name in files container (supports only typescript).
Returns
get_file
Get a file by its name relative to the directory.
Returns
TFile | None
get_function
Get a function by name in files container.
Returns
get_global_var
Get a global variable by name in files container.
Returns
get_import
Get an import by name in files container.
Returns
get_import_statement
Get an import statement by name in files container.
Returns
get_subdirectory
Get a subdirectory by its name (relative to the directory).
Returns
get_symbol
Get a symbol by name in files container.
Returns
items
Get a list of all files and subdirectories in the directory.
Returns
A sorted list of files and subdirectories in the directory.
remove
Remove all the files in the files container.
Returns
None
rename
Rename the directory.
Returns
None
subdirectories
Get a list of all top level subdirectories in the directory.
Returns
A sorted list of subdirectories in the directory.
update_filepath
Update the filepath of the directory and its contained files.
Returns
None