aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp
Commit message (Collapse)AuthorAge
...
* fix(lsp): fix reverse sorting of same position text edits (#29212)Al Colmenar2024-06-07
| | | | | | | | Problem: Text edits with the same position (both line and character) were being reverse sorted prior to being applied which differs from the lsp spec Solution: Change the sort order for just the same position edits
* fix(lsp): revert buf_versions deprecation/replacement (#29217)Mathias Fußenegger2024-06-07
| | | | | | | | | * Revert "fix(lsp): account for changedtick version gap on modified reset (#29170)" This reverts commit 2e6d295f799c27372e5c0c44727fa613c81717fd. * Revert "refactor(lsp): replace util.buf_versions with changedtick (#28943)" This reverts commit 5c33815448e11b514678f39cecc74e68131d4628.
* fix(lsp): remove superfluous on_detach callback from semantic tokens module ↵jdrouhard2024-06-04
| | | | | | | | | | | | (#29174) LspDetach is now triggered by the main on_detach callback that is added when an LSP client is attached to a buffer. The semantic_tokens module already includes a LspDetach handler that does the right thing. When the LspDetach trigger was added to the main LSP on_detach, it created a race condition in semantic tokens when a buffer was deleted that would trigger both its own on_detach and the LspDetach handlers. If the former came last, an error was thrown trying to delete a non-existent augroup (destroy() was being called twice).
* fix(lsp): account for changedtick version gap on modified reset (#29170)Mathias Fußenegger2024-06-04
| | | | Follow up to https://github.com/neovim/neovim/pull/28943 Fixes https://github.com/neovim/neovim/issues/29163
* refactor(lua): use tuple syntax everywhere #29111Ilia Choly2024-06-04
|
* fix(lsp): use client.id instead of pairs index (#29143)ippachi2024-06-03
| | | | | | | Problem: Completion side effects not working randomly. Solution: When creating the table of LSP responses, the table index was used, but this is not the same as the actual client_id, so it was changed to use the client_id directly.
* fix(lsp): trim trailing whitespace from completion words (#29122)Mathias Fußenegger2024-06-02
| | | | | the `complete()` mechanism doesn't play nicely with trailing newlines or tabs. A newline causes it to insert a null character, showing up as `^@`.
* perf(lsp): avoid repeated table lookup in completion.enableMathias Fussenegger2024-06-01
|
* refactor(lsp): share completion request logic between omnifunc & triggerMathias Fussenegger2024-06-01
|
* perf(lsp): don't copy completion items in filter passMathias Fussenegger2024-06-01
|
* refactor(lsp): use tuple syntax in generated protocol types (#29110)Ilia Choly2024-05-31
|
* refactor(lsp): use predefined types in util function signatures (#29095)Ilia Choly2024-05-31
|
* refactor(lsp): replace util.buf_versions with changedtick (#28943)Mathias Fußenegger2024-05-30
| | | | | | | `lsp.util.buf_versions` was already derived from changedtick (`on_lines` from `buf_attach` synced the version) As far as I can tell there is no need to keep track of the state in a separate table.
* feat(lsp): support postfix snippets in completionMathias Fussenegger2024-05-30
|
* feat(lsp): use fuzzy match on filterText instead of prefix matchMathias Fussenegger2024-05-30
| | | | | | | | The `complete()` mechanism matches completion candidates against the typed text, so strict pre-filtering isn't necessary. This is a first step towards supporting postfix snippets (like `items@insert` in luals)
* Merge pull request #27339 from MariaSolOs/completionGregory Anders2024-05-28
|\ | | | | feat(lsp): completion side effects
| * feat(lsp): completion side effectsMaria José Solano2024-05-27
| |
* | refactor: deprecate vim.region() #28416Justin M. Keyes2024-05-28
| | | | | | | | | | | | | | Problem: `vim.region()` is redundant with `getregionpos()`. Solution: Deprecate `vim.region()`.
* | refactor: fix luals type warningsdundargoc2024-05-27
| |
* | fix(lsp): handle nil root_dir in health check (#29007)Mathias Fußenegger2024-05-25
| | | | | | | | | | | | | | The root directory could show up as something like: Root directory: ~/path/to/cwd/v:null Despite being `nil`
* | feat(lsp): update LSP healthcheck format (#28980)Gregory Anders2024-05-24
|/ | | | | | This is mostly an aesthetic change, although there are a few new pieces of information included. Originally I wanted to investigate including server capabilities in the healthcheck, but until we have the ability to fold/unfold text in health checks that would be too much information.
* fix(lsp): check if buffer was detached in on_init callback (#28914)Ilia Choly2024-05-23
| | | Co-authored-by: Jongwook Choi <wookayin@gmail.com>
* refactor(lsp): use supports_method where applicableIlia Choly2024-05-22
|
* fix(lsp): semantic token functions allow "0" bufnr #28849Riley Bruins2024-05-21
| | | aligns with ":help dev-patterns"
* fix(lsp): hide layout in codelenses in virtual text (#28794) (#28807)Mango The Fourth2024-05-21
| | | | | | | Problem: layout i.e. whitespace that is part of codelenses is currently displayed as weird symbols and large amounts of spaces Solution: replace all consecutive whitespace symbols with a single space character when trying to display codelenses as virtual text
* feat: remove deprecated featuresdundargoc2024-05-16
| | | | | | | | | | | | | | | | | | | Remove following functions: - vim.lsp.util.extract_completion_items - vim.lsp.util.get_progress_messages - vim.lsp.util.parse_snippet() - vim.lsp.util.text_document_completion_list_to_complete_items - LanguageTree:for_each_child - health#report_error - health#report_info - health#report_ok - health#report_start - health#report_warn - vim.health.report_error - vim.health.report_info - vim.health.report_ok - vim.health.report_start - vim.health.report_warn
* docs: newsJustin M. Keyes2024-05-15
| | | | Set dev_xx.txt help files to use "flow" layout.
* 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>
* fix(health): clients may not support watchfiles #28710Maria José Solano2024-05-14
|
* feat(lsp): update LSP protocol 3.18 typings to date (#28730)Jongwook Choi2024-05-14
| | | | Make the LSP protocol typings up-to-date with LSP protocol (upcoming) version 3.18, before and in preparation for the Nvim 0.10.0 release.
* refactor(lua): remove deprecated features #28725Justin M. Keyes2024-05-13
|
* fix(lsp): disable didChangeWatchedFiles on LinuxLewis Russell2024-05-10
| | | | | | | | | | | | | Problem: The file watcher backends for Linux have too many limitations and doesn't work reliably. Solution: disable didChangeWatchedFiles on Linux Ref: #27807, #28058, #23291, #26520
* Merge #28637 more support for vim.lsp.ListOpts.loclistJustin M. Keyes2024-05-07
|\
| * feat(lsp): support vim.lsp.ListOpts.loclist in location_handler()tom-anders2024-05-07
| |
| * docs(lsp): document vim.lsp.ListOpts.loclisttom-anders2024-05-07
| |
| * refactor(lsp): use vim.cmd instead of api.nvim_commandtom-anders2024-05-07
| | | | | | | | | | | | As suggested in https://github.com/neovim/neovim/pull/28483#discussion_r1586878457 and https://github.com/neovim/neovim/pull/28483#discussion_r1586878226
| * docs(lsp): fix type annotations in response_to_list(...)tom-anders2024-05-07
| |
| * refactor(lsp): move repeated table construction into a variabletom-anders2024-05-07
| | | | | | | | As suggested in https://github.com/neovim/neovim/pull/28483#discussion_r1581712828
| * refactor(lsp): use vim.is_callable()tom-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
* | fix(lsp): rename LspProgress data.result => data.params #28632Jongwook Choi2024-05-07
|/ | | | | | | | | | | | Rename the field `result` to `params` in the `data` table for `LspProgress` autocmds. This aligns with LspNotify. The previous name was chosen because the initial handler implementation mistakenly had a parameter name `result` instead of `params` for the `$/progress` LSP "notification" handler. However, `params` would be a more appropriate name that is more consistent with the underlying LSP type (`ProgressParams`). See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#progress
* fix(lsp): enable() does not activate inlay hints on open buffers #28629Yi Ming2024-05-07
| | | | | | | | | | | Problem: inlay_hint `enable(<no args>)` does not activate inlay hints on open buffers. If a buffer does not have a corresponding `bufstate` in `bufstates`, then `enable` all buffers will not take effect on it. Solution: Make the effective range determined by the loaded buffers. Fix #28624
* fix(lsp): replace bug-prone ternary operation #28627Yi Ming2024-05-03
| | | ref #28624
* fix(vim.ui)!: change open() to return `result|nil, errmsg|nil` #28612Justin M. Keyes2024-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | reverts e0d92b9cc20b58179599f53dfa74ca821935a539 #28502 Problem: `vim.ui.open()` has a `pcall()` like signature, under the assumption that this is the Lua idiom for returning result-or-error. However, the `result|nil, errmsg|nil` pattern: - has precedent in: - `io.open` - `vim.uv` (`:help luv-error-handling`) - has these advantages: - Can be used with `assert()`: ``` local result, err = assert(foobar()) ``` - Allows LuaLS to infer the type of `result`: ``` local result, err = foobar() if err then ... elseif result then ... end ``` Solution: - Revert to the `result|nil, errmsg|nil` pattern. - Document the pattern in our guidelines.
* Merge #28101 nvim__redrawJustin M. Keyes2024-05-02
|\
| * feat(api): add nvim__redraw for more granular redrawingLuuk van Baal2024-05-02
| | | | | | | | | | | | | | | | | | | | | | Experimental and subject to future changes. Add a way to redraw certain elements that are not redrawn while Nvim is waiting for input, or currently have no API to do so. This API covers all that can be done with the :redraw* commands, in addition to the following new features: - Immediately move the cursor to a (non-current) window. - Target a specific window or buffer to mark for redraw. - Mark a buffer range for redraw (replaces nvim__buf_redraw_range()). - Redraw the 'statuscolumn'.
* | feat(lsp): inlay_hint.is_enabled({filter}) #28523Yi Ming2024-05-02
|/ | | vim.diagnostic.enable and vim.diagnostic.is_enabled() use the same pattern.
* feat(lsp): vim.lsp.inlay_hint.enable(nil) applies to all buffers #28543Yi Ming2024-05-02
| | | | | | | | | | | | | | | | | | Problem: Inlay hints `enable()` does not fully implement the `:help dev-lua` guidelines: Interface conventions ~ - When accepting a buffer id, etc., 0 means "current buffer", nil means "all buffers". Likewise for window id, tabpage id, etc. - Examples: |vim.lsp.codelens.clear()| |vim.diagnostic.enable()| Solution: Implement globally enabling inlay hints. * refactor(lsp): do not rely on `enable` to create autocmds * refactor(lsp): make `bufstates` a defaulttable * refactor(lsp): make `bufstate` inherit values from `globalstate` * feat(lsp): `vim.lsp.inlay_hints` now take effect on all buffers by default * test(lsp): add basic tests for enable inlay hints for all buffers * test(lsp): add test cases cover more than one buffer
* fix(lsp): add "silent" option to vim.lsp.start (#28478)Gregory Anders2024-04-26
| | | | | | | | | | | | | | | | | | vim.notify cannot be suppressed and it is not always necessary to display a visible warning to the user if the RPC process fails to start. For instance, a user may have the same LSP configuration across systems, some of which may not have all of the LSP server executables installed. In that case, the user receives a notification every time a file is opened that they cannot suppress. Instead of using vim.notify in vim.lsp.rpc, propagate a normal error up through the call stack and use vim.notify in vim.lsp.start() only if the "silent" option is not set. This also updates lsp.start_client() to return an error message as its second return value if an error occurred, rather than calling vim.notify directly. Callers of lsp.start_client() will need to update call sites appropriately if they wish to report errors to the user (or even better, switch to vim.lsp.start).
* refactor(lsp): rename foos_by_bar to bar_foos #28505Yi Ming2024-04-26
|