aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp
Commit message (Collapse)AuthorAge
...
* fix(handlers): more specific error messages (#16772)kylo2522022-04-30
| | | | Specify which message, or request, was last received in case of an error instead of the same generic message
* chore(lsp): remove capabilities sanitization (#17814)Michael Lingelbach2022-04-30
| | | | | | | | | | | | | | | | * feat(lsp)!: remove capabilities sanitization Users must now access client.server_capabilities which matches the same structure as the protocol. https://microsoft.github.io/language-server-protocol/specification client.resolved_capabilities is no longer used to gate capabilities, and will be removed in a future release. BREAKING CHANGE Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
* feat(lsp): options to filter and auto-apply code actions (#18221)Fredrik Ekre2022-04-30
| | | | | | | | | | | | | | | | | | | Implement two new options to vim.lsp.buf.code_action(): - filter (function): predicate taking an Action as input, and returning a boolean. - apply (boolean): when set to true, and there is just one remaining action (after filtering), the action is applied without user query. These options can, for example, be used to filter out, and automatically apply, the action indicated by the server to be preferred: vim.lsp.buf.code_action({ filter = function(action) return action.isPreferred end, apply = true, }) Fix #17514.
* feat(lsp): show feedback on empty hover response (#18308)Mathias Fußenegger2022-04-29
| | | | Without any feedback it gives the impression that the language server is not working properly, which isn't the case.
* fix(lsp): fix unnecessary buffers being added on empty diagnostics (#18275)ii142022-04-26
| | | | | Some language servers send empty `textDocument/publishDiagnostics` messages after indexing the project with URIs corresponding to unopened buffers. This commit guards against opening buffers corresponding to empty diagnostics.
* fix(lsp): unify progress message handling (#18040)runiq2022-04-20
| | | | | | | | | | | The LSP progress handler would put non-progress messages (such as from clangd or pyls; not part of the LSP spec) directly into `client.messages`, while `vim.lsp.util.get_progress_messages()` would try to fetch them from `client.messages.messages` instead (and come up empty everytime). This would result in these messages never being cleaned up by `get_progress_messages()`. This commit fixes that by treating those messages like show-once progress messages (by setting `done=true` immediately).
* fix(lsp): fix lookup of boolean values in workspace/configuration (#18026)Fredrik Ekre2022-04-15
|
* docs(lsp): remove outdated offset_encoding default value for apply_text_editsAndrea Cappuccio2022-03-30
|
* fix(lsp): use "text" filetype for plaintext (#17898)Jaehwang Jung2022-03-28
|
* fix(lsp): set tabSize from 'shiftwidth', not 'softtabstop' (#17787)Tim Pope2022-03-20
| | | | | | | | | The use of 'softtabstop' to set tabSize was introduced in 5d5b068, replacing 'tabstop'. If we look past the name tabSize and at the actual purpose of the field, it's the indentation width used when formatting. This corresponds to the Vim option 'shiftwidth', not 'softtabstop'. The latter has the comparatively mundane purpose of controlling what happens when you hit the tab key (and even this is incomplete, as it fails to account for 'smarttab').
* fix(lsp): handle insertion of previous line (#17618)Michael Lingelbach2022-03-06
|
* fix(lsp): start incremental sync range at previous newline character (#17610)Michael Lingelbach2022-03-05
| | | This change forces the start of an incremental sync range to begin always on an existing line.
* feat(diagnostic): add "code" to the diagnostic structure (#17510)David Shen2022-03-02
|
* fix(lsp): respect all of 'fixeol', 'eol', and 'binary' applying edits (#17574)Tim Pope2022-03-02
|
* refactor(highlight)!: optional arguments for highlight.range as table (#17462)Christian Clason2022-02-21
| | | | | | | | | also update documentation BREAKING CHANGE: signature of highlight.range is now vim.highlight.range(bufnr, ns, hlgroup, start, finish, { regtype = regtype, inclusive = inclusive, priority = priority }) Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
* fix(lsp): use botright copen for all handlers (#17471)Michael Lingelbach2022-02-20
|
* fix: lsp and diagnostic highlight priority (#17461)Michael Lingelbach2022-02-19
| | | | | | | | | Closes https://github.com/neovim/neovim/issues/17456 * treesitter uses the default highlight priority of 50 * diagnostic highlights have a priority of 150 * lsp reference highlights have a priority of 200 This ensures proper ordering.
* docs(lsp): fix on_publish_diagnostics example (#17146)xnmet2022-01-21
|
* feat(lsp): add handler for workspace/workspaceFolders (#17149)Michael Lingelbach2022-01-21
|
* fix(lsp): avoid nil workspace/symbol query (#17107)Daniel Steinberg2022-01-15
|
* fix(lsp): fetch offset_encoding from client in references (#17104)Michael Lingelbach2022-01-15
|
* feat: use nvim_buf_set_extmark for vim.highlight (#16963)Michael Lingelbach2022-01-15
| | | | | | | | | Closes https://github.com/neovim/neovim/issues/13647 This allows customizing the priority of the highlights. * Add default priority of 50 * Use priority of 200 for highlight on yank * use priority of 40 for highlight references (LSP)
* feat(lsp): dynamically generate list title in response_to_list (#17081)Gregory Anders2022-01-14
| | | | | | | | | | | | | | | | This gives quickfix/location lists created by handlers which use 'response_to_list' (textDocument/documentSymbols and workspace/symbol by default) the ability to set a more useful list title. This commit gives lists created for documentSymbols a title of the form: Symbols in <filename> and lists for workspace/symbol a title of the form: Symbols matching '<query>' These are more informative than a standard "Language Server" list title and can help disambiguate results when users have multiple quickfix lists that they cycle through with `:colder` and `:cnewer`.
* fix(lsp): always split text edits on \r, \r\n, and \n (#17087)Michael Lingelbach2022-01-14
| | | | | | | | | | Closes: https://github.com/neovim/neovim/issues/17053 Servers can return a mix of line endings per the language server protocol. See: https://microsoft.github.io/language-server-protocol/specification.html#textDocuments All should be equally treated as line endings.
* fix(lsp): forward offset_encoding in rename handler (#17079)Michael Lingelbach2022-01-13
|
* fix(lsp): forward offset_encoding to apply_text_edits (#17075)Michael Lingelbach2022-01-13
|
* fix(lsp): strictly enforce passing offset encoding (#17049)Michael Lingelbach2022-01-13
| | | | | | | | | | This removes the "fallback" to utf-16 in many of our helper functions. We should always explicitly pass these around when possible except in two locations: * generating params with help utilities called by buf.lua functions * the buf.lua functions themselves Anything that is called by the handler should be passed the offset encoding.
* fix(lsp): handle negative activeSignature in signatureHelp (#17064)Mathias Fußenegger2022-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | omnisharp-roslyn can send negative values: { activeParameter = 0, activeSignature = -1, signatures = { { documentation = "", label = "TestEntity.TestEntity()", parameters = {} } } } In 3.16 of the specification `activeSignature` is defined as `uinteger` and therefore negative values shouldn't be allowed, but within 3.15 it was defined as `number` which makes me think we can be a bit lenient in this case and handle them. The expected behavior is quite clear: The active signature. If omitted or the value lies outside the range of `signatures` the value defaults to zero or is ignored if the `SignatureHelp` has no signatures. Fixes an error: util.lua:1685: attempt to get length of local 'lines' (a nil value) util.lua:1685: in function 'trim_empty_lines' handlers.lua:334: in function 'textDocument/signatureHelp'
* fix(lsp): fix applying multiple out-of-range TextEdits (#17037)hrsh7th2022-01-13
|
* fix(lsp): only send valid params in executeCommand (#16987)Michael Lingelbach2022-01-08
|
* fix(lsp): resolve bufnr for get_lines (#16986)Michael Lingelbach2022-01-08
| | | | | | | Closes https://github.com/neovim/neovim/issues/16985 * get_lines checks if buf_loaded using bufnr 0, which is typically used as a sentinel value, but here must be resolved to the true bufnr
* feat(lua): add notify_once() (#16956)Gregory Anders2022-01-06
| | | Like vim.notify(), but only displays the notification once.
* chore: fix typos (#16816)dundargoc2022-01-04
| | | | | | | Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Sebastian Volland <seb@baunz.net> Co-authored-by: Lewis Russell <lewis6991@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(lsp): suppress ContentModified errors from UI (#16904)Sam McCall2022-01-04
| | | | | | | | | Fixes https://github.com/neovim/neovim/issues/16900 If clients receive a ContentModified error, it generally should not show it in the UI for the end-user. Clients can resend the request if they know how to do so. https://microsoft.github.io/language-server-protocol/specifications/specification-current/#implementationConsiderations
* fix(lsp): resolve nil bufnr (#16902)Gregory Anders2022-01-03
| | | Related: #16889, #16745
* fix: resolve nil arguments to API functions (#16889)Gregory Anders2022-01-03
| | | | | | As revealed by #16745, some functions pass a nil value to API functions, which have been implicitly converted to 0. #16745 breaks this implicit conversion, so explicitly pass a resolved buffer number to these API functions.
* fix(lsp): always use target bufnr in location handler (#16876)Michael Lingelbach2022-01-02
|
* chore: fix typos (#16506)dundargoc2021-12-28
| | | | | | | | | Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com> Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Christoph Hasse <hassec@users.noreply.github.com> Co-authored-by: Alef Pereira <ealefpereira@gmail.com> Co-authored-by: AusCyber <willp@outlook.com.au> Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
* fix(lsp): fix `nil`-index behavior for UTF-8 in `_str_*index_enc` methods ↵Rishikesh Vaishnav2021-12-20
| | | | | (#16731) Previously, the `_str_utfindex_enc` and `_str_byteindex_enc` helper functions would return `nil` when `offset_encoding == "utf-8"` and `index == nil`. Clearly, this doesn't reflect the expected behavior of the functions they're wrapping which would return the length of the line in this case. This should fix behavior with servers that use UTF-8 `offset_encoding` when applying text edits, formatting a range, and doing range code actions (though this isn't tested currently).
* fix(lsp): correctly align start and end range to codepoints during ↵Rishikesh Vaishnav2021-12-17
| | | | | | | | | | | | | | | | | | | | | incremental sync (#16670) Closes #16624 Fixes two issues with aligning the start position and end position to codepoints when calculating the start and end range. When aligning the start position: * use aligned byte index to calculate character index rather than the unadjusted byte When aligning the end position: * do not adjust the end byte if it falls on a UTF-8 codepoint * align byte to the first byte of the next codepoint rather than the last byte of the current codepoint * compute character character end range on the aligned byte index This commit also adds additional test coverage, including multibyte operations that previously failed before this commit.
* fix(ui): close floating window on BufLeave event (#16557)ii142021-12-15
| | | | | | | | | When buffer is visible in two splits simultaneously, BufHidden event is not triggered, causing the floating window to remain on screen after switching to another buffer. Remove BufHidden event from close_events defaults, and close the window if we changed the buffer to something other than the buffer that spawned the floating window or the floating window buffer itself.
* refactor: replace deprecated lua functions with their new versions (#16603)dundargoc2021-12-10
| | | | | | Calling vim.lsp.buf.definition() sometimes gives a deprecation warning. This will likely solve that. Co-authored-by: Christian Clason <christian.clason@uni-due.de>
* fix(lsp): create lsp requests with position offsets considering client ↵Rishikesh Vaishnav2021-12-10
| | | | | | encoding (#16382) Co-authored-by: black-desk <clx814727823@gmail.com> Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
* docs(lsp): fix resolve_capabilities docstring (#16577)Gregory Anders2021-12-08
|
* refactor(diagnostic): add warning to deprecated functions (#16536)dundargoc2021-12-08
|
* refactor(lsp): remove usage of deprecated function (#16539)Gregory Anders2021-12-07
|
* feat(lsp): use `vim.ui.select` for selecting lsp client (#16531)Anshuman Medhi2021-12-07
|
* feat(lsp,diagnostic): open folds in jump-related functions (#16520)Dmytro Meleshko2021-12-04
|
* fix(lsp): progress handlers should return vim.NIL on error (#16472)Michael Lingelbach2021-11-30
|
* fix(lsp): change rpc start notify level to warn (#16467)Michael Lingelbach2021-11-30
| | | This is less obtrusive, and does not require a confirmation to dismiss