From d23bba5d9f27135d2cd29f6a96f2d02706df09f7 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 22 Mar 2025 14:58:56 -0700 Subject: [PATCH] feat: Increase weight for snake_case and camelCase identifiers --- aider/repomap.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aider/repomap.py b/aider/repomap.py index 5793108b0..5f7335f16 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -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("_"):