mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-16 14:34:08 +02:00
feat: add treesitter support for bash
This commit is contained in:
parent
5752afb3a1
commit
1f5a48b064
4 changed files with 25 additions and 0 deletions
|
@ -1,4 +1,7 @@
|
|||
return {
|
||||
bash = {
|
||||
function_definition = "Function",
|
||||
},
|
||||
c = {
|
||||
enum_specifier = "Enum",
|
||||
function_declarator = "Function",
|
||||
|
|
2
queries/bash/aerial.scm
Normal file
2
queries/bash/aerial.scm
Normal file
|
@ -0,0 +1,2 @@
|
|||
(function_definition
|
||||
name: (word) @name) @type
|
15
tests/treesitter/bash_spec.lua
Normal file
15
tests/treesitter/bash_spec.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
local util = require("tests.test_util")
|
||||
|
||||
describe("treesitter bash", function()
|
||||
it("parses all symbols correctly", function()
|
||||
util.test_file_symbols("treesitter", "./tests/treesitter/bash_test.sh", {
|
||||
{
|
||||
kind = "Function",
|
||||
name = "function_1",
|
||||
level = 0,
|
||||
lnum = 3,
|
||||
col = 0,
|
||||
},
|
||||
})
|
||||
end)
|
||||
end)
|
5
tests/treesitter/bash_test.sh
Normal file
5
tests/treesitter/bash_test.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
function_1() {
|
||||
true
|
||||
}
|
Loading…
Reference in a new issue