aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/buf.lua
Commit message (Collapse)AuthorAge
* docs: miscdundargoc2025-01-30
| | | | | | | | | Co-authored-by: Dustin S. <dstackmasta27@gmail.com> Co-authored-by: Ferenc Fejes <fejes@inf.elte.hu> Co-authored-by: Maria José Solano <majosolano99@gmail.com> Co-authored-by: Yochem van Rosmalen <git@yochem.nl> Co-authored-by: brianhuster <phambinhanctb2004@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix: resolve all remaining LuaLS diagnosticsLewis Russell2025-01-27
|
* fix(lsp): prefer `on_list` over `loclist` in default handlerEvgeni Chasnovski2025-01-23
| | | | | | | | | | Problem: setting `loclist = true` makes `on_list` being ignored. This was not a problem before, but with `vim.lsp.buf.document_symbol` using `loclist = true` as default it is needed to explicitly pass `loclist = false` in order to use custom `on_list`. Solution: prefer `on_list` over `loclist` and document the latter as taking effect only in the default handler.
* fix(lsp): document_symbol uses loclist by default #32070Yochem van Rosmalen2025-01-19
| | | | | | | | | | | Problem: Not able to open document symbols for different buffers Solution: Use the location list as default. To switch back to previous behavior (qflist): vim.lsp.buf.document_symbol({ loclist = false }) Fixes: #31832
* refactor: use nvim.foo.bar format for namespacesMaria José Solano2025-01-14
|
* fix(lsp): check if sig_help window is focusable when configuring cycle keymapMaria José Solano2024-12-29
|
* refactor: add vim._resolve_bufnrLewis Russell2024-12-07
|
* docs(lsp): update example, optional parameters #31299Yi Ming2024-11-28
|
* docs: more accurate typing for LSP references contextRiley Bruins2024-11-28
| | | | | | | **Problem:** The `context` parameter for `references()` is just typed as a table, which is unhelpful. **Solution:** Properly type it as an `lsp.ReferenceContext`!
* refactor(lsp): rename `offset_encoding` to `position_encoding` #31286Yi Ming2024-11-25
| | | | | | | | Problem: LSP spec uses the term "position encoding" where we say "offset encoding". Solution: - Rename it everywhere except `vim.lsp.Client.offset_encoding` (which would be breaking). - Mention "position encoding" in the documentation for `vim.lsp.Client.offset_encoding`.
* feat(lsp): deprecate non-method client functionsLewis Russell2024-11-20
| | | | | | | | | | | | | | Deprecated: - `client.request()` -> `client:request()` - `client.request_sync()` -> `client:request_sync()` - `client.notify()` -> `client:notify()` - `client.cancel_request()` -> `client:cancel_request()` - `client.stop()` -> `client:stop()` - `client.is_stopped()` `client:is_stopped()` - `client.supports_method()` -> `client:supports_method()` - `client.on_attach()` -> `client:on_attach()` Fixed docgen to link class fields to the full function doc.
* refactor(lsp): fold in dynamic_registration code into the clientLewis Russell2024-11-18
| | | | | | | | | | | Problem: Capability register logic is spread across 3 files. Solution: - Consolidate (and simplify) logic into the client. - Teach client.supports_method about resolve methods
* feat(lsp): highlight hover target/range #31110Riley Bruins2024-11-17
| | | | | | | | | | **Problem:** Despite the LSP providing the option for language servers to specify a range with a hover response (for highlighting), Neovim does not give the option to highlight this range. **Solution:** Add an option to `buf.hover()` which causes this range to be highlighted. Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
* feat(lsp): multi-client support for signature_helpLewis Russell2024-11-04
| | | | | Signatures can be cycled using `<C-s>` when the user enters the floating window.
* feat(lsp)!: remove client-server handlers from vim.lsp.handlersLewis Russell2024-11-01
| | | | | | | | | | - Partition the handlers in vim.lsp.handlers as: - client to server response handlers (RCS) - server to client request handlers (RSC) - server to client notification handlers (NSC) Note use string indexes instead of protocol.methods for improved typing in LuaLS (tip: use hover on RCS, RSC or NSC).
* fix(lsp): correct hover result handling (#30995)notomo2024-10-30
| | | | | | | Problem: vim.lsp.buf.hover() displays "No information available" when client_id is not 1. Solution: use vim.tbl_isempty(tbl) instead of #tbl==0
* feat(lsp)!: multiple client support for vim.lsp.buf.hover()Lewis Russell2024-10-29
| | | | Deprecate `vim.lsp.handlers.hover` and `vim.lsp.handlers['textDocument/hover']`
* feat(lsp): deprecate vim.lsp.buf.completionLewis Russell2024-10-24
| | | | Use `vim.lsp.completion.trigger()` instead'
* feat(lsp): deprecate execute_command with client:exec_cmdLewis Russell2024-10-24
|
* fix(lsp): better multi-client support for callHierarchyLewis Russell2024-10-24
| | | | | | | | Only ever display a dialogue box once. Switch from vim.fn.inpulist to vim.ui.select refactor(lsp): merge call and type hierarchy functions
* fix(lsp): use correct method for prepareTypehierarchyLewis Russell2024-10-24
| | | | Regression from #30902
* fix(lsp): set tagstack on jump via goto methodsMathias Fussenegger2024-10-24
| | | | | Follow up to https://github.com/neovim/neovim/pull/30877 Fixes https://github.com/neovim/neovim/issues/30926
* fix(lsp.buf): use correct offset_encoding for all requestsLewis Russell2024-10-24
| | | | | | | | | | | | | | | Problem: `lsp.buf_request` send the same params to all servers and many calls to this pass PositionalParams which depends on the clients offset_encoding. This can result with incorrect params being sent to a server. Solution: `lsp.buf_request` `params` argument can now be passed as a function which takes the client as the first argument. This is used in lsp/buf.lua to construct correct params for each client request.
* refactor(lsp.buf): remove buf_request wrapperLewis Russell2024-10-24
|
* refactor(lsp.buf): use alias for vim.lspLewis Russell2024-10-24
|
* fix(lsp): support multiple clients in typehierarchyLewis Russell2024-10-22
|
* feat(lsp)!: support multiple clients in goto methods (#30877)Mathias Fußenegger2024-10-20
| | | | | | | | | | | | | | | Relates to: - https://github.com/neovim/neovim/issues/30034 - https://github.com/neovim/neovim/issues/17712 - https://github.com/neovim/neovim/issues/16363 Closes: - https://github.com/neovim/neovim/issues/26936 (but only provides bufnr and method) - https://github.com/neovim/neovim/issues/22318 Might fix: https://github.com/neovim/neovim/issues/30737
* feat(lsp)!: support multiple clients in lsp.buf.referencesMathias Fussenegger2024-10-20
| | | | | | | Relates to: - https://github.com/neovim/neovim/issues/17712 - https://github.com/neovim/neovim/issues/30034
* perf(validate): use lighter versionLewis Russell2024-10-17
| | | | | - Also fix `vim.validate()` for PUC Lua when showing errors for values that aren't string or number.
* Merge pull request #30825 from lewis6991/refactor/lsputilLewis Russell2024-10-17
|\
| * fix(lsp.util): inconsistent handling of offset_encodingLewis Russell2024-10-17
| |
* | feat(lsp): show server name in code actions #30830Jordan2024-10-17
|/ | | | | | | Problem: If there are multiple LSP clients, it's not clear which actions are provided by which servers. #30710 Solution: Show the server name next to each action (only if there are multiple clients).
* docs(lsp): hover window controls #30347Tristan Knight2024-09-19
|
* fix(lsp): handle empty call hierarchy items #30349James Trew2024-09-13
| | | | | Ensure that the function `pick_call_hierarchy_item` correctly handles the case where `call_hierarchy_items` is nil or an empty table. This prevents potential errors when the function is called with no items.
* fix(lsp): return call hierarchy item, not the index (#30145)Maria José Solano2024-08-26
|
* fix(lsp): avoid reusing diagnostics from different servers in actions (#30002)Grzegorz Rozdzialik2024-08-07
| | | | | | | | | | | | | | | | Problem: When preparing the parameters for a code actions LSP request, the code set `context.diagnostics` when processing the first LSP client, and then reused those `context.diagnostics` for subsequent LSP clients. This meant that the second and next LSP clients got diagnostics that did not originate from them, and they did not get the diagnostics that they sent. Solution: Avoid setting `context.diagnostics` (which is referenced by all clients). Instead, set `params.context.diagnostics` directly, which is specific to a single client. Fixes #30001 Caused by #29501
* fix(lsp): don't send foreign diagnostics to servers in buf.code_action (#29501)Mathias Fußenegger2024-08-01
| | | | | | | `buf.code_action` always included diagnostics on a given line from all clients. Servers should only receive diagnostics they published, and in the exact same format they sent it. Should fix https://github.com/neovim/neovim/issues/29500
* feat(lsp): vim.lsp.buf.format() supports textDocument/rangesFormatting #27323Tom Praschan2024-06-24
| | | | | | | | | | While this relies on a proposed LSP 3.18 feature, it's fully backwards compatible, so IMO there's no harm in adding this already. Looks like some servers already support for this e.g. - gopls: https://go-review.googlesource.com/c/tools/+/510235 - clangd: https://github.com/llvm/llvm-project/pull/80180 Fixes #27293
* refactor: deprecate vim.region() #28416Justin M. Keyes2024-05-28
| | | | | | | Problem: `vim.region()` is redundant with `getregionpos()`. Solution: Deprecate `vim.region()`.
* docs: misc (#28609)dundargoc2024-05-15
| | | | | | | | | | | | Closes https://github.com/neovim/neovim/issues/28484. Closes https://github.com/neovim/neovim/issues/28719. Co-authored-by: Chris <crwebb85@gmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Jake B <16889000+jakethedev@users.noreply.github.com> Co-authored-by: Jonathan Raines <jonathan.s.raines@gmail.com> Co-authored-by: Yi Ming <ofseed@foxmail.com> Co-authored-by: Zane Dufour <zane@znd4.me> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* docs(lsp): document vim.lsp.ListOpts.loclisttom-anders2024-05-07
|
* refactor(lsp): s/options/opts for parameters in vim.lsp.buftom-anders2024-05-07
| | | | See https://github.com/neovim/neovim/pull/28483#discussion_r1583344120
* refactor(lsp): merge subtypes and supertypes into typehierarchy (#28467)Mathias Fußenegger2024-04-23
| | | | Both methods had pretty much the same documentation and shared the implementation.
* feat(lsp): add vim.lsp.buf.subtypes(), vim.lsp.buf.supertypes() (#28388)Yinzuo Jiang2024-04-20
| | | | Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com> Co-authored-by: Maria José Solano <majosolano99@gmail.com>
* refactor(lsp): move workspace folder logic into the clientLewis Russell2024-04-02
| | | | | - Changed `reuse_client` to check workspace folders in addition to root_dir.
* fix(lsp): abort callHierarchy on no result (#28102)Marcin Szamotulski2024-03-31
| | | | | | | | The `callHierarchy` function should warn the user when `textDocument/prepareCallHierarchy` didn't resolve an entity and return, rather than calling the `callHierarchy/{incoming,outgoing}Calls` method with an empty object - which is encoded as an empty list (which doesn't respect language server specification for the `callHierarchy/incomingCalls` call).
* feat!: remove deprecated functionsdundargoc2024-03-09
|
* refactor(types): more fixes (2)Lewis Russell2024-03-06
|
* docs: improve/add documentation of Lua typesLewis Russell2024-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* feat(docs): replace lua2dox.luaLewis Russell2024-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The documentation flow (`gen_vimdoc.py`) has several issues: - it's not very versatile - depends on doxygen - doesn't work well with Lua code as it requires an awkward filter script to convert it into pseudo-C. - The intermediate XML files and filters makes it too much like a rube goldberg machine. Solution: Re-implement the flow using Lua, LPEG and treesitter. - `gen_vimdoc.py` is now replaced with `gen_vimdoc.lua` and replicates a portion of the logic. - `lua2dox.lua` is gone! - No more XML files. - Doxygen is now longer used and instead we now use: - LPEG for comment parsing (see `scripts/luacats_grammar.lua` and `scripts/cdoc_grammar.lua`). - LPEG for C parsing (see `scripts/cdoc_parser.lua`) - Lua patterns for Lua parsing (see `scripts/luacats_parser.lua`). - Treesitter for Markdown parsing (see `scripts/text_utils.lua`). - The generated `runtime/doc/*.mpack` files have been removed. - `scripts/gen_eval_files.lua` now instead uses `scripts/cdoc_parser.lua` directly. - Text wrapping is implemented in `scripts/text_utils.lua` and appears to produce more consistent results (the main contributer to the diff of this change).