mirror of
https://github.com/neovim/neovim.git
synced 2025-10-22 17:11:49 +00:00
docs: Lua docstrings guidance #25345
Recommend adding a space after i.e. `--- @see`. The "space" variant is common for the vast majority of docstring formats such as doxygen, javadoc and typescript.
This commit is contained in:
@@ -232,10 +232,11 @@ Lua documentation lives in the source code, as docstrings on the function
|
|||||||
definitions. The |lua-vim| :help is generated from the docstrings.
|
definitions. The |lua-vim| :help is generated from the docstrings.
|
||||||
|
|
||||||
Docstring format:
|
Docstring format:
|
||||||
- Use LuaLS annotations: https://github.com/LuaLS/lua-language-server/wiki/Annotations
|
- Use LuaLS annotations (with minor adjustments, which will be explained
|
||||||
|
below): https://luals.github.io/wiki/annotations/
|
||||||
- Lines in the main description start with `--- `
|
- Lines in the main description start with `--- `
|
||||||
- Special tokens start with `---@` followed by the token name:
|
- Special tokens start with `--- @` followed by the token name: `--- @see`,
|
||||||
`---@see`, `---@param`, `---@returns`
|
`--- @param`, `--- @returns`. Note the space between `---` and `@`.
|
||||||
- Limited markdown is supported.
|
- Limited markdown is supported.
|
||||||
- List-items start with `-` (useful to nest or "indent")
|
- List-items start with `-` (useful to nest or "indent")
|
||||||
- Use ``` for code samples.
|
- Use ``` for code samples.
|
||||||
|
Reference in New Issue
Block a user