| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
|
| |
vim.lsp.start_client() may fail (for example if the `cmd` is not
executable). It produces a nice error notification in this case. Passing
the `nil` value returned from an erroneous `vim.lsp.start_client()` call
into `vim.lsp.buf_attach_client()` causes a meaty param validate
exception message. Avoid this.
|
|
|
|
|
|
|
|
|
|
|
| |
Issuing a server request triggers `changetracking.flush` so as to
make sure we're not operating on a stale state. This immediately
triggers notification of any pending changes (as a result of debouncing)
to the server. However, this happens in addition to the notification
that is waiting on the debounce delay. Because we `nil`
`buf_state.pending_change` when it is called, the fix is to
also check that this is non-`nil` when it is called and exit if it is,
as this being `nil` would mean that it originates from a pending change
that has already been flushed out.
|
|
|
| |
set `tagfunc` to `vim.lsp.tagfunc` and `omnifunc` to `vim.lsp.omnifunc` if empty when attaching a server
|
|
|
| |
fixup for #19283
|
|
|
|
|
|
| |
Problem: Csv and tsv files are not recognized.
Solution: Add patterns fo csv and tsv files. (Leandro Lourenci,
closes vim/vim#10680)
https://github.com/vim/vim/commit/99af91e5820c78a196c9272cd8ce5aa5be7bf374
|
| |
|
|
|
| |
Signed-off-by: Raphael <glephunter@gmail.com>
|
|
|
|
|
|
| |
* revert to filetype.vim by setting `g:do_legacy_filetype`
* skip either filetype.lua or filetype.vim via `g:did_load_filetypes`
(Running both is no longer required and therefore no longer supported.)
|
|
|
|
| |
* reformat Lua runtime to make lint CI pass
* reduce max line length to 100
|
|
|
|
|
| |
For example on MacOS, /etc/hostname.file is symlinked to
/private/etc/hostname.file. We only care about the original file path though.
|
| |
|
|
|
|
|
|
| |
Problem: Missing change for filetype detection.
Solution: Include change to detect guile from shebang line.
https://github.com/vim/vim/commit/324478037923feef1eb8a771648e38ade9e5e05a
|
|
|
|
|
|
| |
Problem: A couple of filetype patterns do not have "*" before "/etc".
Solution: Add the star. (Jonas Strittmatter, closes vim/vim#10662)
https://github.com/vim/vim/commit/704988f0c3598c1b0cc47f3b46f1f1229312f2bc
|
| |
|
|
|
|
|
| |
Problem: Signature files not detected properly.
Solution: Add a function to better detect signature files. (Doug Kearns)
https://github.com/vim/vim/commit/cdbfc6dbab1d63aa56af316d6b13e37939e7f7a8
|
|
|
| |
These were not updated in #18895.
|
|
|
|
|
|
|
|
|
| |
This fixes the following bugs:
`${1:else_text}` -> format with if_text: "else_text"
`${1:-else_text}` -> format with if_text: "else_text"
`${1:}` in `format` (eg. empty else_text) -> error.
`${1:}` (eg. empty placeholder) -> error.
Thanks hrsh7th :)
|
|
|
|
|
| |
Problem: Not all Visual Basic files are recognized.
Solution: Change detection of *.cls files. (Doug Kearns)
https://github.com/vim/vim/commit/8b5901e2f9466eb6f38f5b251e871f609f65e252
|
|
|
|
|
| |
Problem: Hare files are not recognized.
Solution: Add a filetype pattern. (Hugo Osvaldo Barrera, closes vim/vim#10630)
https://github.com/vim/vim/commit/040674129f3382822eeb7b590380efa5228124a8
|
|
|
| |
Fix #18143
|
| |
|
|
|
|
|
|
|
| |
This is necessary in cases where filetype detection acts recursively.
For example, when matching files that end with .bak, the "root" of
the filename is matched again against the same buffer (e.g. a buffer
named "foo.c.bak" will be matched again with the filename "foo.c", using
the same underlying buffer).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#18895)
This enables vim.filetype.match to match based on a buffer (most
accurate) or simply a filename or file contents, which are less accurate
but may still be useful for some scenarios.
When matching based on a buffer, the buffer's name and contents are both
used to do full filetype matching. When using a filename, if the file
exists the file is loaded into a buffer and full filetype detection is
performed. If the file does not exist then filetype matching is only
performed against the filename itself. Content-based matching does the
equivalent of scripts.vim, and matches solely based on file contents
without any information from the name of the file itself (e.g. for
shebangs).
BREAKING CHANGE: use `vim.filetype.match({buf = bufnr})` instead
of `vim.filetype.match(name, bufnr)`
|
|
|
|
| |
This re-introduces the fix that the filetype.lua refactor inadvertently reverted.
The fix ensures that in the case when end_lnum is omitted, a string is always returned.
|
|
|
|
| |
Move some filetype detection functions to detect.lua,
sort patterns by detected filetype.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`nvim_get_option_value` and `nvim_set_option_value` better handle
unsetting local options. For instance, this is currently not possible:
vim.bo.tagfunc = nil
This does not work because 'tagfunc' is marked as "local to buffer" and
does not have a fallback global option. However, using :setlocal *does*
work as expected
:setlocal tagfunc=
`nvim_set_option_value` behaves more like :set and :setlocal (by
design), so using these as the underlying API functions beneath vim.bo
and vim.wo makes those two tables act more like :setlocal. Note that
vim.o *already* uses `nvim_set_option_value` under the hood, so that
vim.o behaves like :set.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Steps to reproduce:
1. setting `vim.highlight.on_yank`
```
vim.api.nvim_create_autocmd({ "TextYankPost" }, {
pattern = { "*" },
callback = function()
vim.highlight.on_yank({ timeout = 200 })
end,
})
```
2. repeat typing `yeye` ...
3. causes the following error.
```
Error executing vim.schedule lua callback: vim/_editor.lua:0: handle 0x01e96970 is already closing
stack traceback:
[C]: in function 'close'
vim/_editor.lua: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
```
📝 Test result before fix:
[----------] Global test environment setup.
[----------] Running tests from test/functional/lua/highlight_spec.lua
[ RUN ] vim.highlight.on_yank does not show errors even if buffer is wiped before timeout: 15.07 ms OK
[ RUN ] vim.highlight.on_yank does not show errors even if executed between timeout and clearing highlight: 15.07 ms ERR
test/helpers.lua:73: Expected objects to be the same.
Passed in:
(string) 'Error executing vim.schedule lua callback: vim/_editor.lua:0: handle 0x02025260 is already closing
stack traceback:
[C]: in function 'close'
vim/_editor.lua: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>'
Expected:
(string) ''
|
|
|
|
|
|
|
| |
docs: fix typos and similarly insignificant changes
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Co-authored-by: kanreki <32443233+kanreki@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
| |
Many filetypes from filetype.vim set buffer-local variables, meaning
vim.filetype.match cannot be used without side effects. Instead of
setting these buffer-local variables in the filetype detection functions
themselves, have vim.filetype.match return an optional function value
that, when called, sets these variables. This allows vim.filetype.match
to work without side effects.
|
| |
|
|
|
|
| |
(#18814)
|
|
|
| |
Fixes https://github.com/neovim/neovim/issues/18860
|
|
|
|
|
| |
This call alone is responible of 40 000 000 out of 80 000 000
individual alloc/free calls in the test suite.
|
| |
|
|
|
|
|
| |
Problem: No good filetype for conf files similar to dosini.
Solution: Add the confini filetype. (closes vim/vim#10510)
https://github.com/vim/vim/commit/635f48010dcf6d97f3a65b4785e1726ad386d3eb
|
|
|
|
|
|
|
|
|
|
| |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Dan Sully <dan+github@sully.org>
Co-authored-by: saher <msaher.shair@gmail.com>
Co-authored-by: Stephan Seitz <stephan.seitz@fau.de>
Co-authored-by: Benedikt Müller <d12bb@posteo.de>
Co-authored-by: Andrey Mishchenko <mishchea@gmail.com>
Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
Co-authored-by: Oliver Marriott <hello@omarriott.com>
|
| |
|
|
|
|
|
|
|
| |
Most LSP servers require the notification to correctly load the
settings and for those who don't it doesn't cause any harm.
So far this is done in lspconfig, but with the addition of vim.lsp.start
it should be part of core.
|
|
|
|
|
|
|
|
|
|
|
|
| |
A alternative/subset of https://github.com/neovim/neovim/pull/18506 that should be forward compatible with a potential project system.
Configuration of LSP clients (without lspconfig) now looks like this:
vim.lsp.start({
name = 'my-server-name',
cmd = {'name-of-language-server-executable'},
root_dir = vim.fs.dirname(vim.fs.find({'setup.py', 'pyproject.toml'}, { upward = true })[1]),
})
|
|
|
| |
fixes injections for string parsers after https://github.com/neovim/neovim/commit/eab4d03a3264b2afaf803ed839fa25bc4e7acedd
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
| |
Fix a bug in lsp.buf.rename() where the range returned by the server in
textDocument/prepareRename was interpreted as a byte range directly,
instead of taking the negotiated offset encoding into account. This
caused the placeholder value in vim.ui.input to be incorrect in some
cases, for example when non-ascii characters are used earlier on the
same line.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
https://github.com/neovim/neovim/pull/18720#issuecomment-1142614996
The vim.health module is detected as a healthcheck, which produces spurious errors:
vim: require("vim.health").check()
========================================================================
- ERROR: Failed to run healthcheck for "vim" plugin. Exception:
function health#check, line 20
Vim(eval):E5108: Error executing lua [string "luaeval()"]:1: attempt to call field 'check' (a nil value)
stack traceback:
[string "luaeval()"]:1: in main chunk
Solution:
Skip vim.health when discovering healthchecks.
|
| |
|
|
|
|
|
| |
This is a pure Lua implementation of the Vim findfile() and finddir()
functions without the special syntax.
|
|
|
|
|
| |
This function is modeled after the path.dir() function from Penlight and
the luafilesystem module.
|
| |
|
| |
|