mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
tabbed for brevity
This commit is contained in:
parent
cf63fd31d5
commit
36bbf879b5
1 changed files with 24 additions and 2 deletions
|
@ -3,14 +3,36 @@ import sys
|
||||||
|
|
||||||
|
|
||||||
def print_tags_info(filename):
|
def print_tags_info(filename):
|
||||||
|
last = None
|
||||||
|
tags = sorted(get_tags(filename))
|
||||||
|
|
||||||
|
for tag in tags:
|
||||||
|
if last is None:
|
||||||
|
show = tag
|
||||||
|
else:
|
||||||
|
show = []
|
||||||
|
for lst, tg in zip(last, tag):
|
||||||
|
if lst == tg:
|
||||||
|
show.append("")
|
||||||
|
else:
|
||||||
|
show.append(tg)
|
||||||
|
|
||||||
|
if not show[-1]:
|
||||||
|
show = show[:-1]
|
||||||
|
show = "\t".join(show)
|
||||||
|
print(show)
|
||||||
|
last = tag
|
||||||
|
|
||||||
|
|
||||||
|
def get_tags(filename):
|
||||||
with open(filename, "r") as tags_file:
|
with open(filename, "r") as tags_file:
|
||||||
for line in tags_file:
|
for line in tags_file:
|
||||||
tag = json.loads(line)
|
tag = json.loads(line)
|
||||||
scope = tag.get("scope", "")
|
scope = tag.get("scope", "(top)")
|
||||||
kind = tag.get("kind", "")
|
kind = tag.get("kind", "")
|
||||||
name = tag.get("name", "")
|
name = tag.get("name", "")
|
||||||
signature = tag.get("signature", "")
|
signature = tag.get("signature", "")
|
||||||
print(scope, kind, name, signature)
|
yield (scope, kind, name, signature)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue