Skip to content

Add bash/shell repomap support#5052

Open
Kcstring wants to merge 1 commit intoAider-AI:mainfrom
Kcstring:feat/bash-repomap
Open

Add bash/shell repomap support#5052
Kcstring wants to merge 1 commit intoAider-AI:mainfrom
Kcstring:feat/bash-repomap

Conversation

@Kcstring
Copy link
Copy Markdown

Summary

Adds tree-sitter query support for Bash/shell scripts so that .sh, .bash, and .zsh files appear in the repo map with their function definitions.

New file: aider/queries/tree-sitter-language-pack/bash-tags.scm

; Bash / shell script function definitions.
; Matches both POSIX-style `name() { ... }` and keyword-style
; `function name() { ... }` / `function name { ... }`.

(function_definition
  name: (word) @name.definition.function) @definition.function

This captures both declaration styles supported by the tree-sitter-bash grammar:

# POSIX-style
greet() { echo "Hello"; }

# Keyword-style
function deploy() { echo "Deploying"; }

Test plan

  • Added tests/fixtures/languages/bash/test.sh with representative function definitions
  • Added test_language_bash to TestRepoMapAllLanguages — verifies that greet appears in the generated repo map
  • python -m pytest tests/basic/test_repomap.py::TestRepoMapAllLanguages::test_language_bash -xvs passes locally

Add `bash-tags.scm` so that `.sh`, `.bash`, and `.zsh` files appear in
the repo map with their function definitions.  Both POSIX-style
(`name() { ... }`) and keyword-style (`function name() { ... }`)
declarations are captured via the `function_definition` node in the
tree-sitter-bash grammar.

Also adds a fixture file and a `test_language_bash` test to the
`TestRepoMapAllLanguages` suite.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 19, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants