feat: Increase weight for snake_case and camelCase identifiers

This commit is contained in:
Paul Gauthier (aider) 2025-03-22 14:58:56 -07:00
parent 5e8fc3e4c8
commit d23bba5d9f

View file

@ -448,7 +448,12 @@ class RepoMap:
definers = defines[ident]
mul = 1.0
# if ident is snake_case or camelCase, mul * 10 ai!
# Check for snake_case (contains underscore, no uppercase)
if "_" in ident and not any(c.isupper() for c in ident):
mul *= 10
# Check for camelCase (no underscore, starts with lowercase, has uppercase)
elif not "_" in ident and ident[0].islower() and any(c.isupper() for c in ident):
mul *= 10
if ident in mentioned_idents:
mul *= 10
if ident.startswith("_"):