aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
* feat(lsp): improve logging (#15636)Michael Lingelbach2021-09-15
| | | | | | | * Simplify rpc encode/decode messages to rpc.send/rcp.receive * Make missing handlers message throw a warning * Clean up formatting style in log * Move all non-RPC loop messages to trace instead of debug * Add format func option to log to allow newlines in per log entry
* fix(lsp): correctly parse LSP snippets #15579hrsh7th2021-09-14
| | | Fixes #15522
* docs #15625Justin M. Keyes2021-09-10
| | | | | | | | | | | fix #12261 fix #15536 fix #15623 fix #15572 ref #14244 ref #15034 close #15555 close #14957
* perf(lua): optimize vim.deep_equal #15236Javier Lopez2021-09-10
| | | | By remembering the keys already compared in repeating a comparison is avoided. Thanks: https://stackoverflow.com/a/32660766
* feat(lsp): support textDocument/prepareRename (#15514)Zi How Poh2021-09-08
|
* chore(lsp): fix formatting in vim.lsp.log (#15596)Michael Lingelbach2021-09-07
|
* feat(lsp): add warning message for large log sizeMichael Lingelbach2021-09-07
|
* feat(lsp): add lsp healthcheckMichael Lingelbach2021-09-07
| | | | | Add healthcheck for language server client, currently only checks logging status.
* fix(lsp): adapt codelens resolve to handler signature change (#15578)Mathias Fußenegger2021-09-06
| | | Follow up to https://github.com/neovim/neovim/pull/15504
* fix(lsp): update workspace/applyEdit handler signature (#15573)Jose Alvarez2021-09-05
|
* Merge pull request #15504 from mjlbach/feat/change-handler-signatureMichael Lingelbach2021-09-05
|\ | | | | feat(lsp)!: change handler signature
| * 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(lsp): remove private lsp.diagnostic functions from docs (#15541)Mathias Fußenegger2021-09-01
| | | | | | | | Both `apply_to_diagnostic_items` and `show_diagnostics` are local functions and cannot be called by users.
* | docs(lsp): document codelens.get bufnr parameter (#15540)Mathias Fußenegger2021-09-01
| | | | | | Alternative to https://github.com/neovim/neovim/pull/15224
* | fix(lsp): resolve bufnr in buf_is_attached (#15523)Jose Alvarez2021-08-30
| |
* | fix(lua): preserve argument lists which are not listsBjörn Linse2021-08-29
| |
* | fix(lsp): check if buffer is valid in changetracking (#15505)Jose Alvarez2021-08-28
| |
* | feat(lsp): get_border_size(): support repeating border char list #15474zeertzjq2021-08-27
| |
* | fix(lua): verify buffer in highlight.on_yank (#15482)notomo2021-08-26
| | | | | | | | | | Resolve an issue with deferred clearing of highlight failing if the buffer is deleted before the timeout by checking whether the buffer is valid first.
* | Merge pull request #15466 from vigoux/ts-query-autoThomas Vigouroux2021-08-24
|\ \ | |/ |/| feat(ts): add query module in treesitter keys
| * feat(ts): add query module in treesitter keysThomas Vigouroux2021-08-23
| |
* | fix(lsp): enable additional capabilities (#15470)Michael Lingelbach2021-08-23
|/ | | | | | | Declaration, type-definition, and implementation capabilities were previously disabled if the client received table output from the server capabilities. The workDoneProgress capability is sent for many servers for all supported capabilities as part of this table. Default to setting capability to table instead of false.
* 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.
* Merge pull request #15429 from bfredl/hl_2Björn Linse2021-08-19
|\ | | | | perf(treesitter): avoid string lookup of highlight name in hot loop
| * perf(treesitter): avoid string lookup of highlight name in hot loopBjörn Linse2021-08-19
| | | | | | | | | | These numbers are guaranteed to be stable even if you do "highlight clear" (all attributes disappear, but not the id to name mapping itself)
* | 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.
* | feat(lsp): jump to diagnostics by position (#14795)Zi How Poh2021-08-19
|/
* docs(lsp): prevent internal comments from showing as vim.lsp.init docsMathias Fussenegger2021-08-16
|
* fix(lsp): properly handle `nil` lines when trimming empty lines (#15325)Andrea Cappuccio2021-08-10
|
* fix(lsp): floating popup should take offset_x into account when positioning ↵Hans Pinckaers2021-08-09
| | | | (#15297)
* docs: Add some references to LSP specification (#15321)max3975742021-08-09
|
* Merge pull request #14767 from theHamsta/no-treesitter-mapping-to-non-existentThomas Vigouroux2021-08-07
|\ | | | | fix(treesitter): do not map hl_group when no mapping is set
| * chore: remove reference to nvim-treesitter in commentStephan Seitz2021-08-06
| |
| * fix(treesitter): do not map hl_group when no mapping is setStephan Seitz2021-08-06
| | | | | | | | | | | | | | | | | | | | | | This changes the behavior of the hl_cache to the old one. - when the capture exists as a hlgroup -> use it - when hl_map contains a mapping -> use it - else do nothing (before: map capture to non-existing capture) Before also captures `@foo.bar` would intend to use the hlgroup `foo.bar` which results in a confusing error since hlgroups can't contain dots.
* | fix(lsp): prevent duplicate lines seperated by newlines (#15284)Folke Lemaitre2021-08-06
|/
* refactor: remove remaining references to nvim_buf_set_virtual_textGregory Anders2021-08-03
|
* 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): 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.
* 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.
* docs(ts): add documentation for listing fnsThomas Vigouroux2021-07-25
|
* treesitter: add query.list_directivesStephan Seitz2021-07-24
|
* feat(treesitter): allow to set highlight priority for queriesStephan Seitz2021-07-22
|
* lsp: add vim.lsp.diagnostic.set_qflist() function (#14831)Marc Jakobi2021-07-22
| | | | * Add vim.lsp.diagnostic.set_qflist() function * replaces opts.open_loclist with unified opts.open
* 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.
* docs: made can_merge private (#15138)Folke Lemaitre2021-07-19
|
* fix(lsp): allow diagnostic.clear to accept nil bufnr (#15137)Gregory Anders2021-07-19
| | | | | | | Passing `nil` is equivalent to passing 0, i.e. it simply uses the current buffer number. This fixes a bug when vim.lsp.diagnostic.disable() is called without arguments.
* feat(lsp): allow diagnostics to be disabled for a buffer (#15134)Gregory Anders2021-07-19
| | | | | | | | | | | | | | | Add two new methods to allow diagnostics to be disabled (and re-enabled) in the current buffer. When diagnostics are disabled they are simply not displayed to the user, but they are still sent by the server and processed by the client. Disabling diagnostics can be helpful in a number of scenarios. For example, if one is working on a buffer with an overwhelming amount of diagnostic warnings it can be helpful to simply disable diagnostics without disabling the LSP client entirely. This also allows users more flexibility on when and how they may want diagnostic information to be displayed. For example, some users may not want to display diagnostic information until after the buffer is first written.
* feat(lsp): allow configuring zindex for floating windows (#15086)rayx2021-07-19
|
* fix(shared): do not treat empty tables as list in deep extend (#15094)Folke Lemaitre2021-07-19
| | | | | | | | | | An empty table was previously always treated as a list, which means that while merging tables, whenever an empty table was encountered it would always truncate any table on the left. `vim.tbl_deep_extend("force", { b = { a = 1 } }, { b = {} })` Before: `{ b = {} }` After: `{ b = { a = 1 } }`
* feat: aggregate code actions from all clients (#15121)Folke Lemaitre2021-07-18
|