Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aider/queries/tree-sitter-language-pack/bash-tags.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
; 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
3 changes: 3 additions & 0 deletions tests/basic/test_repomap.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ def setUp(self):
self.GPT35 = Model("gpt-3.5-turbo")
self.fixtures_dir = Path(__file__).parent.parent / "fixtures" / "languages"

def test_language_bash(self):
self._test_language_repo_map("bash", "sh", "greet")

def test_language_c(self):
self._test_language_repo_map("c", "c", "main")

Expand Down
29 changes: 29 additions & 0 deletions tests/fixtures/languages/bash/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Sample bash script used as a repomap fixture.

# POSIX-style function definition
greet() {
local name="${1:-World}"
echo "Hello, ${name}!"
}

# Keyword-style function definition
function deploy() {
local env="${1:-production}"
echo "Deploying to ${env}..."
}

# Another helper
function cleanup() {
echo "Cleaning up..."
rm -f /tmp/deploy_lock
}

# Main entry point
main() {
greet "$@"
deploy
cleanup
}

main "$@"
Loading