This fixes issues where subsequent calls to vim.lsp.codelens.refresh()
would have no effect due to the buffer not getting cleared from the
active_refresh table.
Examples of how such scenarios would occur are:
- A textDocument/codeLens result yielded an error.
- The 'textDocument/codeLens' handler was overriden in such a way that
it no longer called vim.lsp.codelens.on_codelens().
(cherry picked from commit 94eb72cc44)
When yanking another range while previous yank is still highlighted, the
pending timer could clear the highlight almost immediately (especially
when using larger `timeout`, i.e. 2000)
Problem: Openscad files are not recognized.
Solution: Add a filetype pattern. (Niklas Adam, closesvim/vim#10199)
c360b2566c
(cherry picked from commit b49c1adb20)
Fix vim.lsp.buf.(range_)code_action() to only send diagnostics belonging
to the current buffer and not to other files in the workspace.
(cherry picked from commit e3d660e456)
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>
* fix(lsp): fix unnecessary buffers being added on empty diagnostics
Some language servers send empty `textDocument/publishDiagnostics`
messages after indexing the project, sometimes resulting in creation
of a lot of unnecessary buffers. As a workaround, skip empty messages
for nonexistent buffers before resolving the filename to a bufnr.
(cherry picked from commit 26eb6785eb)
* Add test
(cherry picked from commit d2e9dab377)
Co-authored-by: ii14 <ii14@users.noreply.github.com>
The LSP progress handler would put non-progress messages (such as from
clangd or pyls; not part of the LSP spec) directly into
`client.messages`, while `vim.lsp.util.get_progress_messages()` would
try to fetch them from `client.messages.messages` instead (and come up
empty everytime). This would result in these messages never being
cleaned up by `get_progress_messages()`.
This commit fixes that by treating those messages like show-once
progress messages (by setting `done=true` immediately).
(cherry picked from commit 2087960c76)
Co-authored-by: Patrice Peterson <patrice.peterson@mailbox.org>
`vim.keymap.del` takes an `opts` parameter that lets caller refer to and
delete buffer-local mappings. For some reason the implementation of
`vim.keymap.del` mutates the table that is passed in, setting
`opts.buffer` to `nil`. This is wrong and also undocumented.
(cherry picked from commit 51f33ae5c0)
* fix(treesitter): create new parser if language is not the same as cached parser
Fixes#18148
(cherry picked from commit 8e35894fc2)
* test: create new parser in vim.treesitter.get_parser() when filetype changes
(cherry picked from commit 30e7b3f0a2)
Co-authored-by: Chinmay Dalal <dalal.chinmay.0101@gmail.com>
Use nvim_exec_autocmds to issue the DiagnosticChanged autocommand,
rather than nvim_buf_call, which has some side effects when drawing
statuslines.
(cherry picked from commit 4a64ce140f)
Co-authored-by: Gregory Anders <greg@gpanders.com>
Problem: Supercollider filetype not recognized.
Solution: Match file extentions and check file contents to detect
supercollider. (closesvim/vim#10142)
8cac20ed42
Problem: HEEx and Surface templates do not need a separate filetype.
Solution: Use Eelixir for the similar filetypes. (Aaron Tinio, closesvim/vim#10124)
fa76a24109
Problem: Kuka Robot Language files not recognized.
Solution: Recognize *.src and *.dat files. (Patrick Meiser-Knosowski,
closesvim/vim#10096)
3ad2090316
Uses of `getline` in `filetype.lua` currently assume it always returns a
string. However, if the buffer is unloaded when filetype detection runs,
`getline` returns `nil`. Fixing this prevents errors when filetype
detection is run on unloaded buffers.
vim.tbl_get takes a table with subsequent string arguments (variadic) that
index into the table. If the value pointed to by the set of keys exists,
the function returns the value. If the set of keys does not exist, the
function returns nil.
The use of 'softtabstop' to set tabSize was introduced in 5d5b068,
replacing 'tabstop'. If we look past the name tabSize and at the actual
purpose of the field, it's the indentation width used when formatting.
This corresponds to the Vim option 'shiftwidth', not 'softtabstop'.
The latter has the comparatively mundane purpose of controlling what
happens when you hit the tab key (and even this is incomplete, as it
fails to account for 'smarttab').