diff options
author | Jongwook Choi <wookayin@gmail.com> | 2024-01-13 18:36:30 -0500 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-01-14 14:04:08 +0000 |
commit | a7df0415ab6ae9a89ca12c6765758bfd54fa69c9 (patch) | |
tree | cec67687e4ddcd6f540e446717ff2f927a2a083f /scripts/gen_eval_files.lua | |
parent | 2cdea852e8934beb89012f2127f333e4dd8aada8 (diff) | |
download | rneovim-a7df0415ab6ae9a89ca12c6765758bfd54fa69c9.tar.gz rneovim-a7df0415ab6ae9a89ca12c6765758bfd54fa69c9.tar.bz2 rneovim-a7df0415ab6ae9a89ca12c6765758bfd54fa69c9.zip |
fix(lua2dox): filter out the entire `---@alias` block
Problem: Any preceding luadocs block that define alias types with
`@alias` magic would be prepended to the documentation of functions
that follow, despite the "blank line" separator. For example:
```
--- @alias some.type.between.functions
--- Blah blah long documentation for alias
--- | "foo" # foo
--- | "bar" # bar
--- The documentation that should appear in vimdoc.
function M.function_to_include_in_doc()
...
end
```
then the vimdoc generated for `function_to_include_in_doc` would include
the text from the alias block (e.g., "Blah blah ... for alias").
Solution:
- refactor: Lua2DoxFilter should maintain its own internal state
`generics`, rather than carrying it as a parameter to local helper
functions.
- Add another boolean state `boolean_state` which represents whether
to ignore the current docstring block (magic lines). This flag will
be reset as soon as the block is end.
Note: As expected, there is no change at all in the current docs
generated, because we have been working around and writing luadoc
comments so that such erroneous docstring resulting from preceding
`@alias` blocks won't appear.
Diffstat (limited to 'scripts/gen_eval_files.lua')
0 files changed, 0 insertions, 0 deletions