Skip to content

Commit d23bba5

Browse files
committed
feat: Increase weight for snake_case and camelCase identifiers
1 parent 5e8fc3e commit d23bba5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

aider/repomap.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,12 @@ def get_ranked_tags(
448448
definers = defines[ident]
449449

450450
mul = 1.0
451-
# if ident is snake_case or camelCase, mul * 10 ai!
451+
# Check for snake_case (contains underscore, no uppercase)
452+
if "_" in ident and not any(c.isupper() for c in ident):
453+
mul *= 10
454+
# Check for camelCase (no underscore, starts with lowercase, has uppercase)
455+
elif not "_" in ident and ident[0].islower() and any(c.isupper() for c in ident):
456+
mul *= 10
452457
if ident in mentioned_idents:
453458
mul *= 10
454459
if ident.startswith("_"):

0 commit comments

Comments
 (0)