aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/handlers.lua
Commit message (Collapse)AuthorAge
...
* fix(lsp): update workspace/applyEdit handler signature (#15573)Jose Alvarez2021-09-05
|
* feat(lsp)!: change handler signatureMichael Lingelbach2021-09-05
| | | | | | | | | | | | | | | | | | | | | | | | Previously, the handler signature was: function(err, method, params, client_id, bufnr, config) In order to better support external plugins that wish to extend the protocol, there is other information which would be advantageous to forward to the client, such as the original params of the request that generated the callback. In order to do this, we would need to break symmetry of the handlers, to add an additional "params" as the 7th argument. Instead, this PR changes the signature of the handlers to: function(err, result, ctx, config) where ctx (the context) includes params, client_id, and bufnr. This also leaves flexibility for future use-cases. BREAKING_CHANGE: changes the signature of the built-in client handlers, requiring updating handler calls
* docs: make Lua docstrings consistent #15255Gregory Anders2021-08-22
| | | | | | | | | | | | The official developer documentation in in :h dev-lua-doc specifies to use "--@" for special/magic tokens. However, this format is not consistent with EmmyLua notation (used by some Lua language servers) nor with the C version of the magic docstring tokens which use three comment characters. Further, the code base is currently split between usage of "--@", "---@", and "--- @". In an effort to remain consistent, change all Lua magic tokens to use "---@" and update the developer documentation accordingly.
* fix(lsp): Include client name in handler error messages (#15227)Mathias Fußenegger2021-07-31
| | | Makes it easier to tell with language server caused an error.
* feat(lsp): make list handlers configurable (#15199)Gregory Anders2021-07-26
| | | | | | | | | | | | The handlers for textDocument/references, textDocument/documentSymbol, and workspace/symbol open their results in the quickfix list by default and are not configurable. They are also incompatible with `vim.lsp.with` as they do not accept a configuration parameter. Add a `config` parameter to the handler for these three messages which allows them to be configured with `vim.lsp.with`. Additionally, add a new configuration option 'loclist' that, when true, causes these handlers to open their results in the location list rather than the quickfix list.
* doc(lsp): various small fixes (#15113)Ido Ariel2021-07-17
| | | | | | - remove incorrect usage of docstrings - fix make_formatting_params return type documentation to 'DocumentFormattingParams' - make progress_handler private - fix links
* fix(lsp): pass bufnr for async formatting (#15084)Michael Lingelbach2021-07-14
| | | | | | the `textDocument/rangeFormatting` nad `textDocument/formatting` did not pass bufnr to apply_text_edits, meaning edits were applied to the user's currently active buffer. This could result in text being applied to the wrong buffer.
* fix(lsp): Ensure human readable errors are printedMathias Fussenegger2021-07-11
| | | | | | | | | | `return err_message(tostring(err))` caused errors to be printed as `table: 0x123456789` instead of showing the error code and error message. This also removes some `if err` blocks that never got called because at the end of `handlers.lua` all the handlers are wrapped with logic that adds generic error handling.
* fix(lsp): Ensure users get feedback on references/symbols errors or empty ↵Mathias Fussenegger2021-07-11
| | | | | | | | | results Relates to https://github.com/neovim/neovim/issues/15050 Users should get some indication if there was an error or an empty result.
* fix(lsp): support duplicate params in signature help (#15032)Folke Lemaitre2021-07-09
|
* feat(lsp): highlight active parameter in signature help (#15018)Folke Lemaitre2021-07-07
|
* fix(lsp): handlers should focus quickfix listMichael Lingelbach2021-06-21
|
* feat(lsp): Add codelens supportMathias Fussenegger2021-06-14
|
* refactor(lsp): consolidate the different floating window methods into ↵Folke Lemaitre2021-05-29
| | | | open_floating_preview
* feat(lsp): use fancy_floating_markdown for signature_helpFolke Lemaitre2021-05-21
|
* Merge pull request #14309 from mjlbach/feature/hover_return_win_bufMichael Lingelbach2021-04-07
|\ | | | | lsp: hover window should return buf/winnr from focusable float
| * lsp: hover window should return buf/winnr from focusable floatMichael Lingelbach2021-04-07
| |
* | lsp: update documentation on window bordersMichael Lingelbach2021-04-06
|/
* feat(lsp): make hover/signature_help borders configurableelianiva2021-04-06
| | | | | | change hl groups for the example rename borders -> border
* lsp: floating window improvements (#14207)Michael Lingelbach2021-04-05
| | | | * remove left/right padding feature from trim_and_pad * use invisible borders by default on floating windows
* lsp: add syntax highlighting to signature helpMichael Lingelbach2021-03-22
|
* chore: rename progress_callback to progress_handlerMatthieu Coudron2021-03-04
|
* feat(lsp): use vim.notify for some errors (#13992)Matthieu Coudron2021-02-22
|
* LSP: Fix nil settings handling in workspace/configuration (#13708)Mathias Fußenegger2021-01-18
| | | | | | | | | The `workspace/configuration` handler could fail with the following error if `config.settings` is nil: runtime/lua/vim/lsp/util.lua:1432: attempt to index local 'settings' (a nil value)" This ensures that `config.settings` is always initialized to an empty table.
* lsp: add client/registerCapability handler (#13780)Michael Lingelbach2021-01-18
| | | Until we support dynamicRegistration, we should handle the client/registerCapability in core. There are still some language servers that send this request despite dynamicRegistration not being registered client-side (we got an upstream fix for the node ones, but this depends on them bumping vscode-languageserver-node).
* LSP: fix messageRequest to not return nested title (#13674)Michael Lingelbach2021-01-03
| | | | | * LSP: fix window/showMessageRequest to not return nested title * Add window/showMessageRequest handler to docs
* Merge pull request #13649 from mjlbach/move_from_nvim-lspconfigMatthieu Coudron2021-01-01
|\ | | | | LSP: Move workspace/configuration from nvim-lspconfig to core
| * LSP: Move workspace/configuration handler from nvim-lspconfig to coreMichael Lingelbach2021-01-01
| |
* | LSP: progress callback should only update existing dict for reports (#13652)jdrouhard2021-01-01
|/ | | Change the update of the client.messages.progress table to overwrite only the percentage and message properties on $report, Previously we were overwriting the table which meant client.messages.progress[token].message.title was wiped on report.
* LSP: window/showMessageRequest (#13641)Michael Lingelbach2020-12-31
| | | Another 3.16 compatibility. Solves Vue crashing currently. Currently not handling the return result, but would allow opening web browser in this case.
* LSP: implement window/workDoneProgress/create (#13640)Michael Lingelbach2020-12-30
|
* lsp: Use correct bufnr for documentHighlight handler (#13622)Adam P. Regasz-Rethy2020-12-29
|
* lsp: Add <nomodeline> to doautocmd calls (#13576)Nils2020-12-21
| | | When using "au User LspDiagnosticsChanged redrawstatus!", modelines get processed again (see h: doautocmd). Fortunately this can be suppressed using the <nomodeline> flag. this replaces every doautocmd call, that issues a User command, with doautocmd <nomodeline>.
* lsp: add $/progress report (#13294)Matthieu Coudron2020-12-20
| | | | Heavily inspired by https://github.com/nvim-lua/lsp-status.nvim. listen to the LspProgressUpdate event to update your statusline.
* 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)