feat: add treesitter support for bash

This commit is contained in:
Steven Arcangeli 2021-11-30 19:05:55 -08:00
parent 5752afb3a1
commit 1f5a48b064
4 changed files with 25 additions and 0 deletions

View file

@ -1,4 +1,7 @@
return {
bash = {
function_definition = "Function",
},
c = {
enum_specifier = "Enum",
function_declarator = "Function",

2
queries/bash/aerial.scm Normal file
View file

@ -0,0 +1,2 @@
(function_definition
name: (word) @name) @type

View 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)

View file

@ -0,0 +1,5 @@
#!/bin/bash
function_1() {
true
}