mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
path
This commit is contained in:
parent
06a33bc1b1
commit
efe05b6d8a
1 changed files with 8 additions and 8 deletions
|
@ -2,19 +2,17 @@ import os
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from aider.dump import dump
|
# from aider.dump import dump
|
||||||
|
|
||||||
|
|
||||||
def print_tags_info(filename):
|
def print_tags_info(filename):
|
||||||
tags = sorted(get_tags(filename))
|
tags = sorted(get_tags(filename))
|
||||||
|
|
||||||
last = [None] * len(tags[0])
|
last = [None] * len(tags[0])
|
||||||
tab = ' '
|
tab = " "
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
tag = list(tag)
|
tag = list(tag)
|
||||||
common_prefix = [
|
common_prefix = [tag_i for tag_i, last_i in zip(tag, last) if tag_i == last_i]
|
||||||
tag_i for tag_i,last_i in zip(tag,last)
|
|
||||||
if tag_i == last_i
|
|
||||||
]
|
|
||||||
num_common = len(common_prefix)
|
num_common = len(common_prefix)
|
||||||
indent = tab * num_common
|
indent = tab * num_common
|
||||||
rest = tag[num_common:]
|
rest = tag[num_common:]
|
||||||
|
@ -36,12 +34,14 @@ def get_tags(filename):
|
||||||
|
|
||||||
last = name
|
last = name
|
||||||
if signature:
|
if signature:
|
||||||
last += ' ' + signature
|
last += " " + signature
|
||||||
|
|
||||||
path = os.path.relpath(path, os.getcwd())
|
path = os.path.relpath(path, os.getcwd())
|
||||||
path_components = path.split(os.sep)
|
path_components = path.split(os.sep)
|
||||||
|
|
||||||
res = []
|
res = [pc + os.sep for pc in path_components[:-1]]
|
||||||
|
res.append(path_components[-1])
|
||||||
|
|
||||||
if scope:
|
if scope:
|
||||||
res.append(scope)
|
res.append(scope)
|
||||||
res += [kind, last]
|
res += [kind, last]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue