You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is necessary to provide the lnum and col (+ _end variants) eagerly when setting quickfix items. Calculating the position can be expensive. E.g for LSP it would be useful if resolving those values could be done lazy/ad-hoc and asynchronous when needed.
There would probably be a lot of BWC cases to consider, e.g. how this would work for existing uses of getqtflist.
Concrete use case:
Querying workspace symbols via LSP. In neovim this is currently exposed via the vim.lsp.buf.workspace_symbol function. Using this function queries LSP for the symbols and populates the quickfix list with the results. Users can then jump to the definition of a symbol via the quickfix list.
There are two problems:
The existing implementation ignores that the language server usually uses UTF-16 offsets. This could be fixed in the implementation, but would make it slower as we'd have to read the line for each position to convert utf-16 offset to byte indices. (We already do this in other places, which could also be changed to improve performance if it could be done lazy/as-needed)
They added a workspaceSymbol/resolve capability in 3.17.0 of the specification to allow language servers to defer the calculation of the position (because it can be expensive). You'd first list all items and only if the user selects one resolve its position. It's currently not possible to use a quickfix list to implement this. (Unless we'd eagerly resolve all symbols, but that defeats the purpose of the capability).
Alternative Solutions
Create and use a custom buffer/widget for the workspace symbol case
The text was updated successfully, but these errors were encountered:
Sounds like something Vim should do upstream. Quickfix is a complex interface that gets a lot of attention from upstream Vim, and not something we want to own.
Feature already in Vim?
Afaik no
Feature description
Problem
Currently it is necessary to provide the
lnum
andcol
(+_end
variants) eagerly when setting quickfix items. Calculating the position can be expensive. E.g for LSP it would be useful if resolving those values could be done lazy/ad-hoc and asynchronous when needed.There would probably be a lot of BWC cases to consider, e.g. how this would work for existing uses of
getqtflist
.Concrete use case:
Querying workspace symbols via LSP. In neovim this is currently exposed via the
vim.lsp.buf.workspace_symbol
function. Using this function queries LSP for the symbols and populates the quickfix list with the results. Users can then jump to the definition of a symbol via the quickfix list.There are two problems:
workspaceSymbol/resolve
capability in 3.17.0 of the specification to allow language servers to defer the calculation of the position (because it can be expensive). You'd first list all items and only if the user selects one resolve its position. It's currently not possible to use a quickfix list to implement this. (Unless we'd eagerly resolve all symbols, but that defeats the purpose of the capability).Alternative Solutions
The text was updated successfully, but these errors were encountered: