aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp
Commit message (Collapse)AuthorAge
...
* | | lsp: fix diagnostic reported on terminating EOL characterMichael Lingelbach2021-03-02
| |/ |/|
* | fix: show error when language server start fails and prevent future requestsDavid Zhang2021-02-26
| |
* | LSP: Resolve text_document_save capability according to specMathias Fussenegger2021-02-25
| | | | | | | | | | Fixes https://github.com/neovim/neovim/issues/13989 See https://github.com/microsoft/language-server-protocol/issues/288
* | [LSP] Add in more docs for highlight groups with document_highlight() (#13614)Chris Kipp2021-02-24
| | | | | | | | | | | | Currently it's not 100% clear that without setting these, using the autocomds to utilize the `textDocument/documentHighlight` functionality, nothing will actually be visible since the highlight groups don't have any details. This just adds in a couple simple extra notes to make sure that's done
* | 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.
* | feat(lsp): use vim.notify for some errors (#13992)Matthieu Coudron2021-02-22
| |
* | lsp: Fix text edits operating on the last line of a document (#13677)Mathias Fußenegger2021-02-19
| | | | | | | | | | | | `lines` can be empty, in which case `#lines[#lines]` failed with an error: lsp/util.lua:214: attempt to get length of a nil value
* | lsp: client stop cleanups (#13877)Michael Lingelbach2021-02-19
|/ | | | | | | | * lsp: client stop cleanups * Add diagnostic clearing to client.stop() method used by nvim-lspconfig * Clear diagnostic cache to prevent stale diagnostics on client restart * lsp: Add test for vim.lsp.diagnostic.reset
* Merge pull request #13843 from teto/notif_providerMatthieu Coudron2021-02-08
|\ | | | | [RDY] Notification provider
| * feat: adds vim.notifyMatthieu Coudron2021-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | Adds function to notify the user like this: `:lua vim.notify("hello user")` embeds log levels vim.log.levels. you can then reassign vim.notify to for instance ``` function notify_external(msg, log_level, opts) vim.fn.jobstart({"notify-send", msg }) end ```
* | lsp: Fix pumvisible() check introduced in #12900 (#13866)runiq2021-02-04
|/ | | | | | | | `pumvisible()` returns a number, and numbers are always `true` in Lua, so the return value needs to be checked explicitly. Using https://github.com/neovim/neovim/pull/12900 as context, it appears the intention was to move into the `if` branch when the completion popup is not shown (i.e. `vim.fn.pumvisible() == 0`).
* 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).
* logging: move to XDG_CACHE_HOME (#13739)Michael Lingelbach2021-01-13
| | | | | while there is some controversy, stdpath('cache') looks like a better fit for logs than stdpath('data'): you can remove logs without preventing nvim to work which fits the XDG_CACHE_HOME definition of `user specific non-essential data files`.
* lsp: Add severity_limit for other diagnostics features (#13528)TJ DeVries2021-01-12
| | | | | | | | | | | * lsp: Add severity_limit for other diagnostics * docs and tests * fix: lint * Add to other types * fix: lint
* fix(lsp): Allow subsequent text document edits to pass (#13534)TJ DeVries2021-01-11
| | | | | | | * fix: Allow subsequent text document edits to pass * fixup: cleaner code * add tests
* LSP: Add diagnostic tags to client capabilities (#13578)Timmy Xiao2021-01-05
| | | pyright (possibly others) does not send any hint diagnostics if we do not have tagSupport in PublishDiagnosticsClientCapabilities. This PR just adds them.
* 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: Add helper function from accessing language server settings from ↵Michael Lingelbach2021-01-01
| | | | | | | | nvim-lspconfig
* | 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: Disable capabilities not currently supported by language client ↵Michael Lingelbach2020-12-30
| | | | | handlers (#13638) Several language servers are incorrectly invoking handlers which are not yet implemented in core.
* 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: Fire LspDiagnosticsChanged before returning (#13483)Josh French2020-12-23
| | | Run hook even when transitioning from some diagnostics to no diagnostics
* 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.
* Fix lsp tests breaking from new LuaJIT versionMatthew Nibecker2020-12-13
| | | | | | | | | | | | | | | Apparently the new version of LuaJIT changed the consistency with which it sorted table dictionaries. IIRC lua sorts dictionary keys by memory address, so it would appear that the reasons tests were previously passing was because of a differentiation in the implementation of the lua runtime. Ensure that array fields in the lsp protocol tables are consistently created, by using ipair when generating arrays for completionItemKind and symbolItemKind. For CodeActionKind, the current implementation includes both the keys and the values in the array. This is incorrect. Ensure that only the values are included in the array and sort them for consistency.
* doc: Fix incorrect LSP diagnostic-related helptags (#13388)Kevin Fleming2020-12-09
|
* doc: Add missing parameter end_pos for range_formatting (#13481)Olivier Roques2020-12-09
|
* feat: Allow incremental sync & lsp flags (#13371)TJ DeVries2020-12-08
|
* lsp: Change diagnosticg.get_all to return {bufnr: Diagnostic[]} (#13310)Mathias Fußenegger2020-12-03
| | | Allows users to associate the diagnostics with the right bufnr.
* lsp: Make open_floating_preview buffers ephemeral (#13437)runiq2020-12-03
| | | Fixes #13429.
* lsp: Reduce memory usage for buffering the message from LSP.Yuki Ito2020-11-29
|
* use if_nil variable replace vim.F.if_nilRaphael2020-11-26
|
* Lsp: fix vim.F.ifnil to vim.F.if_nil (#13384)Raphael2020-11-25
|
* LSP: Feature/add workspace folders (#12638)Michael Lingelbach2020-11-25
| | | | | | | | | | | * First implementation of workspace folders * Add completion for current directory * Add tracking of workspace folders * Add workspace folder listing * Add checks on adding/removing workspaces * Add appropriate initialization options * Add documentation * Make workspaceFolders available wherever client is
* lsp: Expose all diagnostics (#13285)Mathias Fußenegger2020-11-14
| | | | | | | | | | | | | | | * lsp: Remove duplicate `diagnostics` fallback in diagnostic.display * lsp: Expose all diagnostics Before the changes in #12655 it was possible to retrieve all diagnostics via `vim.lsp.util.diagnostics_by_buf`. This adds a `diagnostic.get_all()` to enable users to retrieve all diagnostics. Use cases for that could include loading all diagnostics into the quickfix list, or to build an enhanced goto_next that can move across buffers.
* doc: fixup sign information (#13281)TJ DeVries2020-11-13
| | | Thanks to @sunzoje for finding the outdated documentation.
* 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: fix formatting_sync with multiple clients (#13233)francisco souza2020-11-07
| | | | | | | | buf_request_sync returns a table indexed by the client id, so when starting a second client on a separate buffer, result[1] will be nil. Closes #13232. Co-authored-by: francisco souza <fsouza@users.noreply.github.com>
* lsp: remove vim.NIL from processing (#13174)TJ DeVries2020-11-02
| | | | | * lsp: remove vim.NIL from processing * lsp: remove instances of vim.NIL
* lsp: complete support for `CodeActionKind`s to capabilities (#13180)Jesse2020-11-01
| | | | | We support applying all kinds in the spec equivalently and some servers (including dartls) won't send code actions if support for the relevant kinds is not explicitly stated in the client capabilities. Therefore, this PR makes that support explicit. Also, as we support all CodeActionKinds, we should also mark the server as supporting code actions when it specifies code action kinds. This is also done in this PR.
* lsp: Remove snippet lies (#13183)TJ DeVries2020-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | We don't actually support snippets in core in the way that users would truly expect. So, by default, we will not say that builtin-lsp has `snippetSupport`. To re-enable, users can do the following: First, get a capabilities dictionary with `local capabilities = vim.lsp.protocol.make_client_capabilities()` Then override `capabilities.textDocument.completion.completionItem.snippetSupport = true` and then pass those capabilties to the setup function. ``` nvim_lsp.server_name.setup { ..., capabilities = capabilities, ..., } ``` See https://github.com/neovim/neovim/issues/12795
* lsp: Fix case where active_signature == vim.NIL (#13114)Michael Lingelbach2020-10-27
|
* 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: only send buf requests to servers that support the request (#12764)francisco souza2020-10-25
| | | | | | | | | | | | | Refactors how required capabilities are detected and validated, and make sure requests are only sent to clients that support it (and only fail if no clients support the provided method). The validation happens at the buf_request level, because we assume that if someone is sending the request directly through the client, they know what they're doing. Also, let unknown methods go through. This is extracted from #12518 and closes #12755. Co-authored-by: francisco souza <fsouza@users.noreply.github.com>
* Opts.wrap_at is sometimes a bool, ensure it falls back to a valid number in ↵Tony Kuneck2020-10-04
| | | | the call to math.min