aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp
Commit message (Collapse)AuthorAge
* 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).
* refactor(lsp): simplify client trackingLewis Russell2024-03-25
| | | | | | | | | | | - Remove: - uninitialized_clients - active_clients - all_buffer_active_clients - Add: - all_clients - Use `lsp.get_clients()` to get buffer clients.
* fix(test): typingLewis Russell2024-03-25
|
* Revert "refactor(lsp): simplify client tracking"Lewis Russell2024-03-25
| | | | This reverts commit 3f238b39cfdf27657b2d9452c6ffd28f8209c95f.
* refactor(lsp): simplify client trackingLewis Russell2024-03-25
| | | | | | | | | | | - Remove: - uninitialized_clients - active_clients - all_buffer_active_clients - Add: - all_clients - Use `lsp.get_clients()` to get buffer clients.
* fix(lsp): handle stale bufnr on LspRequest autocmd trigger (#27981)Jaehwang Jung2024-03-22
| | | continuation of https://github.com/neovim/neovim/pull/24013
* fix(lsp): create codelens request parameters for each buffer (#27699)Takuya Tokuda2024-03-17
|
* docs: small fixes (#27364)dundargoc2024-03-12
| | | | | | | | Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com> Co-authored-by: Ynda Jas <yndajas@gmail.com> Co-authored-by: Owen Hines <TheOdd@users.noreply.github.com> Co-authored-by: Wanten <41904684+WantenMN@users.noreply.github.com> Co-authored-by: lukasvrenner <118417051+lukasvrenner@users.noreply.github.com> Co-authored-by: cuinix <915115094@qq.com>
* docs: support inline markdownLewis Russell2024-03-09
| | | | | | - Tags are now created with `[tag]()` - References are now created with `[tag]` - Code spans are no longer wrapped
* feat!: remove deprecated functionsdundargoc2024-03-09
|
* feat(lua): deprecate vim.tbl_add_reverse_lookupMaria José Solano2024-03-07
|
* docs(lsp): nits and typos in client.luaMaria José Solano2024-03-06
|
* refactor(types): more fixes (2)Lewis Russell2024-03-06
|
* fix(lsp): actually send diagnostic-tags back to the serverLewis Russell2024-03-06
| | | | Fixes #27318
* docs(lua): improvements for LSP and DiagnosticLewis Russell2024-03-05
|
* fix(lsp): directly rename the existing buffers when renaming (#27690)Jaehwang Jung2024-03-02
| | | | | | | | | | | | | | | | Problem: `vim.lsp.util.rename()` deletes the buffers that are affected by renaming. This has undesireable side effects. For example, when renaming a directory, all buffers under that directory are deleted and windows displaying those buffers are closed. Also, buffer options may change after renaming. Solution: Rename the buffers with :saveas. An alternative approach is to record all the relevant states and restore it after renaming, but that seems to be more complex. In fact, the older version was attempting to restore the states but only partially and incorrectly.
* fix(lsp): defer writing error msgs (#27688)Jaehwang Jung2024-03-02
| | | | | | | | | | | | | Context: Nvim catches errors from the user's `on_exit` and rpc handler callbacks and prints the error message. Problem: Printing the error message uses Nvim api functions. But callbacks mentioned above run in `:h lua-loop-callbacks` where most of `vim.api` is not allowed, so Nvim itself raises error. Solution: `vim.schedule()` the error reporting when necessary.
* Merge pull request #27347 from lewis6991/fswatchLewis Russell2024-03-01
|\ | | | | feat(lsp): add fswatch watchfunc backend
| * feat(lsp): add fswatch watchfunc backendLewis Russell2024-03-01
| | | | | | | | | | | | | | | | | | | | | | Problem: vim._watch.watchdirs has terrible performance. Solution: - On linux use fswatch as a watcher backend if available. - Add File watcher section to health:vim.lsp. Warn if watchfunc is libuv-poll.
| * fix(lsp): cancel watchers when closing a clientLewis Russell2024-03-01
| |
| * refactor(watch): general tidy upLewis Russell2024-03-01
| | | | | | | | | | | | - Rename watch.poll to watch.watchdirs - Unify how include and exclude is applied - Improve type hints
* | 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.
* fix(lsp): rename undofile when renaming (#27684)Jaehwang Jung2024-03-01
| | | | | | | Problem: After `rename()`, the undo information for the renamed file(s) are lost. Solution: Rename the undofile as well.
* fix(lsp): use plain loop for non-list-like table of protocol valuesChristian Clason2024-02-29
| | | | | | Fixup for #27628 Closes #27669
* fix(lsp): handle reverse lookup in capabilitiesMaria José Solano2024-02-28
|
* refactor(lsp): remove outdated commentMaria José Solano2024-02-28
|
* fix(lsp): correct the error message's cmd on spawning (#27632)notomo2024-02-28
|
* fix(lsp): remove unnecessary file load/write when renaming (#27621)Jaehwang Jung2024-02-28
| | | | | | | | | Previously rename would unconditionally read the to-be-renamed file from the disk and write it to the disk. This is redundant in some cases If the file is not already loaded, it's not attached to lsp client, so nvim doesn't need to care about this file. If the file is loaded but has no change, it doesn't need to be written.
* feat(lsp): support completion itemDefaultsMaria José Solano2024-02-27
|
* refactor(lsp): alias for CompletionResultMaria José Solano2024-02-27
|
* 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).
* fix(lsp): add assertion for explicit bufnr in apply_text_edits (#27614)Gregory Anders2024-02-24
| | | | | Assert that the buffer number passed to apply_text_edits is fully resolved (not 0 or null). Pass the known buffer number to apply_text_edits from lsp.formatexpr().
* fix(lsp): when renaming directory, check path prefix of buffer names (#27603)Jaehwang Jung2024-02-24
| | | | | For example, when renaming /path/to/dir, buffers like fern://drawer/file:///path/to/dir, /path/to/dir123 should not be matched.
* docs(lsp): mark `ClientConfig.init_options` as optionalChristian Clason2024-02-24
| | | | Followup to neovim/neovim#27443
* refactor(lsp): remove redundant code (#27601)Jaehwang Jung2024-02-24
| | | | * use builtin function * buffer:// was removed in 236c20795eb9f11e21e0719b735ea741711acc08.
* fix(lsp): add parentheses to generated union array types (#27560)Maria José Solano2024-02-21
|
* refactor(lsp): typings for protocol constantsMaria José Solano2024-02-19
|
* fix(lsp): rename: load and list new buffer if attached to window (#27408)Tomasz N2024-02-14
|
* refactor(lsp): resolve the config-client entanglementLewis Russell2024-02-13
| | | | | | | | | | | | | | | | | | | | | Previously the LSP-Client object contained some fields that are also in the client config, but for a lot of other fields, the config was used directly making the two objects vaguely entangled with either not having a clear role. Now the config object is treated purely as config (read-only) from the client, and any fields the client needs from the config are now copied in as additional fields. This means: - the config object is no longet normalised and is left as the user provided it. - the client only reads the config on creation of the client and all other implementations now read the clients version of the fields. In addition, internal support for multiple callbacks has been added to the client so the client tracking logic (done in lua.lsp) can be done more robustly instead of wrapping the user callbacks which may error.
* fix(lsp): re-add client.commands and mark privateLewis Russell2024-02-12
|
* fix(lsp): semantic token defer loadingLewis Russell2024-02-12
| | | | Fixes #27424
* refactor(lsp): move more code to client.luaLewis Russell2024-02-11
| | | | | | | | | | | | The dispatchers used by the RPC client should be defined in the client, so they have been moved there. Due to this, it also made sense to move all code related to client configuration and the creation of the RPC client there too. Now vim.lsp.start_client is significantly simplified and now mostly contains logic for tracking open clients. - Renamed client.new -> client.start
* Merge pull request #27420 from MariaSolOs/warning-anxietyLewis Russell2024-02-11
|\ | | | | refactor(lsp): fix type annotations and add shared diagnostic helper
| * refactor(lsp): add vim.lsp.sync.Range typeMaria José Solano2024-02-10
| |
| * refactor(lsp): add shared diagnostic handlerMaria José Solano2024-02-10
| |
| * refactor(lsp): add type annotationsMaria José Solano2024-02-10
| |
* | feat(lsp): add opts paramater to vim.lsp.codelens.refreshMaria José Solano2024-02-08
|/
* fix(lsp): rename fails on missing parent directory #27291Tomasz N2024-02-08
| | | | | | | | Problem: If a rename results in a path that has missing parent directory(s), it will fail. Solution: Do a recursive mkdir before attempting the rename.
* feat(lsp): deprecate severity_limitLewis Russell2024-02-08
| | | | | | | | | | | Problem: `vim.lsp.diagnostic.on_diagnostic` accepts an undocumented severity_limit option which is widely used. Solution: Deprecate it in favour of `{min = severity}` used in `vim.diagnostic`. Since this is undocumented, the schedule for removal is accelerated to 0.11.
* refactor(lsp): tidy up loggingLewis Russell2024-02-08
|