Closed ColinKennedy closed 3 weeks ago
Thanks for the issue!
This works as expected. The reason this happens is because @module
annotation does not have a recognized section hook. It means that this is not recognized as a separate section, but as a continuation of the previously detected section (in the example above it is all the text from the start of the block which has default section id, i.e. @text
).
To process @module
attribute as a separate section, I'd suggest the following:
if _G.MiniDoc == nil then require('mini.doc').setup() end
local hooks = vim.deepcopy(MiniDoc.default_hooks)
hooks.sections['@module'] = function(s) s:clear_lines() end
MiniDoc.generate(nil, nil, { hooks = hooks })
Closing as currently working as expected and might be resolved as part of #1227.
Contributing guidelines
Module(s)
mini.doc
Description
Related to https://github.com/echasnovski/mini.nvim/issues/1227
A lua file such as
Ends up looking this this
The documentation of mini.doc recommends
*Foo*
syntax for defining module names (which does syntax-highlight in vimdocs as expected) so I see this extra'my_module'
as an unintended extra. It'd be nice to have mini.doc ignore these---@module 'foo.'
lines and incorporate them more holistically (see https://github.com/echasnovski/mini.nvim/issues/1227 for details)Neovim version
NVIM v0.11.0-dev-345+g3e6cec0be
Steps to reproduce
nvim -nu minimal.lua
local M = {}
--- Do something. ---@param value string Some text. ---@return number? # A value. function M.to_number(value) return tonumber(value) end
return M