feat(sdm): inject structural dependency mapping tags across codebase
Adds [C: caller] tags to functions/methods and [M: mutation] / [U: usage] tags to class variables based on cross-module call analysis.
This commit is contained in:
+7
-1
@@ -39,6 +39,9 @@ class CodeOutliner:
|
||||
pass
|
||||
|
||||
def outline(self, code: str) -> str:
|
||||
"""
|
||||
[C: tests/test_outline_tool.py:test_code_outliner_imgui_scopes, tests/test_outline_tool.py:test_code_outliner_nested_ifs, tests/test_outline_tool.py:test_code_outliner_type_hints]
|
||||
"""
|
||||
code = code.lstrip(chr(0xFEFF))
|
||||
try:
|
||||
tree = ast.parse(code)
|
||||
@@ -55,6 +58,9 @@ class CodeOutliner:
|
||||
|
||||
count = [0]
|
||||
def walk(node: ast.AST, indent: int = 0) -> None:
|
||||
"""
|
||||
[C: src/summarize.py:_summarise_python]
|
||||
"""
|
||||
count[0] += 1
|
||||
if count[0] > 100000:
|
||||
raise Exception("Infinite loop detected! " + str(type(node)))
|
||||
@@ -120,4 +126,4 @@ def get_outline(path: Path, code: str) -> str:
|
||||
outliner = CodeOutliner()
|
||||
return outliner.outline(code)
|
||||
else:
|
||||
return f"Outlining not supported for {suffix} files yet."
|
||||
return f"Outlining not supported for {suffix} files yet."
|
||||
Reference in New Issue
Block a user