diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-02-27 15:20:32 +0000 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-03-01 23:02:18 +0000 |
commit | a5fe8f59d98398d04bed8586cee73864bbcdde92 (patch) | |
tree | 9dd8086edc1e572ba1fddd03df17918dcd76a72e /runtime/lua/vim/treesitter/_query_linter.lua | |
parent | 813dd36b72979dfd05479eb6402b9becc0faea29 (diff) | |
download | rneovim-a5fe8f59d98398d04bed8586cee73864bbcdde92.tar.gz rneovim-a5fe8f59d98398d04bed8586cee73864bbcdde92.tar.bz2 rneovim-a5fe8f59d98398d04bed8586cee73864bbcdde92.zip |
docs: improve/add documentation of Lua types
- Added `@inlinedoc` so single use Lua types can be inlined into the
functions docs. E.g.
```lua
--- @class myopts
--- @inlinedoc
---
--- Documentation for some field
--- @field somefield integer
--- @param opts myOpts
function foo(opts)
end
```
Will be rendered as
```
foo(opts)
Parameters:
- {opts} (table) Object with the fields:
- somefield (integer) Documentation
for some field
```
- Marked many classes with with `@nodoc` or `(private)`.
We can eventually introduce these when we want to.
Diffstat (limited to 'runtime/lua/vim/treesitter/_query_linter.lua')
-rw-r--r-- | runtime/lua/vim/treesitter/_query_linter.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/lua/vim/treesitter/_query_linter.lua b/runtime/lua/vim/treesitter/_query_linter.lua index 6ec997eb4a..b91e8ac38d 100644 --- a/runtime/lua/vim/treesitter/_query_linter.lua +++ b/runtime/lua/vim/treesitter/_query_linter.lua @@ -45,7 +45,7 @@ local function guess_query_lang(buf) end --- @param buf integer ---- @param opts QueryLinterOpts|QueryLinterNormalizedOpts|nil +--- @param opts vim.treesitter.query.lint.Opts|QueryLinterNormalizedOpts|nil --- @return QueryLinterNormalizedOpts local function normalize_opts(buf, opts) opts = opts or {} @@ -122,7 +122,7 @@ local parse = vim.func._memoize(hash_parse, function(node, buf, lang) end) --- @param buf integer ---- @param match TSMatch +--- @param match vim.treesitter.query.TSMatch --- @param query Query --- @param lang_context QueryLinterLanguageContext --- @param diagnostics Diagnostic[] @@ -153,7 +153,7 @@ end --- @private --- @param buf integer Buffer to lint ---- @param opts QueryLinterOpts|QueryLinterNormalizedOpts|nil Options for linting +--- @param opts vim.treesitter.query.lint.Opts|QueryLinterNormalizedOpts|nil Options for linting function M.lint(buf, opts) if buf == 0 then buf = api.nvim_get_current_buf() |