aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp.lua
Commit message (Collapse)AuthorAge
...
* feat(lsp): allow root_dir to be nil (#15430)Mathias Fußenegger2021-08-19
| | | | | | | | According to the protocol definition `rootPath`, `rootUri` and `workspaceFolders` are allowed to be null. Some language servers utilize this to provide "single file" support. If all three are null, they don't attempt to index a directory but instead only provide capabilities for a single file.
* docs(lsp): prevent internal comments from showing as vim.lsp.init docsMathias Fussenegger2021-08-16
|
* feat(lsp): implement vim.lsp.diagnostic.redraw() (#15203)Gregory Anders2021-07-29
| | | | | | | | | | | | | Add a new function to redraw diagnostics from the current diagnostic cache, without receiving a "publishDiagnostics" message from the server. This is already being done in two places in the Lua stdlib, so this function unifies that functionality in addition to providing it to third party plugins. An example use case for this could be a command or key-binding for toggling diagnostics virtual text. The virtual text configuration option can be toggled using `vim.lsp.with` followed by `vim.lsp.diagnostic.redraw()` to immediately redraw the diagnostics with the updated setting.
* lsp(start_client): Allow passing custom workspaceFolders to the LSP (#15132)sim2021-07-20
| | | | | | | | | | | | | | Some language servers *cough*rust-analyzer*cough* need an empty/custom workspaceFolders for certain usecases. For example, rust-analyzer needs an empty workspaceFolders table for standalone file support (See https://github.com/rust-analyzer/rust-analyzer/pull/8955). This can also be useful for other languages that need to commonly open a certain directory (like flutter or lua), which would help prevent spinning up a new language server altogether. In case no workspaceFolders are passed, we fallback to what we had before.
* feat(lsp): Add codelens supportMathias Fussenegger2021-06-14
|
* fix(lsp): check mode in omnifunc callbackJose Alvarez2021-06-01
|
* Increase default LSP sync timeout to 1000msKarim Abou Zeid2021-05-02
|
* Add client.request_sync docKarim Abou Zeid2021-05-02
|
* doc clarificationKarim Abou Zeid2021-05-02
|
* Add formatting_seq_sync, change formatting and formatting_syncKarim Abou Zeid2021-05-01
|
* Merge pull request #14429 from ckipp01/forceMichael Lingelbach2021-04-23
|\ | | | | [LSP] - Don't automatically force shutdown on second restart.
| * Don't automatically force shutdown on second restart.ckipp012021-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is maybe a bit of a niche case, but I hit on this often as I'm developing a server, and therefore continually restarting it to get the latest changes of the server. Previously, I could only do this once since if you send in a request to restart/shut down the server, it will register it as a `tried_graceful_shutdown = true` meaning that the next restart would force it to be killed instead of another graceful exit. Instead, this changes the name a bit and now it will only mark `graceful_shutdown_failed = true` _if_ it actually fails to gracefully shutdown. This change allows for a user to restart multiple times in a situation like mine where nothing is going wrong, but I just want to restart continually as I'm developing without having to close and reopen.
* | Revert "lsp: fix blocking in closing of clients"Michael Lingelbach2021-04-23
|/ | | | | | | | This reverts commit 2e6c09838f88803f31d229002715628639631897. * Fixes #14428 * This commit caused neovim to close while open handles to the uv timer to kill active language servers were still open
* Merge pull request #14180 from oberblastmeister/lsp_exit_perfMichael Lingelbach2021-04-19
|\ | | | | fix slow closing of lsp clients when exiting vim
| * lsp: fix blocking in closing of clientsBrian Shu2021-04-19
| |
* | lsp: add lsp.buf_request_all for invoking asynchronous callbacksBrian Shu2021-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fixed nil issue changed poll to 10 changed wording added docs to once comma english
* | lsp: Add a flag to debounce didChange notificationsMathias Fussenegger2021-04-13
| | | | | | | | Would help with cases as reported in https://github.com/neovim/neovim/issues/14087
* | Merge pull request #14264 from mjlbach/feature/handle_reloading_bufferMichael Lingelbach2021-04-01
|\ \ | | | | | | lsp: add on_reload callback for buffer edits outside of neovim
| * | lsp: add on_reload callback for buffer edits outside of neovimMichael Lingelbach2021-03-31
| | |
* | | Merge pull request #14262 from mjlbach/feature/lsp_did_save_autocommandMichael Lingelbach2021-04-01
|\ \ \ | | | | | | | | lsp: clear did_save handler autocommand on each attach
| * | | lsp: clear did_save handler autocommand on each attachMichael Lingelbach2021-03-31
| |/ /
* / / lsp: fix textDocument/workspaceSymbol -> workspace/symbolMichael Lingelbach2021-03-31
|/ /
* | lsp: use utf-8 when utf-16 not requestedMichael Lingelbach2021-03-30
| |
* | lsp: Force re-display of diagnostics when opening a fileTJ DeVries2021-03-22
| |
* | lsp: Use incremental sync by defaultMathias Fussenegger2021-03-11
| | | | | | | | | | | | | | | | | | With the new implementation added in https://github.com/neovim/neovim/pull/14079 I think this is now working well enough to enable it by default. There are high CPU usage issues popping up now and then and they might at least partially be related to the full-text sync.
* | lsp: Resolve codeLense server capabilities (#14056)Josa Gesell2021-03-10
| |
* | lsp: get_language_id (#14092)TJ DeVries2021-03-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allow specifying a languageId for a lsp For some languages the filetype might not match the languageId the language server accepts. In these cases the config for the language server can contain a function which gets the current buffer and filetype and returns a languageId. When it isn't provided the filetype is used instead. Example: ```lua require'lspconfig'.sourcekit.setup{ get_language_id = function(bufnr, ft) return 'swift' end; } ``` Closes #13093 * lsp: Change to get_language_id Co-authored-by: Jan Dammshäuser <mail@jandamm.de>
* | lsp: fix endline such that it cannot point outside the buffer rangeMichael Lingelbach2021-03-10
| |
* | lsp: add incremental text synchronizationMichael Lingelbach2021-03-09
| | | | | | | | | | * Implementation derived from and validated by vim-lsc authored by Nate Bosch
* | lsp: don't invoke vim.notify on sigterm of language serverMichael Lingelbach2021-03-04
| |
* | lsp: invoke vim.notify when client exits with code or signal other than 0Michael Lingelbach2021-03-04
| |
* | 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: 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
* lsp: match textDocument/didChange eol behavior (#13792)Michael Lingelbach2021-01-25
| | | We should be consistent in sending the EOL character to servers(I think). Julia expects this to match on bufwrite, or it crashes when vim appends the newline during the write process.
* lsp: clear diagnostics on client shutdown (#13788)Michael Lingelbach2021-01-23
|
* lsp: remove duplicate settings validation (#13789)Michael Lingelbach2021-01-18
|
* lsp: validate and document server settings (#13698)Michael Lingelbach2021-01-18
| | | | * update lua documentation * run docgen
* 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 in clientInfo to initalize_params. (#13757)Chris Kipp2021-01-18
| | | | | | | | | | | | * Add in clienInfo to initalize_params. Some servers (like Metals in my case) will actually pull this info from the initalize_params and display it in the logs. I know from the server perspective it helps at times to have this available to pull from to have more details about the client and version. You can see that this is part of the spec here: microsoft.github.io/language-server-protocol/specification#initialize
* lsp: fix on_attach signature documentation (#13723)Michael Lingelbach2021-01-12
| | | * trim trailing whitespace from docs
* 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: Fix text payload in didSave notification (#13363)Mathias Fußenegger2020-12-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the specification[1] the payload must look like this: interface DidSaveTextDocumentParams { /** * The document that was saved. */ textDocument: TextDocumentIdentifier; /** * Optional the content when saved. Depends on the includeText value * when the save notification was requested. */ text?: string; } `text` must be on the same level as `textDocument´. Where `TextDocumentIdentifier` is: interface TextDocumentIdentifier { /** * The text document's URI. */ uri: DocumentUri; } [1]: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didSave
* feat: Allow incremental sync & lsp flags (#13371)TJ DeVries2020-12-08
|
* lsp: Fix "unsupported_method" error when the buffer does not have an LSP ↵eightpigs2020-12-03
| | | | Server (#13175)
* 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: 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 fallback for callback in method_unsupportedfrancisco souza2020-10-25
| | | | Missed this #12764. My bad :((
* 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>
* lsp: Fix "client has shut down" errors during initializing (#13103)Mathias Fußenegger2020-10-22
| | | | | | | | | | Language servers can already send log messages to the client while the server is still being initialized. This currently leads to "client has shut down" messages which are confusing to the user as the server is properly starting. To fix this this changes the `get_client_by_id` method to also return a client if it is still initializing.
* Merge #12468 'lsp: logging'Justin M. Keyes2020-09-01
|\