mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
include individual files in the ranked tags list, following specific ranked idents
This commit is contained in:
parent
dedf3fbebb
commit
dfcf813ad6
1 changed files with 9 additions and 6 deletions
|
@ -31,11 +31,15 @@ def to_tree(tags):
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
tag = list(tag)
|
tag = list(tag)
|
||||||
|
|
||||||
for i in range(len(last)):
|
for i in range(len(last) + 1):
|
||||||
|
if i == len(last):
|
||||||
|
break
|
||||||
if last[i] != tag[i]:
|
if last[i] != tag[i]:
|
||||||
break
|
break
|
||||||
|
|
||||||
num_common = i
|
num_common = i
|
||||||
|
dump(repr(tag), num_common)
|
||||||
|
|
||||||
indent = tab * num_common
|
indent = tab * num_common
|
||||||
rest = tag[num_common:]
|
rest = tag[num_common:]
|
||||||
for item in rest:
|
for item in rest:
|
||||||
|
@ -283,11 +287,6 @@ class RepoMap:
|
||||||
except ZeroDivisionError:
|
except ZeroDivisionError:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
# top_rank = sorted([(rank, node) for (node, rank) in ranked.items()], reverse=True)
|
|
||||||
# Print the PageRank of each node
|
|
||||||
# for rank, node in top_rank:
|
|
||||||
# print(f"{rank:.03f} {node}")
|
|
||||||
|
|
||||||
# distribute the rank from each source node, across all of its out edges
|
# distribute the rank from each source node, across all of its out edges
|
||||||
ranked_definitions = defaultdict(float)
|
ranked_definitions = defaultdict(float)
|
||||||
for src in G.nodes:
|
for src in G.nodes:
|
||||||
|
@ -307,6 +306,10 @@ class RepoMap:
|
||||||
continue
|
continue
|
||||||
ranked_tags += list(definitions.get((fname, ident), []))
|
ranked_tags += list(definitions.get((fname, ident), []))
|
||||||
|
|
||||||
|
top_rank = sorted([(rank, node) for (node, rank) in ranked.items()], reverse=True)
|
||||||
|
for rank, fname in top_rank:
|
||||||
|
ranked_tags.append((fname,))
|
||||||
|
|
||||||
return ranked_tags
|
return ranked_tags
|
||||||
|
|
||||||
def get_ranked_tags_map(self, chat_fnames, other_fnames=None):
|
def get_ranked_tags_map(self, chat_fnames, other_fnames=None):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue