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/lsp/_changetracking.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/lsp/_changetracking.lua')
-rw-r--r-- | runtime/lua/vim/lsp/_changetracking.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/lua/vim/lsp/_changetracking.lua b/runtime/lua/vim/lsp/_changetracking.lua index 3ecdec1659..b2be53269f 100644 --- a/runtime/lua/vim/lsp/_changetracking.lua +++ b/runtime/lua/vim/lsp/_changetracking.lua @@ -61,7 +61,7 @@ local state_by_group = setmetatable({}, { end, }) ----@param client lsp.Client +---@param client vim.lsp.Client ---@return vim.lsp.CTGroup local function get_group(client) local allow_inc_sync = vim.F.if_nil(client.flags.allow_incremental_sync, true) --- @type boolean @@ -127,7 +127,7 @@ local function incremental_changes(state, encoding, bufnr, firstline, lastline, return incremental_change end ----@param client lsp.Client +---@param client vim.lsp.Client ---@param bufnr integer function M.init(client, bufnr) assert(client.offset_encoding, 'lsp client must have an offset_encoding') @@ -165,7 +165,7 @@ function M.init(client, bufnr) end end ---- @param client lsp.Client +--- @param client vim.lsp.Client --- @param bufnr integer --- @param name string --- @return string @@ -189,7 +189,7 @@ local function reset_timer(buf_state) end end ---- @param client lsp.Client +--- @param client vim.lsp.Client --- @param bufnr integer function M.reset_buf(client, bufnr) M.flush(client, bufnr) @@ -207,7 +207,7 @@ function M.reset_buf(client, bufnr) end end ---- @param client lsp.Client +--- @param client vim.lsp.Client function M.reset(client) local state = state_by_group[get_group(client)] if not state then @@ -350,7 +350,7 @@ function M.send_changes(bufnr, firstline, lastline, new_lastline) end --- Flushes any outstanding change notification. ----@param client lsp.Client +---@param client vim.lsp.Client ---@param bufnr? integer function M.flush(client, bufnr) local group = get_group(client) |