feat(ts)(make): Makefile support for treesitter backend (#108)

This commit is contained in:
Steven Arcangeli 2022-05-26 21:20:57 -07:00
parent 498c0338b8
commit fbea7a2f39
4 changed files with 37 additions and 0 deletions

View file

@ -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
View file

@ -0,0 +1,3 @@
(rule
(targets) @name
) @type

View file

@ -0,0 +1,5 @@
all: foo bar
echo test
out.so:
touch out.so

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