mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
wip
This commit is contained in:
parent
f5e27cee8a
commit
a5f4cba72f
1 changed files with 21 additions and 18 deletions
|
@ -21,7 +21,7 @@ from aider.utils import Spinner
|
||||||
|
|
||||||
# tree_sitter is throwing a FutureWarning
|
# tree_sitter is throwing a FutureWarning
|
||||||
warnings.simplefilter("ignore", category=FutureWarning)
|
warnings.simplefilter("ignore", category=FutureWarning)
|
||||||
from tree_sitter_languages import get_language, get_parser # noqa: E402
|
from tree_sitter_language_pack import get_language, get_parser # noqa: E402
|
||||||
|
|
||||||
Tag = namedtuple("Tag", "rel_fname fname line name kind".split())
|
Tag = namedtuple("Tag", "rel_fname fname line name kind".split())
|
||||||
|
|
||||||
|
@ -216,10 +216,13 @@ class RepoMap:
|
||||||
query = language.query(query_scm)
|
query = language.query(query_scm)
|
||||||
captures = query.captures(tree.root_node)
|
captures = query.captures(tree.root_node)
|
||||||
|
|
||||||
captures = list(captures)
|
dump(fname)
|
||||||
|
dump(captures)
|
||||||
|
dump(captures.keys())
|
||||||
|
|
||||||
saw = set()
|
saw = set()
|
||||||
for node, tag in captures:
|
for tag, nodes in captures.items():
|
||||||
|
for node in nodes:
|
||||||
if tag.startswith("name.definition."):
|
if tag.startswith("name.definition."):
|
||||||
kind = "def"
|
kind = "def"
|
||||||
elif tag.startswith("name.reference."):
|
elif tag.startswith("name.reference."):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue