mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-16 14:34:08 +02:00
fix: add interface type to golang treesitter backend (#180)
This commit is contained in:
parent
3423358895
commit
480bf14332
4 changed files with 13 additions and 1 deletions
|
@ -35,6 +35,7 @@ return {
|
|||
},
|
||||
go = {
|
||||
function_declaration = "Function",
|
||||
interface_type = "Interface",
|
||||
method_declaration = "Method",
|
||||
struct_type = "Struct",
|
||||
},
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
(type_declaration
|
||||
(type_spec
|
||||
name: (type_identifier) @name
|
||||
type: (struct_type) @type)) @start
|
||||
type: [(struct_type) (interface_type)] @type)) @start
|
||||
|
||||
(method_declaration
|
||||
name: (field_identifier) @name
|
||||
|
|
|
@ -30,6 +30,15 @@ describe("treesitter go", function()
|
|||
end_lnum = 7,
|
||||
end_col = 23,
|
||||
},
|
||||
{
|
||||
kind = "Interface",
|
||||
name = "MyInterface",
|
||||
level = 0,
|
||||
lnum = 9,
|
||||
col = 0,
|
||||
end_lnum = 9,
|
||||
end_col = 28,
|
||||
},
|
||||
})
|
||||
end)
|
||||
end)
|
||||
|
|
|
@ -5,3 +5,5 @@ func fn_1() {}
|
|||
type st_1 struct{}
|
||||
|
||||
func (st_1) Meth_1() {}
|
||||
|
||||
type MyInterface interface{}
|
||||
|
|
Loading…
Reference in a new issue