forked from neovim/neovim
-
Notifications
You must be signed in to change notification settings - Fork 0
Merge markdown diagnostic changes to neovim master #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
s1n7ax
wants to merge
2,221
commits into
MariaSolOs:poc
Choose a base branch
from
s1n7ax:diagnostic_float_md
base: poc
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CID 516406: Error handling issues (CHECKED_RETURN)
/src/nvim/api/vimscript.c: 284 in nvim_call_dict_function()
278 Object rv = OBJECT_INIT;
279
280 typval_T rettv;
281 bool mustfree = false;
282 switch (dict.type) {
283 case kObjectTypeString:
>>> CID 516406: Error handling issues (CHECKED_RETURN)
>>> Calling "eval0" without checking return value (as is done elsewhere 10 out of 12 times).
284 TRY_WRAP(err, {
285 eval0(dict.data.string.data, &rettv, NULL, &EVALARG_EVALUATE);
286 clear_evalarg(&EVALARG_EVALUATE, NULL);
287 });
288 if (ERROR_SET(err)) {
289 return rv;
Problem: Language server version information missing from `:checkhealth vim.lsp`. Solution: Store `InitializeResult.serverInfo.version` from the `initialize` response and display for each client in `:checkhealth vim.lsp`.
…ders neovim#31608 Problem: regression since neovim#31340 `nvim -l repro.lua`: ```lua vim.lsp.start { cmd = { 'lua-language-server' }, name = 'lua_ls' } vim.lsp.start { cmd = { 'lua-language-server' }, name = 'lua_ls', root_dir = 'foo' } -- swapped case will be ok: -- vim.lsp.start { cmd = { 'lua-language-server' }, name = 'lua_ls', root_dir = 'foo' } -- vim.lsp.start { cmd = { 'lua-language-server' }, name = 'lua_ls' } ``` Failure: ``` E5113: Error while calling lua chunk: /…/lua/vim/lsp.lua:214: bad argument neovim#1 to 'ipairs' (table expected, got nil) stack traceback: [C]: in function 'ipairs' /…/lua/vim/lsp.lua:214: in function 'reuse_client' /…/lua/vim/lsp.lua:629: in function 'start' repro.lua:34: in main chunk ```
- Replace all uses of vim.regex with simpler Lua patterns. - Replace all uses of vim.fn.substitute with string.gsub. - Rework error handling so expected errors are passed back via a return. - These get routed up an passed to `vim.notify()` - Any other errors will cause a stack trace. - Reworked the module initialization of `localfile_arg` - Updated all type annotations. - Refactored CLI completion by introduction a parse_cmdline() function. - Simplified `show_toc()` - Refactor highlighting - Inline some functions - Fix completion on MacOS 13 and earlier. - Prefer `manpath -q` over `man -w` - Make completion more efficient by avoiding vim.fn.sort and vim.fn.uniq - Reimplement using a single loop
…d text (neovim#31628) Problem: ComplMatchIns highlight doesn't end after inserted text. Solution: Handle ComplMatchIns highlight more like search highlight. Fix off-by-one error. Handle deleting text properly. (zeertzjq) closes: vim/vim#16244 vim/vim@f25d8f9
…vim#31627 Also avoid going down message callstack with empty message, and remove expected grid for some tests where it did not change, and we are just testing for expected messages.
Problem: `termopen` has long been a superficial wrapper around `jobstart`, and has no real purpose. Also, `vim.system` and `nvim_open_term` presumably will replace all features of `jobstart` and `termopen`, so centralizing the logic will help with that. Solution: - Introduce `eval/deprecated.c`, where all deprecated eval funcs will live. - Introduce "term" flag of `jobstart`. - Deprecate `termopen`.
…1645) Problem: Missing cmdline completion for :pbuffer. Solution: Add cmdline completion for :pbuffer like :buffer. (zeertzjq) fixes: vim/vim#16250 closes: vim/vim#16251 vim/vim@3baf19a
…ovim#31648) closes: vim/vim#16248 vim/vim@c363ca1 Co-authored-by: Luca Saccarola <[email protected]>
The maximum signed value on 32-bit systems is 2 ^ 31 - 1. When using 2 ^ 31 for the default timeout, the value would overflow on such systems resulting in a negative value, which caused a stack trace when calling wait() without a timeout.
CID 516419: Integer handling issues (INTEGER_OVERFLOW)
/src/nvim/message.c: 2242 in msg_puts_display()
2236 }
2237 // Concat pieces with the same highlight
2238 size_t len = maxlen < 0 ? strlen(str) : strnlen(str, (size_t)maxlen);
2239 ga_concat_len(&msg_ext_last_chunk, str, len);
2240 msg_ext_cur_len += len;
2241 // When message ends in newline, reset variables used to format message: msg_advance().
>>> CID 516419: Integer handling issues (INTEGER_OVERFLOW)
>>> Expression "len - 1UL", which is equal to 18446744073709551615, where "len" is known to be equal to 0, underflows the type that receives it, an unsigned integer 64 bits wide.
2242 if (str[len - 1] == '\n') {
2243 msg_ext_cur_len = 0;
2244 msg_col = 0;
2245 }
2246 return;
2247 }
…ovim#31662) closes: vim/vim#16266 vim/vim@c673b80 Co-authored-by: shane.xb.qian <[email protected]>
Problem: filetype: fennelrc files are not recognized
Solution: detect 'fennelrc' files as fennel filetype
(Wu Zhenyu)
References:
bakpakin/Fennel#193
closes: vim/vim#16262
vim/vim@f173f42
Co-authored-by: Wu, Zhenyu <[email protected]>
…yntax script fixes: vim/vim#16268 vim/vim@70881ba Co-authored-by: Christian Brabandt <[email protected]>
busted: 2.1.1 -> 2.2.0 https://github.com/lunarmodules/busted/releases/tag/v2.1.2 https://github.com/lunarmodules/busted/releases/tag/v2.2.0 luacheck: 1.1.0 -> 1.2.0 https://github.com/lunarmodules/luacheck/releases/tag/v1.1.1 https://github.com/lunarmodules/luacheck/releases/tag/v1.1.2 https://github.com/lunarmodules/luacheck/releases/tag/v1.2.0
Problem: LSP configs on the runtimepath must have the same name as the LSP server and must also explicitly set the name in vim.lsp.config. This is redundant and creates a footgun where a user may accidentally use the wrong name when assigning to the vim.lsp.config table. Solution: Return a table from lsp/ runtimepath files instead
It's probably not worth adding the C test files to regular formatting as they're pretty much never touched, but ensuring the files are formatted according to our standards and getting rid of warnings is a cheap one-time fix.
Problem: filetype: jshell files are not recognized
Solution: detect '*.jsh' files as java filetype
(Konfekt)
closes: vim/vim#16260
vim/vim@62e3014
Co-authored-by: Konfekt <[email protected]>
Problem: Unable to tell what highlight the prompt part of a
cmdline_show event should have, and whether cmdline_hide was
emitted after aborting.
Solution: Add additional arguments hl_id to cmdline_show, and abort to
cmdline_hide.
…im#31669 - Typo/bug in msg_outtrans_long passing string length as "hist" argument. - Avoid truncating message in msg_outtrans_long with ext_messages (followup to 1097d23). - Remove `_hl` from `msg_keep`, `smsg_keep` as there is no non-`_hl` variant. - `msg_printf_hl` is removed (identical to `smsg` except it sets `msg_scroll = true`, seemingly as a caveat to force a more prompt in cmdline mode). Move this logic to the only the only place this was used in ex_getln.c.
Problem: filetype: APKBUILD files not correctly detected
Solution: detect 'APKBUILD' files as apkbuild filetype,
include a apkbuild syntax script (which basically
just sources the sh.vim syntax file)
(Hugo Osvaldo Barrera)
Vim plugins (e.g.: ALE, nvim-lspconfig, etc) rely on filetype to
determine which integrations/helpers are applicable. They expect
filetype=apkbuild for APKBUILD files.
On the other hand, plugins also enable bash-specific linters and
functionality when filetype=bash, but APKBUILD files are POSIX sh, not
bash, so these often provide bogus results.
Change the filetype for APKBUILD to a 'apkbuild', so that tools and
ftplugin can properly target these files. This filetype will use the
existing `sh` syntax rules, since these are applicable for them.
vim/vim@7cb2491
Co-authored-by: Hugo Osvaldo Barrera' via vim_dev <[email protected]>
Pass along whether message in msg_show event is added to the internal :messages history.
Contribute the core of my vim-graphql project (ftplugin, indent, syntax) to the Vim project. This replaces the basic ftplugin support that was already in the runtime with a more complete set of filetype settings. I can assume maintainership for all of these files. I'll continue to maintain the higher-level embedded filetype support separately (in vim-graphql) for now, because it's fairly complex, but we can consider integrating that code directly into vim later. runtime files use the MIT license. closes: vim/vim#16273 vim/vim@4ce1cb5 Co-authored-by: Jon Parise <[email protected]>
Problem: The :has() method of the vim.version.range() result is not documented though it's mentioned in examples. Solution: Mention it in the range() result doc.
vim-patch:9.1.{1013,1017}
* refactor(options): generic expand and did_set callbacks Problem: Many options have similar callbacks to check the values are valid. Solution: Generalize these callbacks into a single function that reads the option table. * refactor: gen_options.lua refactor: gen_options.lua - inline get_cond * refactor(options): use a simpler format for the common default
This commit adds basic support for the kitty keyboard protocol to
Neovim's builtin terminal. For now only the first mode ("Disambiguate
escape codes") is supported.
feat(terminal): add support for kitty keyboard protocol
…ntext (neovim#32056) Problem: no way to get current selected item in a async context Solution: add completed flag to show the entries of currently selected index item (glepnir) closes: vim/vim#16451 vim/vim@037b028 Co-authored-by: glepnir <[email protected]>
…im#32062) Problem: string might be used without a trailing NUL (after v9.1.0997) Solution: Make sure that the buffer is NUL terminated closes: vim/vim#16457 vim/vim@70dfc37 Co-authored-by: John Marriott <[email protected]>
fixes: vim/vim#16455 vim/vim@a234a46 Co-authored-by: Christian Brabandt <[email protected]>
Problem: Fix applied in neovim#32033 can be more idiomatic. Solution: Unset redraw_state instead of cmdbuff.
Problem: filetype: swc configuration files are not recognized Solution: detect .swcrc files as json filetype (Marces Engel) References: https://swc.rs/docs/configuration/swcrc closes: vim/vim#16462 vim/vim@3a738fc Co-authored-by: Marces Engel <[email protected]>
Problem:
With language servers like lemminx, completing xml tags like `<mo` first
shows the right candidates (`modules`) but after typing `d` the
candidates disappear.
This is because the server returns:
[...]
filterText = "<module",
label = "module",
textEdit = {
newText = "<module>$1</module>$0",
Which resulted in `module` being used as `word`, and `module` doesn't
match the prefix `<mo`. Typing `d` causes the `complete()` filtering
mechanism to kick in and remove the entry.
Solution:
Use `<module` from the `filterText` as `word` if the textEdit/label
heuristic doesn't match.
Problem: too many strlen() calls in screen.c
Solution: refactor screen.c and remove calls to strlen(),
verify that leadmultispace != NULL (John Marriott)
closes: vim/vim#16460
vim/vim@c15de97
Co-authored-by: John Marriott <[email protected]>
- highlight more C keywords, including some from C23 Conditionally highlight C23 features: - #embed, #elifdef and #elifndef preprocessor directives - predefined macros - UTF-8 character constants - binary integer constants, _BitInt literals, and digit separators - nullptr_t type and associated constant - decimal real floating-point, bit precise and char types - typeof operators Matchit: - update for new preprocessor directives fixes: vim/vim#13667 fixes: vim/vim#13679 closes: vim/vim#12984 vim/vim@c2a967a Co-authored-by: Doug Kearns <[email protected]> Co-authored-by: Albin Ahlbäck <[email protected]>
Dr. Chip retired some time ago and is no longer maintaining the netrw plugin. However as a runtime plugin distributed by Vim, it important to maintain the netrw plugin in the future and fix bugs as they are reported. So, split out the netrw plugin as an additional package, however include some stubs to make sure the plugin is still loaded by default and the documentation is accessible as well. closes: vim/vim#16368 vim/vim@9cfdabb Co-authored-by: Luca Saccarola <[email protected]>
Simplify usage and remove redundant flags and code.
- remove duplicated keywords - add bash coproc and COPROC_PID keywords vim/vim@54cb514 Co-authored-by: Eisuke Kawashima <[email protected]>
…le (C23) closes: vim/vim#16471 vim/vim@e064051 Co-authored-by: Doug Kearns <[email protected]>
Making this opt-out (on by default) was the wrong choice from the
beginning. It is too visually noisy to be enabled by default.
BREAKING CHANGE: Users must opt-in to the diagnostic virtual text
handler by adding
vim.diagnostic.config({ virtual_text = true })
to their config.
Problem: Calling `xstrdup` with a NULL pointer causes a SIGSEGV if `lua_tostring` returns NULL in `nlua_luv_thread_common_cfpcall`. Crash stack trace: - `_platform_strlen` → `xstrdup` (memory.c:469) - `nlua_luv_thread_common_cfpcall` (executor.c:281) Solution: Check if `lua_tostring` returns NULL and pass NULL to `event_create` to avoid the crash.
…#32081) Problem: opt_idx possible negative value used as index Solution: check opt_idx not less than zero (kOptInvalid)
|
@MariaSolOs I have merged master with your changes and nothing else. I have tested with few languages servers and diagnostics seem to work like it used to. I will try to find may be a beta version of rust or lua ls to see whether they implement 3.18. Right now |
MariaSolOs
pushed a commit
that referenced
this pull request
Feb 9, 2025
…32370) this change includes the following changes: - a macro option must be #1–neovim#9 - add \providecommand - add starred versions of \newcommand, \newenvironment, and their variants - add number of arguments to \(re)newenvironment vim/vim@a35040f Co-authored-by: Eisuke Kawashima <[email protected]>
MariaSolOs
pushed a commit
that referenced
this pull request
Jul 20, 2025
Problem: Bad format() call on PUC Lua neovim#34901 Error: Failed to run healthcheck for "vim.health" plugin. Exception: runtime/lua/vim/health/health.lua:89: bad argument #1 to 'format' (string expected, got nil) Solution: Avoid passing nil.
MariaSolOs
pushed a commit
that referenced
this pull request
Jul 20, 2025
Problem:
The "gitsigns" plugin runs `vim.diff` in a thread (`uv.new_work`), but
`vim.diff` is nil in that context:
Lua callback:
…/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: bad argument #1 to 'decode' (string expected, got nil)
stack traceback:
[C]: in function 'decode'
…/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: in function <…/gitsigns.nvim/lua/gitsigns/diff_int.lua:29>
Luv thread:
…/gitsigns.nvim/lua/gitsigns/diff_int.lua:63: attempt to call field 'diff' (a nil value)
Solution:
Revert the `stdlib.c` change (set `vim.diff` instead of `vim._diff`).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

No description provided.