aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp.lua
Commit message (Collapse)AuthorAge
...
* feat(lsp): handle multiple clients in omnifunc (#24381)Mathias Fußenegger2023-07-19
| | | | | Also fixes https://github.com/neovim/neovim/issues/24369 by adding an extra `vim.schedule` to ensure the `vim.fn.complete` call happens outside of a luv callback
* docs(lua): more improvements (#24387)Lewis Russell2023-07-18
| | | | | | | | | | | | | | | | | * docs(lua): teach lua2dox how to table * docs(lua): teach gen_vimdoc.py about local functions No more need to mark local functions with @private * docs(lua): mention @nodoc and @meta in dev-lua-doc * fixup! Co-authored-by: Justin M. Keyes <justinkz@gmail.com> --------- Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* feat(lsp)!: rename vim.lsp.get_active_clients to get_clients (#24113)Mathias Fußenegger2023-07-17
|
* feat(lsp): map K to hover by default #24331Mathias Fußenegger2023-07-14
| | | Related: https://github.com/neovim/neovim/issues/24252
* feat(lsp): add method filter to get_active_clients (#24319)Mathias Fußenegger2023-07-12
|
* fix(lint): lint warnings #24226Raphael2023-07-10
|
* feat(lsp): move inlay_hint() to vim.lsp (#24130)Mathias Fußenegger2023-06-30
| | | | | | Allows to keep more functions hidden and gives a path forward for further inlay_hint related functions - like applying textEdits. See https://github.com/neovim/neovim/pull/23984#pullrequestreview-1486624668
* Merge #24116 from justinmk/docJustin M. Keyes2023-06-25
|\
| * docs: autocmds, miscJustin M. Keyes2023-06-25
| |
* | build(luarc.json): disable luadoc-miss-see-name #24108Raphael2023-06-23
|/
* feat(lsp): soft deprecate vim.lsp.for_each_buffer_client (#24104)Mathias Fußenegger2023-06-22
| | | | | | | There is no need for two ways to access all clients of a buffer. This doesn't add a `vim.deprecate` call yet, as the function is probably used a lot, but removes it from the documentation and annotates it with `@deprecated`
* test: spellcheck :help (vimdoc) files #24109Justin M. Keyes2023-06-22
| | | | | | | Enforce consistent terminology (defined in `gen_help_html.lua:spell_dict`) for common misspellings. This does not spellcheck English in general (perhaps a future TODO, though it may be noisy).
* perf(lsp): remove grouping logic from lsp.status (#24096)Mathias Fußenegger2023-06-22
| | | | With the title carry-over logic in the `$/progress` handler it's not necessary to group again in vim.lsp.status
* refactor(lsp): report full Nvim version string in clientInfoJustin M. Keyes2023-06-21
|
* fix(lsp): always return boolean in lsp.buf_client_attach (#24077)Sooryakiran Ponnath2023-06-20
| | | Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
* refactor(lsp): extract common execute command functionality (#24065)Mathias Fußenegger2023-06-20
|
* feat(lsp): inlay hints #23984Chinmay Dalal2023-06-19
| | | | | | | | | | | Add automatic refresh and a public interface on top of #23736 * add on_reload, on_detach handlers in `enable()` buf_attach, and LspDetach autocommand in case of manual detach * unify `__buffers` and `hint_cache_by_buf` * use callback bufnr in `on_lines` callback, bufstate: remove __index override * move user-facing functions into vim.lsp.buf, unify enable/disable/toggle Closes #18086
* docs #24061Justin M. Keyes2023-06-19
| | | | | | | | | | | | | | - nvim requires rpc responses in reverse order. https://github.com/neovim/neovim/issues/19932 - NVIM_APPNAME: UIs normally should NOT set this. ref #23520 fix #24050 fix #23660 fix #23353 fix #23337 fix #22213 fix #19161 fix #18088 fix #20693
* fix(lsp): handle stale bufnr on LspRequest autocmd trigger (#24013)Mathias Fußenegger2023-06-13
| | | | | | Fixes a `Invalid buffer id: 123` race when the buffer gets deleted before the callback triggered. Alternative to https://github.com/neovim/neovim/pull/23981
* feat(lsp): add handlers for inlay hints (#23736)Chinmay Dalal2023-06-11
| | | initial support; public API left for a follow-up PR
* fix(lsp): use percentage format on lsp.status (#23971)Raphael2023-06-10
|
* feat(lsp)!: add vim.lsp.status, client.progress and promote ↵Mathias Fußenegger2023-06-09
| | | | | | | | | | | | | | | | | | | | | LspProgressUpdate (#23958) `client.messages` could grow unbounded because the default handler only added new messages, never removing them. A user either had to consume the messages by calling `vim.lsp.util.get_progress_messages` or by manually removing them from `client.messages.progress`. If they didn't do that, using LSP effectively leaked memory. To fix this, this deprecates the `messages` property and instead adds a `progress` ring buffer that only keeps at most 50 messages. In addition it deprecates `vim.lsp.util.get_progress_messages` in favour of a new `vim.lsp.status()` and also promotes the `LspProgressUpdate` user autocmd to a regular autocmd to allow users to pattern match on the progress kind. Also closes https://github.com/neovim/neovim/pull/20327
* fix(lsp): reduce diagnostics and add more types (#23948)Lewis Russell2023-06-07
|
* feat(lua): rename vim.loop -> vim.uv (#22846)Lewis Russell2023-06-03
|
* feat(lsp): set client offset_encoding if server supports positionEncodingGregory Anders2023-06-01
| | | | | | If the server sends the positionEncoding capability in its initialization response, automatically set the client's offset_encoding to use the value provided.
* fix(lsp): add param assert in client_is_stopped (#23857)Raphael2023-06-01
|
* feat(lsp)!: promote LspRequest to a full autocmd and enrich with additional ↵jdrouhard2023-05-30
| | | | | | | | | | | | | | | | | | | | | data (#23694) BREAKING CHANGE: LspRequest is no longer a User autocmd but is now a first class citizen. LspRequest as a User autocmd had limited functionality. Namely, the only thing you could do was use the notification to do a lookup on all the clients' requests tables to figure out what changed. Promoting the autocmd to a full autocmd lets us set the buffer the request was initiated on (so people can set buffer-local autocmds for listening to these events). Additionally, when used from Lua, we can pass additional metadata about the request along with the notification, including the client ID, the request ID, and the actual request object stored on the client's requests table. Users can now listen for these events and act on them proactively instead of polling all of the requests tables and looking for changes.
* feat(lsp): initial support for dynamic capabilities (#23681)Folke Lemaitre2023-05-28
| | | | | | | | | | | | - `client.dynamic_capabilities` is an object that tracks client register/unregister - `client.supports_method` will additionally check if a dynamic capability supports the method, taking document filters into account. But only if the client enabled `dynamicRegistration` for the capability - updated the default client capabilities to include dynamicRegistration for: - formatting - rangeFormatting - hover - codeAction - hover - rename
* refactor(options): deprecate nvim[_buf|_win]_[gs]et_optionLewis Russell2023-05-21
| | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
* docs: small fixesdundargoc2023-05-13
| | | | | | | | | Co-authored-by: Christian Clason <c.clason@uni-graz.at> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: HiPhish <hiphish@posteo.de> Co-authored-by: Julio B <julio.bacel@gmail.com> Co-authored-by: T727 <74924917+T-727@users.noreply.github.com> Co-authored-by: camoz <camoz@users.noreply.github.com> Co-authored-by: champignoom <66909116+champignoom@users.noreply.github.com>
* docs(lsp): fix `config.cmd` argument for `vim.lsp.start_client` (#23560)hituzi no sippo2023-05-09
|
* docs(lsp): fix type of `config.cmd` argument for `vim.lsp.start_client` (#23550)hituzi no sippo2023-05-09
|
* feat(lua): vim.tbl_contains supports general tables and predicates (#23040)Christian Clason2023-04-14
| | | | | | | | | | | | * feat(lua): vim.tbl_contains supports general tables and predicates Problem: `vim.tbl_contains` only works for list-like tables (integer keys without gaps) and primitive values (in particular, not for nested tables). Solution: Rename `vim.tbl_contains` to `vim.list_contains` and add new `vim.tbl_contains` that works for general tables and optionally allows `value` to be a predicate function that is checked for every key.
* refactor: remove modelines from Lua filesGregory Anders2023-04-13
| | | | Now that we have builtin EditorConfig support and a formatting check in CI, these are not necessary.
* refactor(lsp): do not parse verbose output when overwriting options (#22810)Michal Liszcz2023-04-05
|
* fix(lsp): avoid switching buffers on lsp attach (#22689)August Masquelier2023-03-17
|
* docs(lsp): more precise type annotations (#22621)Jaehwang Jung2023-03-11
|
* fix(lsp): send didClose on buffer rename (#22623)Mathias Fußenegger2023-03-11
| | | | | | | Subset of https://github.com/neovim/neovim/pull/22407 that was reverted in https://github.com/neovim/neovim/pull/22604 If a buffer is renamed sending `didClose` for the old buffer helps ensure the language server doesn't keep a stale document in memory.
* revert: "fix(lsp): use buffer scheme for files not stored on disk" (#22604)Mathias Fußenegger2023-03-11
| | | | | | | | | | | Although using `buffer://` for unsaved file buffers fixes issues with language servers like eclipse.jdt.ls or ansible-language-server, it breaks completion and signature help for clangd. A regression is worse than a fix for something else, so this reverts commit 896d672736b32a8f4a4fa51844b44f266dcdcc6c. The spec change is also still in dicussion, see https://github.com/microsoft/language-server-protocol/pull/1679#discussion_r1130704886
* docs(lsp): type annotation for lsp.client (#22509)Jaehwang Jung2023-03-09
| | | | | | * Also fix newly found type mismatch. * Note that it generates new warnings about using @private client methods. A proper fix would be to revamp the lsp client documentation altogether.
* feat(lsp): overwrite omnifunc/tagfunc set by ftplugin #22267Michal Liszcz2023-03-09
| | | | | | | | | | | | | | | | | Problem: Some built-in ftplugins set omnifunc/tagfunc/formatexpr which causes lsp.lua:set_defaults() to skip setup of defaults for those filetypes. For example the C++ ftplugin has: omnifunc=ccomplete#Complete Last set from /usr/share/nvim/runtime/ftplugin/c.vim line 30 so the changes done in #95c65a6b221fe6e1cf91e8322e7d7571dc511a71 will always be skipped for C++ files. Solution: Overwrite omnifunc/tagfunc/formatexpr options that were set by stock ftplugin. Fixes #21001
* docs(lsp): change type annotations from number → integer (#22510)Jaehwang Jung2023-03-07
|
* fix(lsp): only fire LspDetach for attached buffers (#22468)Gregory Anders2023-03-01
| | | | | | | | | | If the LSP server fails to start then the client never initializes and thus never calls its on_attach function and an LspAttach event is never fired. However, the on_exit function still fires a LspDetach event, so user autocommands that attempt to "clean up" in LspDetach may run into problems if they assume that the buffer was already attached. The solution is to only fire an LspDetach event if the buffer was already attached in the first place.
* fix(lsp): use buffer scheme for files not stored on disk (#22407)Mathias Fußenegger2023-03-01
| | | | | | Sending `didOpen` with a `file` scheme causes problems with some language servers because they expect the file to exist on disk. See https://github.com/microsoft/language-server-protocol/pull/1679
* fix(lsp): callHierarchy methods also require the callHierarchyProvider (#22427)Jens Claes2023-03-01
|
* docs(lsp): update cmd_env description (#22438)Mike2023-02-27
|
* fix(lsp): fix some type annotations (#22397)Mathias Fußenegger2023-02-25
|
* refactor(lsp): remove deprecated code (#22389)Raphael2023-02-24
|
* fix(lsp): wrong format of bufnr and client order in error message (#22336)Jason Hansen2023-02-21
|
* doc(lsp): format arguments to start_client() (#21980)Lewis Russell2023-01-24
| | | docs(lsp): format arguments to start_client()