diff --git a/lua/neogen/init.lua b/lua/neogen/init.lua index 9aab175..43ea35e 100644 --- a/lua/neogen/init.lua +++ b/lua/neogen/init.lua @@ -140,7 +140,7 @@ neogen.match_commands = helpers.match_commands --- Get a template for a particular filetype ---@param filetype? string ----@return neogen.TemplateConfig|nil +---@return neogen.TemplateConfig? neogen.get_template = function(filetype) local template local ft_conf = filetype and conf.languages[filetype] or conf.languages[vim.bo.filetype] diff --git a/lua/neogen/template.lua b/lua/neogen/template.lua index 88f7acb..19900d6 100644 --- a/lua/neogen/template.lua +++ b/lua/neogen/template.lua @@ -24,7 +24,7 @@ local neogen_template = { ---@class neogen.TemplateConfig see |template_config| ---@field annotation_convention string select which annotation convention to use ---@field use_default_comment boolean Prepend default filetype comment before a annotation ----@field append neogen.TemplateConfig.Append|nil custom placement of the annotation +---@field append? neogen.TemplateConfig.Append custom placement of the annotation ---@field position fun(node: userdata, type: string): number,number Provide an absolute position for the annotation --- If values are `nil`, use default positioning --- @@ -32,7 +32,7 @@ local neogen_template = { ---@field child_name string Which child node to use for appending the annotation ---@field fallback string Node to fallback if `child_name` is not found ---@field position "'after'"|"'before'" Place the annotation relative to position with `child_name` or `fallback` ----@field disabled table|nil Disable custom placement for provided types +---@field disabled? table Disable custom placement for provided types --- --- For example, to customize the placement for a python annotation, we can use `append`, like so: --- @@ -121,7 +121,7 @@ end --- Add a custom annotation convention to the template ---@param name string The name of the annotation convention ---@param annotation table The annotation template (see |neogen-annotation|) ----@param default boolean|nil Marks the annotation as default one +---@param default? boolean Marks the annotation as default one ---@tag neogen-template-api.add_custom_annotation() neogen_template.add_custom_annotation = function(self, name, annotation, default) if default == true then diff --git a/lua/neogen/utilities/extractors.lua b/lua/neogen/utilities/extractors.lua index b1b6e01..aed0b31 100644 --- a/lua/neogen/utilities/extractors.lua +++ b/lua/neogen/utilities/extractors.lua @@ -4,7 +4,7 @@ return { --- Extract the content from each node from data --- @param _ any self --- @param data table a list of k,v values where k is the node_type and v a table of nodes - --- @param opts table|nil optional configurations (supported: type = true will get node's type instead of node's text) + --- @param opts? table configurations (supported: type = true will get node's type instead of node's text) --- @return any result the same table as data but with node texts instead extract_from_matched = function(_, data, opts) opts = opts or {} diff --git a/lua/neogen/utilities/nodes.lua b/lua/neogen/utilities/nodes.lua index 1f41620..1bdd4c7 100644 --- a/lua/neogen/utilities/nodes.lua +++ b/lua/neogen/utilities/nodes.lua @@ -3,7 +3,7 @@ return { --- Get a list of child nodes that match the provided node name --- @param _ any --- @param parent userdata the parent's node - --- @param node_type string|nil the node type to search for (if multiple childrens, separate each one with "|") + --- @param node_type? string the node type to search for (if multiple childrens, separate each one with "|") --- @return table a table of nodes that matched the name matching_child_nodes = function(_, parent, node_type) local results = {}