aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/health.lua
Commit message (Collapse)AuthorAge
* ci(lua): enable annotation and style checksLewis Russell2026-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: - annotation-usage-error and code-style-check are disabled. - vim.inspect relies on a dummy self-assignment for docgen, and its help omits parameter and option details. - LuaLS fallback types obscure iterator inference. - Docgen hardcodes public function names and appends separately sorted files, leaving shared helpers under the inspector heading. Solution: - Enable annotation-usage-error and code-style-check, and fix misplaced annotations. - Document vim.inspect's callable module directly, removing the dummy assignment. Describe its parameters, option defaults and process callback. - Remove LuaLS iterator fallbacks, correct iterator signatures and check values that the improved inference identifies as optional. - Parse callable modules, require bindings and parent module references. Derive public names and inherited function docs from these links, including missing help for vim.async.semaphore() and vim.version(). - Export vim.lsp.tagfunc directly with lazy loading and document its implementation instead of maintaining a wrapper. - Group files in section_order, replacing append_only and merge_files. Merge declarations before sorting each section, placing shared helpers in the main vim section and keeping vim.inspect in alphabetical order. - Add basic parser coverage for callable modules and module links. AI-assisted
* fix(lua): enable param-type-mismatch diagnosticLewis Russell2026-09-28
| | | | | | | | | Problem: Argument type mismatches are excluded from EmmyLua checks. Solution: Correct runtime annotations and calls, document local checker workarounds, and enable the diagnostic. AI-assisted
* fix(lua): enable unnecessary-assert diagnosticLewis Russell2026-09-28
| | | | AI-assisted
* fix(lua): add missing param annotations (#41911)Lewis Russell2026-09-15
|
* feat(health): async healthchecks #41673Barrett Ruth2026-09-11
| | | | | | | | | Problem: :checkhealth blocks as healthchecks perform slow work. Solution: Partially fix it: run Lua healthchecks in vim.async tasks and await vim.health subprocesses. Existing synchronous checks still block until they leverage the new apis.
* build: enable more EmmyLua checksLewis Russell2026-09-08
| | | | | | | | | | | | | | | | - call-non-callable - missing-fields - redefined-label - redefined-local - undefined-field - unreachable-code Promote redefined-local and unreachable-code to warnings. Fix DOS line-ending handling for multiline semantic tokens, and support intersection types in the help parser. AI-assisted
* docs(health): avoid warnings for dynamic filetypes #41036flatplum2026-07-29
| | | | | | | Problem: Dynamic filetypes defined by `vim.filetype.add` may show health warnings. Solution: Document a way to suppress these harmless warnings.
* feat(health): improvements to :checkhealth #40935Olivia Kinnear2026-07-24
| | | | | | | Changes: - Removed the blank line before the first healthcheck header. - Fixed a bug where the entire "Terminal" section of `vim.health` would not appear if the `infocmp` executable was not found. - Fixed a typo in `vim.lsp` when displaying the LSP log level.
* fix(health): always set 'modifiable' #40584dqnne2026-07-05
| | | | | | | | Problem: When buffers are by default `nomodifiable`, such as when Nvim starts with `-M`, the health buffer cannot be updated. Solution: Always set `modifiable` before modifying the buffer.
* fix(:checkhealth): open after current tabpage (#40319)zeertzjq2026-06-19
|
* fix(health): show Nvim-owned checks at the topJustin M. Keyes2026-05-20
|
* feat(api): nvim_echo(percent=nil) means "unknown" progress #39029Peter Cardenas2026-04-24
| | | | | | | Problem: No way to signal "unknown" or "indeterminate" progress percentage. Solution: Treat percent=nil as "indeterminate" percent.
* refactor(excmd): migrate ex_checkhealth to LuaJustin M. Keyes2026-04-20
|
* fix(progress): require "source" for progress-message #38514Shadman2026-03-28
| | | | | | | | | | | Problem: - Progress-events are filtered by "source". But "source" is not required by nvim_echo. - Without "++nested" (force=false), nvim_echo in an event-handler does not trigger Progress events. - vim.health does not declare a "source". Solution: - Make source mandatory for progress-messages - Enable ++nested (force=true) by default when firing Progress event. - Set "source" in vim.health module.
* feat(lua): replace `buffer` with `buf` in vim.keymap.set/del #38360skewb1k2026-03-21
| | | | | | The `buffer` option remains functional but is now undocumented. Providing both will raise an error. Since providing `buf` was disallowed before, there is no code that will break due to using `buffer` alongside `buf`.
* feat(stdlib): vim.fs.ext() returns file extension #36997Yochem van Rosmalen2026-03-20
| | | | | | | | | | | | | | | | | Problem: Checking the extension of a file is done often, e.g. in Nvim's codebase for differentiating Lua and Vimscript files in the runtime. The current way to do this in Lua is (1) a Lua pattern match, which has pitfalls such as not considering filenames starting with a dot, or (2) fnamemodify() which is both hard to discover and hard to use / read if not very familiar with the possible modifiers. vim.fs.ext() returns the file extension including the leading dot of the extension. Similar to the "file extension" implementation of many other stdlibs (including fnamemodify(file, ":e")), a leading dot doesn't indicate the start of the extension. E.g.: the .git folder in a repository doesn't have the extension .git, but it simply has no extension, similar to a folder named git or any other filename without dot(s).
* refactor: integer functions, optimize asserts #34112Lewis Russell2026-03-12
| | | | | | | | | | | | refactor(lua): add integer coercion helpers Add vim._tointeger() and vim._ensure_integer(), including optional base support, and switch integer-only tonumber()/assert call sites in the Lua runtime to use them. This also cleans up related integer parsing in LSP, health, loader, URI, tohtml, and Treesitter code. supported by AI
* fix(health): add back `vim.cmd.redraw()` call (#37576)Olivia Kinnear2026-01-27
| | | Was erroneously removed by #37462 during rebase.
* fix(ui): only internal messages are unsafe #37462luukvbaal2026-01-26
| | | | | | | | Problem: Fast context for msg_show event inhibits vim.ui_attach from displaying a stream of messages from a single command. Solution: Remove fast context from msg_show events emitted as a result of explicit API/command calls. The fast context was originally introduced to prevent issues with internal messages.
* fix(health): redraw after emitting progress message #37567Olivia Kinnear2026-01-26
| | | | | | | | | Problem: `vim.cmd.redraw()` is not called after displaying a progress message, so vim will display progress for the previous health check, not the current one. Solution: Call `vim.cmd.redraw()` so that the correct progress message is displayed.
* fix(health): emit Progress message #37123Yochem van Rosmalen2026-01-09
| | | | | | | | | Problem: The `"Running healthchecks..."` message doesn't inform the user much and is a hack from before we got a way to emit actual progress messages. Solution: Use `nvim_echo` to emit progress messages showing the name of the report that is currently running.
* fix(health): "q" keymap not set when health.style=float #37007glepnir2025-12-17
| | | | | | | Problem: The q keymap is already set in open_floating_preview, so maparg('q') is not empty. Solution: Add a health.style check before setting the q keymap.
* fix(health): floating window closes when opening TOC (gO) #34794glepnir2025-07-08
| | | | | Problem: Health check floating window gets closed when pressing 'gO' to show TOC because LSP floating preview system auto-closes on BufEnter events triggered by :lopen. Solution: Temporarily disable BufEnter event for the current window during TOC operations and adjust window layout to prevent overlap.
* feat(checkhealth): trigger FileType event after showing report #33677Justin M. Keyes2025-04-27
| | | | | | | | | | Problem: `FileType` event is fired before checkhealth report is finished, so user can't override report settings or contents. https://github.com/neovim/neovim/pull/33172#issuecomment-2833513916 Solution: - Trigger FileType event later. - Document how to remove emojis.
* fix(health): checkhealth float opens extra empty buffer #33648Andre Toerien2025-04-26
|
* feat(health): summary in section heading #33388Yochem van Rosmalen2025-04-09
| | | | | | | | Problem: As checkhealth grows, it is increasingly hard to quickly glance through the information. Solution: Show a summary of ok, warn, and error outputs per section.
* feat(checkhealth): emoji for OK/WARN/ERROR #33172Justin M. Keyes2025-03-30
| | | | | | | Problem: Health status can be much more visually distinct. Solution: Use emoji next to each status.
* fix(checkhealth): don't override user "q" keymap #33132phanium2025-03-29
|
* fix(checkhealth): module not found when `&rtp` has nested paths #32988phanium2025-03-19
| | | | | | | | | | | Problem: `:checkhealth` fail to find the module when `&rtp` have nested paths. Solution: find in order all existed `&rtp/lua` path rather than `&rtp` to ensure prefix exist before trim `&rtp`. In this case one module can be searched out from two different `&rtp/lua`, we use the first `&rtp/lua` contain the module (like how require() works).
* fix(checkhealth): handle nested lua/ directory #32918phanium2025-03-16
| | | | | | Problem: :checkhealth fails if plugin has nested "lua/" directory Solution: trim `{runtimepath}/lua` from fullpath to get subpath (`./**/{health, health/init.lua}`)
* feat(lua): vim.text.indent()Justin M. Keyes2025-02-26
| | | | | | | | | | | | | Problem: Indenting text is a common task in plugins/scripts for presentation/formatting, yet vim has no way of doing it (especially "dedent", and especially non-buffer text). Solution: Introduce `vim.text.indent()`. It sets the *exact* indentation because that's a more difficult (and thus more useful) task than merely "increasing the current indent" (which is somewhat easy with a `gsub()` one-liner).
* fix: resolve all remaining LuaLS diagnosticsLewis Russell2025-01-27
|
* fix(checkhealth): failed if 'lua' in plugin namephanium2025-01-23
|
* docs: misc #31867Justin M. Keyes2025-01-09
|
* feat(health): show :checkhealth in floating window #31086glepnir2025-01-07
| | | | Problem: health can not shown in a floating window Solution: add g:health variable
* fix(health): "q" should not close last window #31876Justin M. Keyes2025-01-05
|
* feat(health): close checkhealth buffers with q #31870Maria José Solano2025-01-05
|
* fix(health): set nomodifiable in checkhealth buffersMaria José Solano2025-01-05
|
* feat(health): highlight headings #30525Justin M. Keyes2024-09-26
| | | | | | | | | | Problem: checkhealth report sections are not visually separated. Solution: Highlight with "reverse". TODO: migrate checkhealth filetype to use treesitter. TODO: default :help should also highlight headings more boldy!
* fix(health): return correct name from 'path2name()'monkoose2024-09-11
| | | `path2name()` function doesn't process `'pluginname/health/init.lua'` correctly. Instead of retruning `'pluginname'` it returns `'pluginname.health'`
* docs: misc #28970Justin M. Keyes2024-09-01
|
* refactor: fix luals type warningsdundargoc2024-05-27
|
* refactor: move provider-related to where they are useddundargoc2024-05-25
|
* refactor: replace deprecated vim.loop with vim.uvdundargoc2024-05-24
|
* docs: extract health to its own filedundargoc2024-05-24
|
* docs: move vim.health documentation to lua.txtdundargoc2024-05-22
| | | | | | `vim.health` is not a "plugin" but part of our Lua API and the documentation should reflect that. This also helps make the documentation maintenance easier as it is now generated.
* feat: remove deprecated featuresdundargoc2024-05-16
| | | | | | | | | | | | | | | | | | | Remove following functions: - vim.lsp.util.extract_completion_items - vim.lsp.util.get_progress_messages - vim.lsp.util.parse_snippet() - vim.lsp.util.text_document_completion_list_to_complete_items - LanguageTree:for_each_child - health#report_error - health#report_info - health#report_ok - health#report_start - health#report_warn - vim.health.report_error - vim.health.report_info - vim.health.report_ok - vim.health.report_start - vim.health.report_warn
* fix: unreliable "checkhealth completions" testJustin M. Keyes2024-04-22
| | | | | | | | | | | | | | ref https://github.com/neovim/neovim/issues/19596 FAILED test/functional/plugin/health_spec.lua @ 37: :checkhealth completions can be listed via getcompletion() test/functional/plugin/health_spec.lua:40: Expected objects to be the same. Passed in: (string) 'provider.node' Expected: (string) 'provider.clipboard' stack traceback: test/functional/plugin/health_spec.lua:40: in function <test/functional/plugin/health_spec.lua:37>
* refactor(lua): deprecate tbl_flattenJustin M. Keyes2024-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Besides being redundant with vim.iter():flatten(), `tbl_flatten` has these problems: - Has `tbl_` prefix but only accepts lists. - Discards some results! Compare the following: - iter.flatten(): ``` vim.iter({1, { { a = 2 } }, { 3 } }):flatten():totable() ``` - tbl_flatten: ``` vim.tbl_flatten({1, { { a = 2 } }, { 3 } }) ``` Solution: Deprecate tbl_flatten. Note: iter:flatten() currently fails ("flatten() requires a list-like table") on this code from gen_lsp.lua: local anonym = vim.iter({ -- remove nil anonymous_num > 1 and '' or nil, '---@class ' .. anonymous_classname, }):flatten():totable() Should we enhance :flatten() to work for arrays?
* revert: "feat(health): fold successful healthchecks #22866"dundargoc2024-04-13
| | | | | | | | | This reverts commit 4382d2ed564b80944345785d780cf1b19fb23ba8. The story for this feature was left in an incomplete state. It was never the intention to unilaterally fold all information, only the ones that did not contain relevant information. This feature does more harm than good in its incomplete state.