mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
refactor: Update get_scm_fname to support multiple query subdirectories
This commit is contained in:
parent
64a8d56725
commit
f6a2ec15d7
1 changed files with 12 additions and 1 deletions
|
@ -733,8 +733,19 @@ def get_random_color():
|
|||
|
||||
def get_scm_fname(lang):
|
||||
# Load the tags queries
|
||||
if USING_TSL_PACK:
|
||||
subdir = "tree-sitter-language-pack"
|
||||
# check this subdir first, if file exists, return it otherwise check the other. ai!
|
||||
else:
|
||||
subdir = "tree-sitter-languages"
|
||||
|
||||
|
||||
try:
|
||||
return resources.files(__package__).joinpath("queries", f"tree-sitter-{lang}-tags.scm")
|
||||
return resources.files(__package__).joinpath(
|
||||
"queries",
|
||||
subdir,
|
||||
f"tree-sitter-{lang}-tags.scm",
|
||||
)
|
||||
except KeyError:
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue