mirror of
https://github.com/neovim/neovim.git
synced 2025-10-22 17:11:49 +00:00
docs(lsp): document vim.lsp.ListOpts.loclist
This commit is contained in:
@@ -1201,12 +1201,11 @@ Lua module: vim.lsp.buf *lsp-buf*
|
|||||||
vim.lsp.buf.references(nil, { on_list = on_list })
|
vim.lsp.buf.references(nil, { on_list = on_list })
|
||||||
<
|
<
|
||||||
|
|
||||||
If you prefer loclist do something like this: >lua
|
If you prefer loclist instead of qflist: >lua
|
||||||
local function on_list(options)
|
vim.lsp.buf.definition({ loclist = true })
|
||||||
vim.fn.setloclist(0, {}, ' ', options)
|
vim.lsp.buf.references(nil, { loclist = true })
|
||||||
vim.cmd.lopen()
|
|
||||||
end
|
|
||||||
<
|
<
|
||||||
|
• {loclist}? (`boolean`)
|
||||||
|
|
||||||
*vim.lsp.LocationOpts*
|
*vim.lsp.LocationOpts*
|
||||||
Extends: |vim.lsp.ListOpts|
|
Extends: |vim.lsp.ListOpts|
|
||||||
|
@@ -62,14 +62,13 @@ end
|
|||||||
--- vim.lsp.buf.references(nil, { on_list = on_list })
|
--- vim.lsp.buf.references(nil, { on_list = on_list })
|
||||||
--- ```
|
--- ```
|
||||||
---
|
---
|
||||||
--- If you prefer loclist do something like this:
|
--- If you prefer loclist instead of qflist:
|
||||||
--- ```lua
|
--- ```lua
|
||||||
--- local function on_list(options)
|
--- vim.lsp.buf.definition({ loclist = true })
|
||||||
--- vim.fn.setloclist(0, {}, ' ', options)
|
--- vim.lsp.buf.references(nil, { loclist = true })
|
||||||
--- vim.cmd.lopen()
|
|
||||||
--- end
|
|
||||||
--- ```
|
--- ```
|
||||||
--- @field on_list? fun(t: vim.lsp.LocationOpts.OnList)
|
--- @field on_list? fun(t: vim.lsp.LocationOpts.OnList)
|
||||||
|
--- @field loclist? boolean
|
||||||
|
|
||||||
--- @class vim.lsp.LocationOpts.OnList
|
--- @class vim.lsp.LocationOpts.OnList
|
||||||
--- @field items table[] Structured like |setqflist-what|
|
--- @field items table[] Structured like |setqflist-what|
|
||||||
|
@@ -268,10 +268,7 @@ end
|
|||||||
|
|
||||||
--- Return a function that converts LSP responses to list items and opens the list
|
--- Return a function that converts LSP responses to list items and opens the list
|
||||||
---
|
---
|
||||||
--- The returned function has an optional {config} parameter that accepts a table
|
--- The returned function has an optional {config} parameter that accepts |vim.lsp.ListOpts|
|
||||||
--- with the following keys:
|
|
||||||
---
|
|
||||||
--- loclist: (boolean) use the location list (default is to use the quickfix list)
|
|
||||||
---
|
---
|
||||||
---@param map_result fun(resp, bufnr: integer): table to convert the response
|
---@param map_result fun(resp, bufnr: integer): table to convert the response
|
||||||
---@param entity string name of the resource used in a `not found` error message
|
---@param entity string name of the resource used in a `not found` error message
|
||||||
|
Reference in New Issue
Block a user