test(lsp): refactor and tidy

- Merge all the top level 'LSP' describe blocks
- Refactor text edit tests
- Fix typing errors
- Add linebreaks between tests
This commit is contained in:
Lewis Russell
2024-08-11 11:58:15 +01:00
committed by Lewis Russell
parent 8df6736ca1
commit 9b5ab66678
9 changed files with 441 additions and 331 deletions

View File

@@ -140,3 +140,69 @@
--- @field sid string
--- @field variables? table<string, any>
--- @field version 1
--- @class vim.fn.undotree.entry
---
--- Undo sequence number. Same as what appears in
--- \|:undolist|.
--- @field seq integer
---
--- Timestamp when the change happened. Use
--- \|strftime()| to convert to something readable.
--- @field time integer
---
--- Only appears in the item that is the last one
--- that was added. This marks the last change
--- and where further changes will be added.
--- @field newhead? integer
---
--- Only appears in the item that is the last one
--- that was undone. This marks the current
--- position in the undo tree, the block that will
--- be used by a redo command. When nothing was
--- undone after the last change this item will
--- not appear anywhere.
--- @field curhead? integer
---
--- Only appears on the last block before a file
--- write. The number is the write count. The
--- first write has number 1, the last one the
--- "save_last" mentioned above.
--- @field save integer
---
--- Alternate entry. This is again a List of undo
--- blocks. Each item may again have an "alt"
--- item.
--- @field alt vim.fn.undotree.entry[]
--- @class vim.fn.undotree.ret
---
--- The highest undo sequence number used.
--- @field seq_last integer
---
--- The sequence number of the current position in
--- the undo tree. This differs from "seq_last"
--- when some changes were undone.
--- @field seq_cur integer
---
--- Time last used for |:earlier| and related
--- commands. Use |strftime()| to convert to
--- something readable.
--- @field time_cur integer
---
--- Number of the last file write. Zero when no
--- write yet.
--- @field save_last integer
---
--- Number of the current position in the undo
--- tree.
--- @field save_cur integer
---
--- Non-zero when the last undo block was synced.
--- This happens when waiting from input from the
--- user. See |undo-blocks|.
--- @field synced integer
---
--- A list of dictionaries with information about
--- undo blocks.
--- @field entries vim.fn.undotree.entry[]

View File

@@ -10403,7 +10403,7 @@ function vim.fn.undofile(name) end
--- item.
---
--- @param buf? integer|string
--- @return any
--- @return vim.fn.undotree.ret
function vim.fn.undotree(buf) end
--- Remove second and succeeding copies of repeated adjacent

View File

@@ -1442,7 +1442,7 @@ end
--- Computes size of float needed to show contents (with optional wrapping)
---
---@param contents table of lines to show in window
---@param opts table with optional fields
---@param opts? table with optional fields
--- - height of floating window
--- - width of floating window
--- - wrap_at character to wrap at for computing height
@@ -1821,7 +1821,7 @@ end
--- Converts symbols to quickfix list items.
---
---@param symbols table DocumentSymbol[] or SymbolInformation[]
---@param bufnr integer
---@param bufnr? integer
function M.symbols_to_items(symbols, bufnr)
local function _symbols_to_items(_symbols, _items, _bufnr)
for _, symbol in ipairs(_symbols) do