Update godoc file template (#114)
Co-authored-by: danymat <d.danymat@gmail.com>
This commit is contained in:
@@ -5,7 +5,8 @@ local nodes_utils = require("neogen.utilities.nodes")
|
|||||||
return {
|
return {
|
||||||
parent = {
|
parent = {
|
||||||
func = { "function_declaration", "method_declaration" },
|
func = { "function_declaration", "method_declaration" },
|
||||||
type = { "package_clause", "const_declaration", "var_declaration", "type_declaration" },
|
type = { "const_declaration", "var_declaration", "type_declaration" },
|
||||||
|
file = { "package_clause" },
|
||||||
},
|
},
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
@@ -45,8 +46,27 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
file = {
|
||||||
|
["package_clause"] = {
|
||||||
|
["0"] = {
|
||||||
|
extract = function(node)
|
||||||
|
local tree = {
|
||||||
|
{
|
||||||
|
retrieve = "first",
|
||||||
|
node_type = "package_identifier",
|
||||||
|
extract = "true",
|
||||||
|
as = "package_name",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
local nodes = nodes_utils:matching_nodes_from(node, tree)
|
||||||
|
local res = extractors:extract_from_matched(nodes)
|
||||||
|
return res
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
type = {
|
type = {
|
||||||
["package_clause|const_declaration|var_declaration"] = {
|
["const_declaration|var_declaration"] = {
|
||||||
["0"] = {
|
["0"] = {
|
||||||
extract = function()
|
extract = function()
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ end
|
|||||||
--- with multiple annotation conventions.
|
--- with multiple annotation conventions.
|
||||||
---@tag neogen-changelog
|
---@tag neogen-changelog
|
||||||
---@toc_entry Changes in neogen plugin
|
---@toc_entry Changes in neogen plugin
|
||||||
neogen.version = "2.10.1"
|
neogen.version = "2.10.2"
|
||||||
--minidoc_afterlines_end
|
--minidoc_afterlines_end
|
||||||
|
|
||||||
return neogen
|
return neogen
|
||||||
|
|||||||
@@ -2,4 +2,5 @@ return {
|
|||||||
{ nil, " $1", { no_results = true } },
|
{ nil, " $1", { no_results = true } },
|
||||||
{ "func_name", " %s $1", { type = { "func" } } },
|
{ "func_name", " %s $1", { type = { "func" } } },
|
||||||
{ "type_name", " %s $1", { type = { "type" } } },
|
{ "type_name", " %s $1", { type = { "type" } } },
|
||||||
|
{ "package_name", " Package %s $1", { type = { "file" } } },
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user