mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-16 14:34:08 +02:00
feat(ts)(make): Makefile support for treesitter backend (#108)
This commit is contained in:
parent
498c0338b8
commit
fbea7a2f39
4 changed files with 37 additions and 0 deletions
|
@ -61,6 +61,9 @@ return {
|
|||
function_declaration = "Function",
|
||||
function_definition = "Function",
|
||||
},
|
||||
make = {
|
||||
rule = "Interface",
|
||||
},
|
||||
markdown = {
|
||||
atx_heading = "Interface",
|
||||
},
|
||||
|
|
3
queries/make/aerial.scm
Normal file
3
queries/make/aerial.scm
Normal file
|
@ -0,0 +1,3 @@
|
|||
(rule
|
||||
(targets) @name
|
||||
) @type
|
5
tests/treesitter/Makefile
Normal file
5
tests/treesitter/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
all: foo bar
|
||||
echo test
|
||||
|
||||
out.so:
|
||||
touch out.so
|
26
tests/treesitter/make_spec.lua
Normal file
26
tests/treesitter/make_spec.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
local util = require("tests.test_util")
|
||||
|
||||
describe("make", function()
|
||||
it("parses all symbols correctly", function()
|
||||
util.test_file_symbols("treesitter", "./tests/treesitter/Makefile", {
|
||||
{
|
||||
kind = "Interface",
|
||||
name = "all",
|
||||
level = 0,
|
||||
lnum = 1,
|
||||
col = 0,
|
||||
end_lnum = 4,
|
||||
end_col = 0,
|
||||
},
|
||||
{
|
||||
kind = "Interface",
|
||||
name = "out.so",
|
||||
level = 0,
|
||||
lnum = 4,
|
||||
col = 0,
|
||||
end_lnum = 6,
|
||||
end_col = 0,
|
||||
},
|
||||
})
|
||||
end)
|
||||
end)
|
Loading…
Reference in a new issue