Commit Graph

898 Commits

Author SHA1 Message Date
William Boman
f2b465232d fix(lsp): make sure to always reset active codelens refreshes (#18331)
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)
2022-06-25 12:31:58 +02:00
Mathias Fussenegger
b3d754ccd7 fix(lsp): fix multi client handling in code action (#18869)
Fixes https://github.com/neovim/neovim/issues/18860

(cherry picked from commit e4df1c9b9e)
2022-06-25 12:22:17 +02:00
github-actions[bot]
ed9e6d19ab [Backport release-0.7] fix(treesitter): new iter if folded (#18990)
fix(treesitter): new iter if folded

(cherry picked from commit 8780076a78)

Co-authored-by: kevinhwang91 <kevin.hwang@live.com>
2022-06-16 19:08:48 +02:00
notomo
fe42dea674 fix(lua): highlight.on_yank can close timer in twice #18976
check whether timer is closing in vim.defer_fn before closing
2022-06-16 12:27:59 +02:00
Wsevolod
f15d6094fc fix(lua): stop pending highlight.on_yank timer, if any (#18824)
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)
2022-06-16 12:26:03 +02:00
Christian Clason
b43eed7d91 vim-patch:8.2.4767: openscad files are not recognized
Problem:    Openscad files are not recognized.
Solution:   Add a filetype pattern. (Niklas Adam, closes vim/vim#10199)
c360b2566c
(cherry picked from commit b49c1adb20)
2022-05-26 01:57:19 +00:00
github-actions[bot]
cb1b4bbeae fix(lsp): only send diagnostics from current buffer in code_action() (#18655)
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>
2022-05-21 16:02:38 +02:00
github-actions[bot]
f3ffb73b18 fix(health): return 0 if file not exists (#18612)
(cherry picked from commit 1d000e8248)

Co-authored-by: noval <noval.dev@protonmail.com>
2022-05-17 20:44:15 +02:00
github-actions[bot]
35075dcc22 [Backport release-0.7] fix(lsp): fix unnecessary buffers being added on empty diagnostics (#18469)
* 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>
2022-05-08 11:27:30 +02:00
github-actions[bot]
9e040acfa3 fix(lsp): unify progress message handling (#18468)
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>
2022-05-08 11:27:22 +02:00
github-actions[bot]
f179729789 refactor(lua): replace hard-coded gsub with vim.pesc() (#18410)
(cherry picked from commit b4c7f763f9)

Co-authored-by: James McCoy <jamessan@jamessan.com>
2022-05-04 08:57:41 +02:00
Jose Alvarez
d165289055 fix(lsp): add missing bufnr argument
(cherry picked from commit 80cea05de0)
2022-05-03 14:29:08 +00:00
James McCoy
631393a712 fix(filetype.lua): escape expansion of ~ when used as a pattern
(cherry picked from commit 88595fbb21)
2022-05-02 15:02:23 +00:00
github-actions[bot]
08cd391047 [Backport release-0.7] fix(shared): avoid indexing unindexable values in vim.tbl_get() (#18360)
* fix(shared): avoid indexing unindexable values in vim.tbl_get()

(cherry picked from commit 95ec38dc8d)

* test: add more unindexable types

(cherry picked from commit 7dccdefce4)

Co-authored-by: William Boman <william@redwill.se>
2022-05-02 13:40:49 +02:00
Andrey Mishchenko
d916d2f876 fix(lua): don't mutate opts parameter of vim.keymap.del (#18227)
`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)
2022-04-23 08:03:06 +08:00
github-actions[bot]
f7e2ad7915 [Backport release-0.7] fix(treesitter): create new parser if language is not the same as cached parser (#18220)
* 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>
2022-04-22 16:47:00 +02:00
github-actions[bot]
7f8faac39e fix(diagnostic): use nvim_exec_autocmds to trigger DiagnosticChanged (#18205)
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>
2022-04-21 07:07:03 -06:00
atusy
c8f01db8f6 docs: vim.keymap.set can specify buffer as an option
(cherry picked from commit 5ecbbba6ee)
2022-04-21 09:32:27 +00:00
Eden Zhang
c3623fcda6 fix(paste): ignore mappings in Cmdline mode (#18114)
(cherry picked from commit 813ecdac79)
2022-04-18 07:40:06 +08:00
dundargoc
e63e5d1dbd docs: typo fixes (#17859)
Co-authored-by: Elias Alves Moura <eliamoura.alves@gmail.com>
Co-authored-by: venkatesh <shariharanvenkatesh@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Vikas Raj <24727447+numToStr@users.noreply.github.com>
Co-authored-by: Steve Vermeulen <sfvermeulen@gmail.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: rwxd <rwxd@pm.me>
Co-authored-by: casswedson <58050969+casswedson@users.noreply.github.com>
2022-04-15 12:35:06 +02:00
Fredrik Ekre
6160973f36 fix(lsp): fix lookup of boolean values in workspace/configuration (#18026) 2022-04-15 11:12:41 +02:00
Christian Clason
9938740ca6 vim-patch:8.2.4746: supercollider filetype not recognized (#18102)
Problem:    Supercollider filetype not recognized.
Solution:   Match file extentions and check file contents to detect
            supercollider. (closes vim/vim#10142)
8cac20ed42
2022-04-13 17:04:38 +02:00
Tony Fettes
392cb7ac0c fix(lsp): pass offset_encoding in formatexpr() (#18084) 2022-04-11 12:44:31 -07:00
zeertzjq
2dc86ef3b2 vim-patch:8.2.4733: HEEx and Surface do need a separate filetype
Problem:    HEEx and Surface do need a separate filetype.
Solution:   Revert 8.2.4729. (closes vim/vim#10147)
4232dff815
2022-04-11 18:40:46 +08:00
Christian Clason
b438bb4343 vim-patch:8.2.4729: HEEx and Surface templates do not need a separate filetype (#18065)
Problem:    HEEx and Surface templates do not need a separate filetype.
Solution:   Use Eelixir for the similar filetypes. (Aaron Tinio, closes vim/vim#10124)
fa76a24109
2022-04-10 13:53:33 +02:00
Christian Clason
61bd5426f4 vim-patch:8.2.4721: cooklang files are not recognized (#18058)
Problem:    Cooklang files are not recognized.
Solution:   recognize *.cook files. (Goc Dundar, closes vim/vim#10120)
36951ed1da
2022-04-09 17:43:33 +02:00
Christian Clason
3280dc2b60 vim-patch:8.2.4720: ABB Rapid files are not recognized properly (#18057)
Problem:    ABB Rapid files are not recognized properly.
Solution:   Add checks for ABB Rapid files. (Patrick Meiser-Knosowski,
            closes #10104)
b09c320039
2022-04-09 17:42:46 +02:00
Christian Clason
8055f9857b vim-patch:8.2.4715: Vagrantfile not recognized (#18052)
Problem:    Vagrantfile not recognized.
Solution:   Recognize Vagrantfile as ruby. (Julien Voisin, closes vim/vim#10119)
5e1792270a
2022-04-09 11:19:18 +02:00
Christian Clason
8c25dbff46 vim-patch:8.2.4708: PHP test files are not recognized (#18025)
Problem:    PHP test files are not recognized.
Solution:   Add the *.phpt pattern. (Julien Voisin, closes vim/vim#10112)
177847e67a
2022-04-07 20:24:55 +02:00
Christian Clason
f85f4e25d2 vim-patch:8.2.4701: Kuka Robot Language files not recognized (#18012)
Problem:    Kuka Robot Language files not recognized.
Solution:   Recognize *.src and *.dat files. (Patrick Meiser-Knosowski,
            closes vim/vim#10096)
3ad2090316
2022-04-07 09:09:08 +02:00
Christian Clason
e45d141e28 vim-patch:8.2.4664: Elvish files are not recognized (#17963)
Problem:    Elvish files are not recognized.
Solution:   Recognize .elv files. (Bruno Roque, closes vim/vim#10058)
c1658a196b
2022-04-02 13:36:19 +02:00
Lewis Russell
3cc29b7f0d fix(keymap): don't coerce false to '' 2022-04-01 09:09:30 +01:00
bfredl
dc48330b9d Merge pull request #17842 from lewis6991/keymap
feat(keymap): return nil from an expr keymap
2022-04-01 00:48:46 +02:00
Christian Clason
38ba2a75fc vim-patch:8.2.4658: org-mode files are not recognized (#17939)
Problem:    Org-mode files are not recognized.
Solution:   Add patterns to recognize "org" files. (closes vim/vim#10046)
3a6f952cc8
2022-03-31 22:16:25 +02:00
Christian Clason
2e85af47d2 feat(runtime): add query filetype (#17905)
used for Tree-sitter queries
uses Lisp runtime files

(in Lua to distinguish from upstream runtime files)
2022-03-31 08:46:45 -06:00
Gregory Anders
6d648f5594 feat(treesitter): add more default groups to highlight map (#17835)
This covers some default groups listed in :h group-name.
2022-03-30 22:14:20 +02:00
Andrea Cappuccio
a18c9ba2da docs(lsp): remove outdated offset_encoding default value for apply_text_edits 2022-03-30 21:04:17 +02:00
Jaehwang Jung
4d3acd6beb fix(lsp): use "text" filetype for plaintext (#17898) 2022-03-28 09:16:11 -07:00
Smitesh Patil
a8e2c45b94 fix(diagnostic): make open_float respect global diagnostic options (#17879)
* make `open_float` respect `scope` option set in `vim.diagnostic.config`
* Closes #17878
2022-03-27 08:10:03 -06:00
Jared Weakly
5e64d65df6 fix(filetype.lua): always return a string in getline helper function (#17852)
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.
2022-03-25 12:12:00 -06:00
Michael Lingelbach
69f1de86dc feat: add vim.tbl_get (#17831)
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.
2022-03-24 12:01:04 -07:00
Lewis Russell
58140a9428 feat(keymap): return nil from an expr keymap
For Lua callback expr keymaps, returning `nil` or `false` is equivalent
to an empty string
2022-03-24 13:59:20 +00:00
bfredl
e7391191e2 Merge pull request #17776 from bfredl/tsconceal
feat(ui): allow conceal to be defined in decorations
2022-03-20 18:59:20 +01:00
Tim Pope
af427dedf6 fix(lsp): set tabSize from 'shiftwidth', not 'softtabstop' (#17787)
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').
2022-03-20 10:41:46 -07:00
bfredl
6eca9b69c4 feat(ui): allow conceal to be defined in decorations
Unlike syntax conceal, change highlight of concealed char

Can be used in tree-sitter using "conceal" metadata.
2022-03-20 18:02:41 +01:00
dundargoc
d238b8f600 chore: fix typos (#17670)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-03-17 13:21:24 +08:00
Jade Lovelace
5a8bf31d32 vim-patch:8.2.4571: not all gdb files are recognized (#17727)
Problem:    Not all gdb files are recognized.
Solution:   Add a few more patterns for gdb.
            (closes https://github.com/vim/vim/pull/9956)
8d5e514d77
2022-03-15 22:46:32 +01:00
zeertzjq
e263afc0e9 fix(paste): escape control characters in Cmdline mode 2022-03-15 18:15:18 +08:00
zeertzjq
a6eafc77ce fix(paste): deal with trailing new line in chunk 2022-03-15 18:15:18 +08:00
zeertzjq
fcc6f66cf2 fix(paste): avoid edges cases caused by empty chunk 2022-03-15 18:15:18 +08:00