mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
feat: Increase weight for snake_case and camelCase identifiers
This commit is contained in:
parent
5e8fc3e4c8
commit
d23bba5d9f
1 changed files with 6 additions and 1 deletions
|
@ -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("_"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue