aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
* fix(lsp): fix attempt to call non existent function (#24212)Sanchayan Maity2023-06-30
| | | | | | | | | | | | Commit 37079fc moved inlay_hint to vim.lsp() but in the process did missed converting a call to disable/enable which are now local. Fixes the below error when trying to toggle inlay hints. E5108: Error executing lua /usr/local/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:248: attempt to call field 'disable' (a nil value) stack traceback: /usr/local/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:248: in function 'toggle' /usr/local/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:310: in function 'inlay_hint' [string ":lua"]:1: in main chunk
* feat(lsp): move inlay_hint() to vim.lsp (#24130)Mathias Fußenegger2023-06-30
| | | | | | Allows to keep more functions hidden and gives a path forward for further inlay_hint related functions - like applying textEdits. See https://github.com/neovim/neovim/pull/23984#pullrequestreview-1486624668
* fix(lsp): inlay_hint nil reference error #24202Chinmay Dalal2023-06-29
| | | | | | | | | Problem: vim_lsp_inlayhint: Error executing lua: .../lsp/_inlay_hint.lua:249: attempt to index field 'applied' (a nil value) Solution: Assign {} to bufstates.applied in on_reload fixes #24172
* fix(treesitter): handle empty region when logging (#24173)Jaehwang Jung2023-06-27
|
* fix(treesitter): make foldexpr work without highlighting (#24167)Jaehwang Jung2023-06-27
| | | | | | | | | | | | | | | Problem: Treesitter fold is not updated if treesitter hightlight is not active. More precisely, updating folds requires `LanguageTree:parse()`. Solution: Call `parse()` before computing folds and compute folds when lines are added/removed. This doesn't guarantee correctness of the folds, because some changes that don't add/remove line won't update the folds even if they should (e.g. adding pair of braces). But it is good enough for most cases, while not introducing big overhead. Also, if highlighting is active, it is likely that `TSHighlighter._on_buf` already ran `parse()` (or vice versa).
* docs(diagnostic): return value of get() #24144NAKAI Tsuyoshi2023-06-27
|
* vim-patch:9.0.1668: PEM files are not recognized (#24169)ObserverOfTime2023-06-27
| | | | | | Problem: PEM files are not recognized. Solution: Add patterns to match PEM files. (closes vim/vim#12582) https://github.com/vim/vim/commit/0256d76a3392aef270b38d1cf7633008e45c2003
* vim-patch:9.0.1632: not all cabal config files are recognized (#24025)Jonas Strittmatter2023-06-26
| | | | | | | | | | | | | Problem: Not all cabal config files are recognized. Solution: Add a couple of patterns. (Marcin Szamotulski, closes vim/vim#12463) https://github.com/vim/vim/commit/166cd7b801ebe4aa042a9bbd6007d1951800aaa9 Also: - Do not expand Lua patterns in environment variables used in file patterns. - Test $XDG_CONFIG_HOME on Windows, as it can be used by Nvim (and the runner sets it). Co-authored-by: Marcin Szamotulski <coot@coot.me>
* Merge #24116 from justinmk/docJustin M. Keyes2023-06-25
|\
| * docs: autocmds, miscJustin M. Keyes2023-06-25
| |
| * fix(docs): vimdoc syntax errorsJustin M. Keyes2023-06-25
| | | | | | | | gen_help_html: truncate parse-error sample text
* | vim-patch:9.0.1661: BUCK files are not recognized (#24142)Christian Clason2023-06-24
| | | | | | | | | | | | | | | | Problem: BUCK files are not recognized. Solution: Recognize BUCK files as "bzl". (Son Luong Ngoc, closes vim/vim#12564) https://github.com/vim/vim/commit/b46e0f3263acd99c61df06ee3c4d1f6e0b471bc3 Co-authored-by: Son Luong Ngoc <sluongng@gmail.com>
* | Merge pull request #24082 from smjonas/fix_24064Christian Clason2023-06-24
|\ \ | | | | | | fix(filetype): correctly detect bash-fc-{id} files as "sh" (vim-patch:9.0.1644)
| * | fix(filetype): correctly detect bash-fc-{id} files as "sh"smjonas2023-06-23
| | |
* | | fix(lsp): error in reset_timer on second detach #24117Chinmay Dalal2023-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: On running `zig fmt` manually, the on_lines callback and the server both detach (for some reason), and both of them call `clear()`. This fixes it, otherwise the second one to detach has an error in `reset_timer` since the bufstate doesn't exist Solution: * exit early in clear if `bufstates[bufnr]` is nil * set bufstatte.enabled to true on reload instead of making bufstate nil
* | | build(luarc.json): disable luadoc-miss-see-name #24108Raphael2023-06-23
| | |
* | | fix(lsp): reapplying already-applied hints #24114Chinmay Dalal2023-06-23
| |/ |/| | | | | | | | | | | | | | | Problem: The decoration provider clears the whole buffer then redraws all the hints every time the window was redrawn. This may lead to an infinite loop. Solution: Store the last applied version for a line and only clear and redraw the line if the buffer version has changed.
* | feat(lsp): opt-in to dynamicRegistration for inlay hints (#24102)Mathias Fußenegger2023-06-22
| | | | | | | | | | Since https://github.com/neovim/neovim/pull/23681 there is dynamic registration support. We should use that for new features unless there is a good reason to turn it off.
* | vim-patch:9.0.1645: zserio files are not recognized (#24120)Christian Clason2023-06-22
| | | | | | | | | | | | | | | | | | Problem: zserio files are not recognized. Solution: Add a pattern for zserio files. (Dominique Pellé, closes vim/vim#12544) https://github.com/vim/vim/commit/2b994da57a0ac6ec0ec09fe3783f48ecd2bce610 Co-authored-by: =?UTF-8?q?Dominique=20Pell=C3=A9?= <dominique.pelle@gmail.com>
* | feat(lsp): soft deprecate vim.lsp.for_each_buffer_client (#24104)Mathias Fußenegger2023-06-22
| | | | | | | | | | | | | | There is no need for two ways to access all clients of a buffer. This doesn't add a `vim.deprecate` call yet, as the function is probably used a lot, but removes it from the documentation and annotates it with `@deprecated`
* | test: spellcheck :help (vimdoc) files #24109Justin M. Keyes2023-06-22
| | | | | | | | | | | | | | Enforce consistent terminology (defined in `gen_help_html.lua:spell_dict`) for common misspellings. This does not spellcheck English in general (perhaps a future TODO, though it may be noisy).
* | perf(lsp): remove grouping logic from lsp.status (#24096)Mathias Fußenegger2023-06-22
| | | | | | | | With the title carry-over logic in the `$/progress` handler it's not necessary to group again in vim.lsp.status
* | fix: tostring(vim.version()) fails if build is NIL #24097Julian Grinblat2023-06-22
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Since #23925, Version.build may be vim.NIL, which causes tostring() to fail: E5108: Error executing lua E5114: Error while converting print argument #1: …/version.lua:129: attempt to concatenate field 'build' (a userdata value) stack traceback: [C]: in function 'print' [string ":lua"]:1: in main chunk Solution: Handle vim.NIL in Version:__tostring().
* | refactor(lsp): report full Nvim version string in clientInfoJustin M. Keyes2023-06-21
| |
* | fix(lsp): add spacing for inlay hints separately #24079Akin2023-06-21
|/ | | | | | | | | | | | | | | | | | | | | | | | | Problem: Spacing around inlay hints has the same highlight as the hint itself. The LSP spec for inlay hints specifically mentions the padding should not be coloured: /** Render padding before the hint. Note: Padding should use the editor's background color, not the background color of the hint itself. That means padding can be used to visually align/separate an inlay hint. */ paddingLeft?: boolean; /** Render padding after the hint. Note: Padding should use the editor's background color, not the background color of the hint itself. That means padding can be used to visually align/separate an inlay hint. */ paddingRight?: boolean; Solution: Add the space as separate parts of the virtual text, don't add the space to the text itself.
* fix(lsp): always return boolean in lsp.buf_client_attach (#24077)Sooryakiran Ponnath2023-06-20
| | | Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
* fix(lsp): check if inlay hints are enabled for a buffer before disabling ↵Chinmay Dalal2023-06-20
| | | | | | (#24074) disabling before enabling throws an error otherwise, because bufstate[bufnr] doesn't exist
* refactor(lsp): extract common execute command functionality (#24065)Mathias Fußenegger2023-06-20
|
* fix(lsp): duplicate on_detach, on_reload callbacks #24067Chinmay Dalal2023-06-20
| | | | M.enable already clears bufstate[bufnr] and the namespace, the duplicate callbacks cause an error (indexing bufstate[bufnr] fails)
* feat(lsp): inlay hints #23984Chinmay Dalal2023-06-19
| | | | | | | | | | | Add automatic refresh and a public interface on top of #23736 * add on_reload, on_detach handlers in `enable()` buf_attach, and LspDetach autocommand in case of manual detach * unify `__buffers` and `hint_cache_by_buf` * use callback bufnr in `on_lines` callback, bufstate: remove __index override * move user-facing functions into vim.lsp.buf, unify enable/disable/toggle Closes #18086
* docs #24061Justin M. Keyes2023-06-19
| | | | | | | | | | | | | | - nvim requires rpc responses in reverse order. https://github.com/neovim/neovim/issues/19932 - NVIM_APPNAME: UIs normally should NOT set this. ref #23520 fix #24050 fix #23660 fix #23353 fix #23337 fix #22213 fix #19161 fix #18088 fix #20693
* docs #22363Justin M. Keyes2023-06-19
| | | | | | | | | Co-authored by: zeertzjq <zeertzjq@outlook.com> Co-authored by: Steven Todd McIntyre II <114119064+stmii@users.noreply.github.com> Co-authored by: nobe4 <nobe4@users.noreply.github.com> - docs: mention --luadev-mod to run with lua runtime files When changing a lua file in the ./runtime folder, a new contributor might expect changes to be applied to the built Neovim binary.
* fix(treesitter): use vim.highlight.priorities instead of hardcoded 100 (#24052)Santos Gallegos2023-06-18
| | | | | Problem: Treesitter highlighting base priority cannot be customized. Solution: Use `vim.highlight.priorities.treesitter` instead of hard-coded value.
* fix(fs): make `normalize()` work with '/' path (#24047)Evgeni Chasnovski2023-06-18
| | | | | | | Problem: Current implementation of "remove trailing /" doesn't account for the case of literal '/' as path. Solution: Remove trailing / only if it preceded by something else. Co-authored by: notomo <notomo.motono@gmail.com>
* fix(lsp): allow Lua pattern chars in code action filter (#24041)Jonas Strittmatter2023-06-17
| | | | | | | Previously, filtering code actions with the "only" option failed if the code action kind contained special Lua pattern chars such as "-" (e.g. the ocaml language server supports a "type-annotate" code action). Solution: use string comparison instead of string.find
* perf(lsp): reduce polling handles for workspace/didChangeWatchedFiles (#23500)Jon Huhn2023-06-14
| | | Co-authored-by: Lewis Russell <lewis6991@gmail.com>
* fix(codelens): add buffer and line checks before displaying codelens (#23887)Rohit Sukumaran2023-06-13
| | | Co-authored-by: Rohit Sukumaran <rohit.sukumaran@kredx.com>
* fix(lsp): handle stale bufnr on LspRequest autocmd trigger (#24013)Mathias Fußenegger2023-06-13
| | | | | | Fixes a `Invalid buffer id: 123` race when the buffer gets deleted before the callback triggered. Alternative to https://github.com/neovim/neovim/pull/23981
* docs: various clarifications (#23999)zeertzjq2023-06-12
| | | | | Close #18907 Close #20314 Close #23749
* Merge #23954 vim.version() returns Version objectJustin M. Keyes2023-06-11
|\
| * feat: tostring(vim.version())Justin M. Keyes2023-06-12
| | | | | | | | | | | | | | | | | | | | Problem: tostring(vim.version()) returns "table: 0x…". Solution: Modify vim.version() to return a string prerelease instead of a boolean. Fix #23863
| * feat: vim.version() returns a Version objectGianmaria Bajo2023-06-12
| | | | | | | | | | | | - vim.version() returns a Version object. Makes it printable and removes the need of workarounds when passing it to other vim.version methods.
* | docs: fix vim.tbl_get type annotations #23992Stanislav Asunkin2023-06-11
|/
* refactor(treesitter): use npcall in _query_linter.lua #23985Stephan Seitz2023-06-11
|
* fix(remote): restore previous --remote-expr output formatting (#23988)zeertzjq2023-06-11
| | | | - Use tostring() as that's what print() uses internally. - Do not append trailing new line.
* feat(lsp): add handlers for inlay hints (#23736)Chinmay Dalal2023-06-11
| | | initial support; public API left for a follow-up PR
* fix(remote): make --remote-expr print to stdout (#23980)zeertzjq2023-06-11
|
* feat(lua): use callable table as iterator in vim.iter (#23957)Mathias Fußenegger2023-06-10
| | | | A table passed to `vim.iter` can be a class instance with a `__call` implementation for the iterator protocol.
* fix(lsp): use percentage format on lsp.status (#23971)Raphael2023-06-10
|
* docs: fix typos (#23917)Jonas Strittmatter2023-06-10
|