aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
...
* fix(lsp): improve symbols_to_items performance (#16197)Michael Lingelbach2021-10-31
| | | | | * use table.insert instead of list_extend to avoid validation overhead Co-authored-by: Gianmarco Fantinuoli <fanto-dev@hotmail.com>
* fix(lsp): default to UTF-16 when lsp client using str_utfindexblack_desk2021-10-31
|
* fix(lsp): default to UTF-16 in make_position_paramsblack_desk2021-10-31
|
* fix(lsp): don't update active_clients on exit_timeout (#16192)David Hotham2021-10-31
|
* feat(lsp): add formatexpr (#16186)Michael Lingelbach2021-10-31
| | | | Co-authored-by: Meck <yesmeck@gmail.com> Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
* fix(lsp): add placeholder cancel function (#16189)Michael Lingelbach2021-10-31
| | | | | | | | | | Fixes a bug introduced by https://github.com/neovim/neovim/pull/15949 When no supported clients for a given method are available, buf_request returns early with a nil value. If buf_request_sync is called on a buffer with no clients that support a given method, the returned `cancel` method (which is nil), is invoked, resulting in an error. Solution: return an empty function handle
* feat(lsp): default to botright for setting qflist (#16177)Michael Lingelbach2021-10-30
| | | | | | * Opens quickfix list spanning the entire nvim window in location handlers closes https://github.com/neovim/neovim/issues/12241
* refactor(diagnostic): make display handlers generic (#16137)Gregory Anders2021-10-29
| | | | | | | Rather than treating virtual_text, signs, and underline specially, introduce the concept of generic "handlers", of which those three are simply the defaults bundled with Nvim. Handlers are called in `vim.diagnostic.show()` and `vim.diagnostic.hide()` and are used to handle how diagnostics are displayed.
* feat(lsp): track pending+cancel requests on client object #15949jdrouhard2021-10-29
|
* fix(lsp): cleanup progress messages for the correct client (#16110)Folke Lemaitre2021-10-21
|
* feat(lsp): add exit_timeout flag (#16070)Michael Lingelbach2021-10-21
| | | | | | | * This flag allows customizing the time before sending kill -15 to the server. If set to false, neovim exits immediately after sending request('shutdown'). Otherwise, polls until all servers have shutdown, and then kills remaining servers via kill -15 at exit_timeout duration. Defaults to 500 ms.
* fix(lsp): avoid duplicates in client attached buffers (#16099)Michael Lingelbach2021-10-20
| | | | | | | closes https://github.com/neovim/neovim/issues/16058 * add client.attached_buffers * only update client.attached_buffers in on_attach * use table instead of list for attached_buffers to avoid duplication
* fix(lsp): adjust legacy show diagnostic functions to use correct scope (#16106)Mathias Fußenegger2021-10-20
| | | * `where` was renamed to `scope`
* fix(diagnostic): allow floats to be focusable (#16093)Gregory Anders2021-10-19
| | | | Setting focus_id allows the float to be focused by calling the function a second time (a feature of open_floating_preview).
* fix(diagnostic): handle diagnostics placed past the end of line (#16095)Gregory Anders2021-10-19
|
* fix(gen_vimdoc.py): spacing around inline elements #16092Gregory Anders2021-10-19
| | | | | The spacing fix drew attention to a couple of places that were using incorrect formatting such as the key listing for `nvim_open_win`, so those were fixed too.
* refactor(diagnostic)!: replace 'show_*' functions with 'open_float' (#16057)Gregory Anders2021-10-19
| | | | | | | | | | | | | | | | | | | | 'show_line_diagnostics()' and 'show_position_diagnostics()' are almost identical; they differ only in the fact that the latter also accepts a column to form a full position, rather than just a line. This is not enough to justify two separate interfaces for this common functionality. Renaming this to simply 'show_diagnostics()' is one step forward, but that is also not a good name as the '_diagnostics()' suffix is redundant. However, we cannot name it simply 'show()' since that function already exists with entirely different semantics. Instead, combine these two into a single 'open_float()' function that handles all of the cases of showing diagnostics in a floating window. Also add a "float" key to 'vim.diagnostic.config()' to provide global values of configuration options that can be overridden ephemerally. This makes the float API consistent with the rest of the diagnostic API. BREAKING CHANGE
* feat(lsp): set codelens virtual text hl_mode to combine (#16048)sim2021-10-19
| | | | | It looks a bit off with the extmark going over the cursorline. (With hl_mode combine it keeps the background of the cursorline under the codelens virtualtext)
* feat(lsp): use vim.ui.select() in codelenses (#16004)Josa Gesell2021-10-18
| | | Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com> Mathias Fußenegger <mfussenegger@users.noreply.github.com>
* fix(lsp): fix cursor row after textEdits (#16038)hrsh7th2021-10-18
|
* fix(lsp): persist diagnostic config for clientsGregory Anders2021-10-18
| | | | | Persist configuration settings set with `vim.lsp.with` and `vim.lsp.diagnostic.on_publish_diagnostics` by setting the config for the namespace associated with the client.
* fix(diagnostic): do not override existing config settings #16043Gregory Anders2021-10-17
| | | | | | | | | | | When using `true` as the value of a configuration option, the option is configured to use default values. For example, if a user configures virtual text to include the source globally (using vim.diagnostic.config) and a specific namespace or producer configures virtual text with `virt_text = true`, the user's global configuration is overriden. Instead, interpret a value of `true` to mean "use existing settings if defined, otherwise use defaults".
* fix: correctly capture uri scheme on windows (#16027)Michael Lingelbach2021-10-15
| | | | | | closes https://github.com/neovim/neovim/issues/15261 * normalize uri path to forward slashes on windows * use a capture group on windows that avoids mistaking drive letters as uri scheme
* fix(lsp): maintain client_ids table structure when filtering (#15991)Jose Alvarez2021-10-11
|
* fix(lsp): do not invoke handlers for unsupported methods (#15926)Michael Lingelbach2021-10-10
| | | | | | | Closes https://github.com/neovim/neovim/issues/15174 Instead of invoking handlers with unsupported methods, pre-compute which clients support a given method and only notify the user if no clients support the given method.
* fix(lsp): add done flag to messages returned in util.get_progress_messages() ↵jdrouhard2021-10-10
| | | | (#15985)
* fix(lsp): add textDocument/prepareRename to capability map (#15961)francisco souza2021-10-08
| | | | | | | | | | This is a simple fix for #15899, as it should at least stop calling `prepareRename` on servers that don't support renaming. I imagine a better fix would be to inspect the actual value for, but that requires some plumbing changes on how capabilities are evaluated before sending requests out. Co-authored-by: francisco souza <fsouza@users.noreply.github.com>
* fix(diagnostic): error on invalid severity value (#15965)Gregory Anders2021-10-08
| | | | | | | Users can pass string values for severities that match with the enum names (e.g. "Warn" or "Info") which are converted to the corresponding numerical value in `to_severity`. Invalid strings were simply left as-is, which caused confusing errors later on. Instead, report an invalid severity string right up front to make the problem clear.
* fix(lsp): expose ContentModified error code to callbacks (#15262)Rishikesh Vaishnav2021-10-08
|
* feat(lsp): utilize textEdit.range for startbyte in omnifunc (#15957)Mathias Fußenegger2021-10-08
| | | Closes https://github.com/neovim/neovim/issues/15784
* fix: support severity_sort option for show_diagnostic functions (#15948)Gregory Anders2021-10-07
| | | Support the severity_sort option for show_{line,position}_diagnostics.
* feat(diagnostic): update jumplist on goto_next/prev (#15942)Sean Dewar2021-10-07
|
* feat(lsp): improve json deserialization performance (#15854)Michael Lingelbach2021-10-05
| | | | | | | | | | * Add optional second table argument to vim.json.decode which takes a table 'luanil' which can include the 'object' and/or 'array' keys. These options use luanil when converting NULL in json objects and arrays respectively. The default behavior matches the original lua-cjson. * Remove recursive_convert_NIL function from rpc.lua, use vim.json.decode with luanil = { object = true } instead. This removes a hotpath in the json deserialization pipeline by dropping keys with json NULL values throughout the deserialized table.
* fix(healthcheck): update builtins to the new convention #15914Javier Lopez2021-10-05
| | | Adjust some builtin healthchecks to use Lua, after #15259
* feat(runtime/health): support lua healthchecksJavier López2021-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Refactor health.vim to discover lua healthcheck in the runtime directories lua/**/health{/init}.lua - Support healthchecks for lua submodules e.g :checkhealth vim.lsp and also support wildcard "*" at the end for all submodules :checkhealth vim* - Refactor health.vim to use variable scope instead of output capturing - Create health.lua module to wrap report functions and future extensibility. - Move away from searching just in the runtimepath, use `nvim_get_runtime_file` due to #15632 Example: Plugin linter in rtp can declare it's checkhealts in lua module `lua/linter/health{/init}.lua` that returns a table with a method "check" that when executed calls the report functions provided by the builtin lua module require("health"). The plugin also has a submodule `/lua/linter/providers` in which it defines `/lua/linter/providers/health{/init}.lua` This plugin healthcheck can now be run by the ex command: `:checkhealth linter linter.providers` Also calling all submodules can be done by: `:checkhealth linter* And "linter" and "linter.provider" would be discovered when: `:checkhealth`
* Merge #15218 from gpanders/split-trimemptyJustin M. Keyes2021-10-03
|\ | | | | feat(lua): add "noempty" param to vim.split()
| * refactor: use kwargs parameter in vim.splitGregory Anders2021-09-25
| |
| * feat: add trimempty optional parameter to vim.splitGregory Anders2021-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `split()` VimL function trims empty items from the returned list by default, so that, e.g. split("\nhello\nworld\n\n", "\n") returns ["hello", "world"] The Lua implementation of vim.split does not do this. For example, vim.split("\nhello\nworld\n\n", "\n") returns {'', 'hello', 'world', '', ''} Add an optional parameter to the vim.split function that, when true, trims these empty elements from the front and back of the returned table. This is only possible for vim.split and not vim.gsplit; because vim.gsplit is an iterator, there is no way for it to know if the current item is the last non-empty item. Note that in order to preserve backward compatibility, the parameter for the Lua vim.split function is `trimempty`, while the VimL function uses `keepempty` (i.e. they are opposites). This means there is a disconnect between these two functions that may surprise users.
* | Merge pull request #15786 from gpanders/diagnostic-signs-unique-severityGregory Anders2021-10-02
|\ \
| * | refactor(diagnostics): always make 'set' go through 'show'Gregory Anders2021-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always make calls to `vim.diagnostic.set` call `vim.diagnostic.show`. This creates an easier to reason about code path and is also less surprising when users wish to override override `vim.diagnostic.show` with custom behavior and `vim.diagnostic.set` is called with empty diagnostics. Functionally, the end result is the same: when `show` is called with an empty diagnostics list, it just calls `hide` and then returns, which is exactly what `reset` does right now.
* | | docs(lsp): clarify parameters of some util functions (#15851)zeertzjq2021-10-02
| | | | | | | | | | | | `pad_left` and `pad_right` are unused List used keys of `opts` in `make_floating_popup_options`
* | | fix(float)!: always anchor to corner of window including border #15832zeertzjq2021-10-02
|/ / | | | | | | | | | | | | | | | | | | N, W, S, E are all inclusive, i.e., always anchor to the exact corner of the window (including border). This line may also need change in this case (change 0 to -1): This is most consistent and easiest to reason about, especially with GUIs whose border do not need to have width/height of 1/1 in cell units. Fix #15789
* | feat(diagnostics): add vim.diagnostic.get_namespaces (#15866)Michael Lingelbach2021-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many vim.diagnostic functions expect the user to pass in a namespace id. This PR allows the user to list active diagnostic namespaces: ```lua :lua print(vim.inspect(vim.diagnostic.get_namespaces())) { [7] = { name = "vim.lsp.client-1", opts = {}, sign_group = "vim.diagnostic.vim.lsp.client-1" } } ```
* | docs(diagnostics): add "priority" option to signs table (#15860)Gregory Anders2021-10-01
| | | | | | | | This feature was added in #15785, but the docs for vim.diagnostic.config() weren't updated.
* | feat(lsp): add codeAction/resolve support (#15818)Mathias Fußenegger2021-09-28
| | | | | | Closes https://github.com/neovim/neovim/issues/15339 and https://github.com/neovim/neovim/issues/15828
* | feat(lsp): add client command support to codelens (#15820)Mathias Fußenegger2021-09-28
| | | | | | | | Also adds a check against the server capabilities to fix https://github.com/neovim/neovim/issues/15183
* | refactor(lsp): remove json encode/decode wrappers (#15826)Mathias Fußenegger2021-09-28
| |
* | fix(ui): s/format_entry/format_item to match docs (#15819)Mathias Fußenegger2021-09-27
| | | | | | Follow up to https://github.com/neovim/neovim/pull/15771
* | feat(ui): add vim.ui.select and use in code actions (#15771)Mathias Fußenegger2021-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | Continuation of https://github.com/neovim/neovim/pull/15202 A plugin like telescope could override it with a fancy implementation and then users would get the telescope-ui within each plugin that utilizes the vim.ui.select function. There are some plugins which override the `textDocument/codeAction` handler solely to provide a different UI. With custom client commands and soon codeAction resolve support, it becomes more difficult to implement the handler right - so having a dedicated way to override the picking function will be useful.
* | fix(lsp): avoid serializing boolean as key (#15810)Michael Lingelbach2021-09-27
| | | | | | | | | | | | In vim.lsp.buf.references, the key vim.type_idx (which evaluates to a boolean) was set to equal vim.types.dictionary. This resulted in a boolean key in json which is not allowed by the json spec, and which lua-cjson fails to serialize.