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.
This commit is contained in:
Lewis Russell
2024-02-27 15:20:32 +00:00
committed by Lewis Russell
parent 813dd36b72
commit a5fe8f59d9
47 changed files with 2014 additions and 1450 deletions

View File

@@ -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)