summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/lsp/protocol.lua
AgeCommit message (Collapse)AuthorFiles
2024-11-25fix(lsp): retrigger diagnostics request on server cancellation (#31345)Gregory Anders1
Co-authored-by: Jesse <github@jessebakker.com>
2024-11-14feat(lsp): support utf-8 and utf-32 position encodingsLewis Russell1
Resolves #30034
2024-11-01feat(lsp)!: remove client-server handlers from vim.lsp.handlersLewis Russell1
- 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).
2024-10-24fix(lsp.protocal): improve typing of constantsLewis Russell1
2024-10-04fix(lsp): enable `additionalPropertiesSupport`Yi Ming1
2024-08-20docs(lsp): annotate with `vim.lsp.protocol.Methods` enum #29521Ricardo Casía1
Added the enum type annotation `vim.lsp.protocol.Methods` to provide some intellisense support.
2024-08-03feat(lsp): announce codeLens resolveSupport (#29956)Mathias Fußenegger1
The codelens implementation can resolve command via `codeLens/resolve`. The spec added client capabilities for that: https://github.com/microsoft/language-server-protocol/pull/1979
2024-07-31feat(lsp): lsp.completion support set deprecated (#29882)glepnir1
Problem: CompletionItem in lsp spec mentioned the deprecated attribute Solution: when item has deprecated attribute set hl_group to DiagnosticDeprecated in complete function
2024-06-24feat(lsp): vim.lsp.buf.format() supports textDocument/rangesFormatting #27323Tom Praschan1
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
2024-06-11refactor(lua): improve type annotationsLewis Russell1
2024-05-27feat(lsp): completion side effectsMaria José Solano1
2024-05-10fix(lsp): disable didChangeWatchedFiles on LinuxLewis Russell1
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
2024-03-07feat(lua): deprecate vim.tbl_add_reverse_lookupMaria José Solano1
2024-02-29fix(lsp): use plain loop for non-list-like table of protocol valuesChristian Clason1
Fixup for #27628 Closes #27669
2024-02-28fix(lsp): handle reverse lookup in capabilitiesMaria José Solano1
2024-02-28refactor(lsp): remove outdated commentMaria José Solano1
2024-02-27feat(lsp): support completion itemDefaultsMaria José Solano1
2024-02-19refactor(lsp): typings for protocol constantsMaria José Solano1
2024-01-03feat(lua): add noref to deepcopyLewis Russell1
Problem: Currently `deepcopy` hashes every single tables it copies so it can be reused. For tables of mostly unique items that are non recursive, this hashing is unnecessarily expensive Solution: Port the `noref` argument from Vimscripts `deepcopy()`. The below benchmark demonstrates the results for two extreme cases of tables of different sizes. One table that uses the same table lots of times and one with all unique tables. | test | `noref=false` (ms) | `noref=true` (ms) | | -------------------- | ------------------ | ----------------- | | unique tables (50) | 6.59 | 2.62 | | shared tables (50) | 3.24 | 6.40 | | unique tables (2000) | 23381.48 | 2884.53 | | shared tables (2000) | 3505.54 | 14038.80 | The results are basically the inverse of each other where `noref` is much more performance on tables with unique fields, and `not noref` is more performant on tables that reuse fields.
2023-12-27docs(gen_lsp.lua): re-generate vim.lsp._meta.protocol type annotationsJongwook Choi1
The purpose of this commit is to make diff clean and easy to read; to see the diff resulted from actual changes in gen_lsp.lua, not from the updated LSP protocol JSON data. Ran: `nvim -l scripts/gen_lsp.lua gen --methods` Based on 3.18.0 (2023-12-23)
2023-12-14feat(lsp): more annotationsLewis Russell1
2023-11-13fix(lsp): advertise workspace.didChangeConfiguration capability (#26028)Chris Simon1
This ensures workspace/didChangeConfiguration notification sent after init is correctly handled
2023-11-12feat(lsp)!: vim.lsp.inlay_hint.get(), enable(), is_enabled() #25512LW1
refactor!: `vim.lsp.inlay_hint()` -> `vim.lsp.inlay_hint.enable()` Problem: The LSP specification allows inlay hints to include tooltips, clickable label parts, and code actions; but Neovim provides no API to query for these. Solution: Add minimal viable extension point from which plugins can query for inlay hints in a range, in order to build functionality on top of. Possible Next Steps --- - Add `virt_text_idx` field to `vim.fn.getmousepos()` return value, for usage in mappings of `<LeftMouse>`, `<C-LeftMouse>`, etc
2023-10-21refactor(lsp): move completion logic into _completion moduleMathias Fussenegger1
To reduce cross-chatter between modules and for https://github.com/neovim/neovim/issues/25272 Also preparing for https://github.com/neovim/neovim/issues/25714
2023-10-21feat(lsp): add snippet API (#25301)Maria José Solano1
2023-08-03fix(gen_lsp.lua): no notifications in lsp.Methods #24530Raphael1
Problem: - Notifications are missing from `lsp.Methods`. - Need a way to represent `$/` prefixed methods. Solution: - Generate notifications. - Use "dollar_" prefix for `$/` methods.
2023-08-01feat(gen_lsp.lua): sort by name, handle failure #24504Justin M. Keyes1
2023-08-01feat(gen_lsp.lua): protocol.Methods #24504mathew1
2023-07-24fix(lsp): announce publishDiagnostics.dataSupport (#24442)Bruce Weirdan1
Neovim already passed `data` element from published diagnostic to code action, but failed to announce it in client capabilities. Here is the test that shows that `data` element is returned by `vim.lsp.diagnostic.get_line_diagnostics()`: https://github.com/neovim/neovim/blob/f56c1848091bb64c63b5bc25ec74bcbd2f52bdde/test/functional/plugin/lsp/diagnostic_spec.lua#L103-L115 and then `get_line_diagnostics()` is used to construct the context for code action request: https://github.com/neovim/neovim/blob/f56c1848091bb64c63b5bc25ec74bcbd2f52bdde/runtime/lua/vim/lsp/buf.lua#L742
2023-07-20feat(lsp): implement textDocument/diagnostic (#24128)Chris AtLee1
2023-07-14fix(lsp): remove unknown LSP protocol property (#24345)Techatrix1
'hierarchicalWorkspaceSymbolSupport' is not part of the LSP Specification
2023-07-01fix(lsp): lint warnings, default offset_encoding #24046Raphael1
- fix lint / analysis warnings - locations_to_items(): get default offset_encoding from active client - character_offset(): get default offset_encoding from active client
2023-06-22feat(lsp): opt-in to dynamicRegistration for inlay hints (#24102)Mathias Fußenegger1
Since https://github.com/neovim/neovim/pull/23681 there is dynamic registration support. We should use that for new features unless there is a good reason to turn it off.
2023-06-11feat(lsp): add handlers for inlay hints (#23736)Chinmay Dalal1
initial support; public API left for a follow-up PR
2023-06-07fix(lsp): reduce diagnostics and add more types (#23948)Lewis Russell1
2023-06-05fix(lsp): use only utf-16 in default client positionEncodings (#23903)Gregory Anders1
The Nvim client does not yet support multiple offset encodings for clients in the same buffer. Until it does, stick to utf-16 by default.
2023-06-01feat(lsp): include positionEncodings in default client capabilitiesGregory Anders1
2023-05-28feat(lsp): initial support for dynamic capabilities (#23681)Folke Lemaitre1
- `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
2023-04-22feat(lsp): enable workspace/didChangeWatchedFiles by default (#23190)Jon Huhn1
2023-04-13refactor: remove modelines from Lua filesGregory Anders1
Now that we have builtin EditorConfig support and a formatting check in CI, these are not necessary.
2023-03-30feat(diagnostic): add support for tagsLewis Russell1
The LSP spec supports two tags that can be added to diagnostics: unnecessary and deprecated. Extend vim.diagnostic to be able to handle these.
2023-03-11refactor(lsp): remove _resolve_capabilities_compat (#22628)Raphael1
2023-03-05feat(lsp): implement workspace/didChangeWatchedFiles (#22405)Jon Huhn1
2023-02-25fix(lsp): fix some type annotations (#22397)Mathias Fußenegger1
2023-02-25Revert "feat(lsp): implement workspace/didChangeWatchedFiles (#21293)"Mathias Fussenegger1
This reverts commit 5732aa706c639b3d775573d91d1139f24624629c. Causes editor to freeze in projects with many watcher registrations
2023-02-25feat(lsp): implement workspace/didChangeWatchedFiles (#21293)Jon Huhn1
2023-01-21feat(lsp): add triggerKind option for vim.lsp.buf.code_action (#21905)kishii1
2023-01-06fix(lsp): correct callHierarchy capability to fix lsp.buf.incoming_calls() ↵1
(#21665) Co-authored-by: maozhongzhou <maozhongzhou@wps.cn>
2022-12-08feat(lsp): initial support for semantic token highlightingJohn Drouhard1
* credit to @smolck and @theHamsta for their contributions in laying the groundwork for this feature and for their work on some of the helper utility functions and tests
2022-12-08feat(lsp): support willSave & willSaveWaitUntil capability (#21315)Mathias Fußenegger1
`willSaveWaitUntil` allows servers to respond with text edits before saving a document. That is used by some language servers to format a document or apply quick fixes like removing unused imports.