mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14: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):
|
def get_scm_fname(lang):
|
||||||
# Load the tags queries
|
# 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:
|
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:
|
except KeyError:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue