tabbed for brevity

This commit is contained in:
Paul Gauthier 2023-05-19 06:38:19 -07:00
parent cf63fd31d5
commit 36bbf879b5

View file

@ -3,14 +3,36 @@ import sys
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:
for line in tags_file:
tag = json.loads(line)
scope = tag.get("scope", "")
scope = tag.get("scope", "(top)")
kind = tag.get("kind", "")
name = tag.get("name", "")
signature = tag.get("signature", "")
print(scope, kind, name, signature)
yield (scope, kind, name, signature)
if __name__ == "__main__":