aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/callbacks.lua
Commit message (Collapse)AuthorAge
* lsp: remove deprecated references to 'callbacks' (#13945)Matthieu Coudron2021-02-23
| | | | | vim.lsp.callbacks was deprecated a few months ago. This is a cleanup before the release. Use vim.lsp.handlers instead.
* lsp: vim.lsp.diagnostic (#12655)TJ DeVries2020-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Breaking Changes: - Deprecated all `vim.lsp.util.{*diagnostics*}()` functions. - Instead, all functions must be found in vim.lsp.diagnostic - For now, they issue a warning ONCE per neovim session. In a "little while" we will remove them completely. - `vim.lsp.callbacks` has moved to `vim.lsp.handlers`. - For a "little while" we will just redirect `vim.lsp.callbacks` to `vim.lsp.handlers`. However, we will remove this at some point, so it is recommended that you change all of your references to `callbacks` into `handlers`. - This also means that for functions like |vim.lsp.start_client()| and similar, keyword style arguments have moved from "callbacks" to "handlers". Once again, these are currently being forward, but will cease to be forwarded in a "little while". - Changed the highlight groups for LspDiagnostic highlight as they were inconsistently named. - For more information, see |lsp-highlight-diagnostics| - Changed the sign group names as well, to be consistent with |lsp-highlight-diagnostics| General Enhancements: - Rewrote much of the getting started help document for lsp. It also provides a much nicer configuration strategy, so as to not recommend globally overwriting builtin neovim mappings. LSP Enhancements: - Introduced the concept of |lsp-handlers| which will allow much better customization for users without having to copy & paste entire files / functions / etc. Diagnostic Enhancements: - "goto next diagnostic" |vim.lsp.diagnostic.goto_next()| - "goto prev diagnostic" |vim.lsp.diagnostic.goto_prev()| - For each of the gotos, auto open diagnostics is available as a configuration option - Configurable diagnostic handling: - See |vim.lsp.diagnostic.on_publish_diagnostics()| - Delay display until after insert mode - Configure signs - Configure virtual text - Configure underline - Set the location list with the buffers diagnostics. - See |vim.lsp.diagnostic.set_loclist()| - Better performance for getting counts and line diagnostics - They are now cached on save, to enhance lookups. - Particularly useful for checking in statusline, etc. - Actual testing :) - See ./test/functional/plugin/lsp/diagnostic_spec.lua - Added `guisp` for underline highlighting NOTE: "a little while" means enough time to feel like most plugins and plugin authors have had a chance to refactor their code to use the updated calls. Then we will remove them completely. There is no need to keep them, because we don't have any released version of neovim that exposes these APIs. I'm trying to be nice to people following HEAD :) Co-authored: [Twitch Chat 2020](https://twitch.tv/teej_dv)
* lsp: Store diagnostics for unloaded buffers (#13102)Mathias Fußenegger2020-10-25
| | | | | | | | | | | | | | | | | | | | | | To avoid loading buffers https://github.com/neovim/neovim/pull/12440 changed the logic to not process diagnostics for unloaded buffers. This is problematic for language servers where compile errors or build errors are reported via diagnostics. These errors may prevent the language server from providing all functions and it is difficult for users to debug it without having access to the errors. For example, with eclipse.jdt.ls there may be a problem with gradle (the build tool for java), it results in a diagnostics like this: org.gradle.toolingapi/build.gradle|1 col 1| Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.8.1-bin.zip'. This would be invisible to users unless the user happens to open the right file. In this case the user would actually never see the error, because the language server isn't attached to the build configuration files. This changes the behaviour to at least store the diagnostics. The other operations which are more expensive are still skipped.
* lsp: remove popup No signature available. (#12915)Raphael2020-09-18
| | | | | | | | | | | | * lsp: remove popup No signature available. If no signatures. we shouldn't popup No signature available ..It will make noise when use ` api.nvim_command("autocmd CompleteDone <buffer> lua vim.lsp.buf.signature_help()")` * fix ci test failed remove whitespace * print message when no signature help * Add comment
* Add FIXMEsPatrice Peterson2020-08-23
|
* Add docs for most vim.lsp methodsPatrice Peterson2020-08-23
| | | | Most of the lsp.log will be addressed in a separate PR.
* lsp: Add support for call hierarchies (#12556)cbarrete2020-07-18
| | | | | | | | | | | | | | | | | | * LSP: Add support for call hierarchies * LSP: Add support for call hierarchies * LSP: Add support for call hierarchies * LSP: Jump to call location Jump to the call site instead of jumping to the definition of the caller/callee. * LSP: add tests for the call hierarchy callbacks * Fix linting error Co-authored-by: Cédric Barreteau <>
* lsp: do not process diagnostics for unloaded buffers (#12440)TJ DeVries2020-06-04
|
* LSP: Don't swallow bufnr argument from callbacks (#12350)Mathias Fußenegger2020-05-20
| | | | | The callbacks for `textDocument/documentSymbol` and `workspace/symbol` never received the `bufnr` argument because the logic that adds error validation and logging swallowed the argument.
* Check for nil before checking for empty tableAndy Lindeman2020-05-15
| | | | | | | At least the `gopls` language server seems to return nil/null if no code actions are available. Currently this results in an error: > Error executing vim.schedule lua callback: shared.lua:199: Expected table, got nil
* LSP: Add textDocument/codeAction support (#11607)Jesse2020-05-16
| | | | | | | | | | | | * Add textDocument/codeAction * Add callback for workspace/executeCommand * Escape newlines in codeAction titles * Return empty list in get_line_diagnostics if no buffer diagnostics * Add stub documentation * Validate context parameter in code_action * Add support for edit in CodeAction responses * Group diagnostics by line in vim.lsp.util.get_line_diagnostics() * Advertise code action literal support
* LSP: Make applyEdit return a response (#12270)Mathias Fußenegger2020-05-11
| | | | | | | | According to the specification workspace/applyEdit needs to respond with a `ApplyWorkspaceEditResponse` See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_applyEdit This is a subset of https://github.com/neovim/neovim/pull/11607
* lsp: add workspace/symbol (#12224)Christian Clason2020-05-02
| | | | | | | | * lsp: add workspace/symbol * refactor symbol callback * set hierarchical symbol support to true * add documentation and default mapping Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
* LSP: remove obsolete "peek definition" code #12178Thore Weilbier2020-04-25
| | | | | | The method with the name 'textDocument/peekDefinition' is not part of the official language server protocol specification. Therefore no language server can/will support this. Thereby all related code and documentation as been removed.
* lsp: callback for references now opens qf (#12171)Thore Weilbier2020-04-23
| | | | | | | | In contrast to other callbacks for LSP requests like `textDocument/documentSymbols`, does the one for references not open the quickfix window after the quickfix list was filled. This left the user in a situation he don't know what or if something had happen. Related to: neovim/neovim#12170
* lsp: textDocument/definition can return Location or Location[] (#12014)Khangal2020-04-21
| | | | | * https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition Co-authored-by: Khangal Jargalsaikhan <khangal.j@irbis.sg>
* lsp: export convert_signature_help_to_markdown_lines (#11950)Hirokazu Hata2020-04-19
| | | This function is also useful for users to create their own `textDocument/signatureHelp` callback function.
* LSP: fix breakage when severity isn't specified (#12027)Ghjuvan Lacambre2020-04-18
| | | | | | Before this commit, the LSP client would throw errors when messages without severity would be sent by the server. We make severity default to `Error` as a kludge before proper heuristics to discover the severity of a message are found.
* lsp: make showMessage and logMessage callbacks different (#11942)Hirokazu Hata2020-03-02
| | | | According to the LSP specification, showMessage is what is displayed and logMessage is what is stored. Since these are different things, I devide the callback into those that match.
* lsp: add 'textDocument/documentSymbol’ callbackHirokazu Hata2020-03-01
| | | | Spec: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentSymbol
* LSP: Remove diagnostic message handling in locations_to_itemsMathias Fussenegger2020-02-27
| | | | | `locations_to_items` is for turning `Location[]` into items, not for `Diagnostic[]`
* Add signs for Lsp diagnostics (#11668)Alvaro Muñoz2020-02-27
| | | | | | * Add signs for Lsp diagnostics * defer sign definition until init.vim is loaded
* add support to show diagnostics count in statusline (#11641)Alvaro Muñoz2020-02-26
| | | | | * add support to show diagnostics count in statusline * documentation
* LSP: implement documentHighlight (#11638)Alvaro Muñoz2020-02-26
| | | | | | | | * implement documentHighlight * fix bug * document highlight groups * use uppercase for help section title * documentation
* lsp: fix textDocument/completion handlingHirokazu Hata2020-02-19
| | | | | | | fix: #11826 Some lanuguage servers return complementary candidates whose prefixes do not match are also returned. So we exclude completion candidates whose prefix does not match. ex) Microsoft python-language-server, rust-analyzer
* LSP: Use async completion for omnifunc. (#11578)Ashkan Kiani2019-12-20
|
* LSP: Improve the display of the default hover callback. (#11576)Ashkan Kiani2019-12-20
| | | Strips the code blocks from markdown and does syntax highlighting.
* LSP: Move default buf callbacks to vim.lsp.callbacks (#11452)Ashkan Kiani2019-11-26
- In the process, refactored focusable_preview to a util function. - Add text for locations_to_items of the current line. - Improve location callback to handle multiple return values by using set_qflist. - Remove update_tagstack and leave note for future travelers.