aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/health_spec.lua
Commit message (Collapse)AuthorAge
* 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(tests): needing two calls to setup a screen is cringebfredl2024-11-14
| | | | | | | | | | Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session.
* 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!
* refactor(api)!: rename Dictionary => DictJustin M. Keyes2024-09-23
| | | | | | | | | | | | | | In the api_info() output: :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val') ... {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1} The `ArrayOf(Integer, 2)` return type didn't break clients when we added it, which is evidence that clients don't use the `return_type` field, thus renaming Dictionary => Dict in api_info() is not (in practice) a breaking change.
* test(health): "test_plug/health/init.lua" completes as "test_plug"Justin M. Keyes2024-09-11
|
* fix: change deprecation presentationdundargoc2024-05-24
| | | | | | | | | | | | | | Deprecation with vim.deprecate is currently too noisy. Show the following warning instead: [function] is deprecated. Run ":checkhealth vim.deprecated" for more information. The important part is that the full message needs to be short enough to fit in one line in order to not trigger the "Press ENTER or type command to continue" prompt. The full information and stack trace for the deprecated functions will be shown in the new healthcheck `vim.deprecated`.
* fix: merge all provider healthchecks into a single health.luadundargoc2024-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | This will help manage the overly granular checkhealth completion to go from ``` vim.health vim.lsp vim.provider.clipboard vim.provider.node vim.provider.perl vim.provider.python vim.provider.ruby vim.treesitter ``` to ``` vim.health vim.lsp vim.provider vim.treesitter ```
* refactor!: remove `nvim` and `provider` module for checkhealthdundargoc2024-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The namespacing for healthchecks for neovim modules is inconsistent and confusing. The completion for `:checkhealth` with `--clean` gives ``` nvim provider.clipboard provider.node provider.perl provider.python provider.ruby vim.lsp vim.treesitter ``` There are now three top-level module names for nvim: `nvim`, `provider` and `vim` with no signs of stopping. The `nvim` name is especially confusing as it does not contain all neovim checkhealths, which makes it almost a decoy healthcheck. The confusion only worsens if you add plugins to the mix: ``` lazy mason nvim nvim-treesitter provider.clipboard provider.node provider.perl provider.python provider.ruby telescope vim.lsp vim.treesitter ``` Another problem with the current approach is that it's not easy to run nvim-only healthchecks since they don't share the same namespace. The current approach would be to run `:che nvim vim.* provider.*` and would also require the user to know these are the neovim modules. Instead, use this alternative structure: ``` vim.health vim.lsp vim.provider.clipboard vim.provider.node vim.provider.perl vim.provider.python vim.provider.ruby vim.treesitter ``` and ``` lazy mason nvim-treesitter telescope vim.health vim.lsp vim.provider.clipboard vim.provider.node vim.provider.perl vim.provider.python vim.provider.ruby vim.treesitter ``` Now, the entries are properly sorted and running nvim-only healthchecks requires running only `:che vim.*`.
* test: improve test conventionsdundargoc2024-04-23
| | | | | | | | | Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
* fix(completion): check that healthcheck name is string (#28458)zeertzjq2024-04-22
|
* 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.
* refactor(test): inject after_each differentlyLewis Russell2024-04-10
|
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* test: reduce `exec_lua` callsdundargoc2024-04-04
| | | | | | | | | | | | | | | | | | | | | `exec_lua` makes code slighly harder to read, so it's beneficial to remove it in cases where it's possible or convenient. Not all `exec_lua` calls should be removed even if the test passes as it changes the semantics of the test even if it happens to pass. From https://github.com/neovim/neovim/pull/28155#discussion_r1548185779: "Note for tests like this, which fundamentally are about conversion, you end up changing what conversion you are testing. Even if the result happens to be same (as they often are, as we like the rules to be consistent if possible), you are now testing the RPC conversion rules instead of the vim script to in-process lua conversion rules." From https://github.com/neovim/neovim/pull/28155#discussion_r1548190152: "A test like this specifies that the cursor is valid immediately and not after a separate cycle of normal (or an other input-processing) mode."
* refactor(tests): all screen tests should use highlightsbfredl2024-03-23
| | | | | | | | | | | | | | | | | | | | | | | This is the first installment of a multi-PR series significantly refactoring how highlights are being specified. The end goal is to have a base set of 20 ish most common highlights, and then specific files only need to add more groups to that as needed. As a complicating factor, we also want to migrate to the new default color scheme eventually. But by sharing a base set, that future PR will hopefully be a lot smaller since a lot of tests will be migrated just simply by updating the base set in place. As a first step, fix the anti-pattern than Screen defaults to ignoring highlights. Highlights are integral part of the screen state, not something "extra" which we only test "sometimes". For now, we still allow opt-out via the intentionally ugly screen._default_attr_ids = nil The end goal is to get rid of all of these eventually (which will be easier as part of the color scheme migration)
* test: rename (meths, funcs) -> (api, fn)Lewis Russell2024-01-12
|
* refactor: format test/*Justin M. Keyes2024-01-03
|
* refactor(health): refactor provider healthchecksGregory Anders2024-01-01
| | | | | | * Prefer pure Lua functions over vim.fn * Split up provider healthchecks into separate modules to help manage complexity
* feat(health): make :checkhealth support more split modifiers (#26731)zeertzjq2023-12-25
|
* feat(health): checkhealth buffer can show in a split window (#26714)Pablo Arias2023-12-25
| | | | | | :checkhealth now respects :vertical and :horizontal. For example: :vertical checkhealth foo bar will open the healthcheck buffer in a vertical split.
* feat(health): fold successful healthchecks #22866Alexandre Teoi2023-06-06
| | | | | | | | Problem: checkhealth can be noisy, but we don't want to omit info. Solution: Fold OK results by default, if 'foldenable' is enabled. Resolves #22796
* fix(health): replace healthFoo with DiagnosticFoo (#23475)Christian Clason2023-05-05
| | | | | | This replaces the custom `health{Error,Warning,Success}` highlight groups with `Diagnostic{Error,Warning,Ok}`, which are defined by default. Removes the link for `healthHelp`, which was no longer actually used after #20879.
* refactor: deprecate checkhealth functionsdundargoc2023-04-15
| | | | | | | | | | | | | | | | | | | | | | | The following functions are deprecated and will be removed in Nvim v0.11: - health#report_start() - health#report_info() - health#report_ok() - health#report_warn() - health#report_error() - vim.health.report_start() - vim.health.report_info() - vim.health.report_ok() - vim.health.report_warn() - vim.health.report_error() Users should instead use these: - vim.health.start() - vim.health.info() - vim.health.ok() - vim.health.warn() - vim.health.error()
* feat(checkhealth): use "help" syntax, avoid tabpage #20879Justin M. Keyes2022-11-11
| | | | | | | | | - If Nvim was just started, don't create a new tab. - Name the buffer "health://". - Use "help" syntax instead of "markdown". It fits better, and eliminates various workarounds. - Simplfy formatting, avoid visual noise. - Don't print a "INFO" status, it is noisy. - Drop the ":" after statuses, they are already UPPERCASE and highlighted.
* feat(checkhealth): check runtime ($VIMRUNTIME)Justin M. Keyes2022-10-30
| | | | | | Move man/health.lua into the "runtime" check. fix #20696
* vim-patch:3c053a1a5ad2 (#20679)Christian Clason2022-10-17
| | | | Update runtime files https://github.com/vim/vim/commit/3c053a1a5ad2a3c924929e11f2b9af20a8b901e2
* fix(checkhealth): skip vim.health #18816Javier Lopez2022-06-01
| | | | | | | | | | | | | | | | | | 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.
* fix(healthcheck): handle empty reportsEdmund Cape2022-02-09
|
* fix(health): do not run external processes in a shellzeertzjq2022-02-03
|
* feat(runtime): new checkhealth filetype (#16660)matveyt2021-12-18
|
* feat(lua): enable stack traces in error output (#16228)Gregory Anders2021-11-06
|
* chore(test): adapt healthcheck test to new css syntaxChristian Clason2021-10-16
| | | | | | | | | The runtime file update https://github.com/vim/vim/commit/2286304cdbba53ceb52b3ba2ba4a521b0a2f8d0f added a `syn keyword` for `css`, which affects (via `html` and `markdown` syntax files) the highlighting of `:checkhealth` output (before, `ERROR:` was highlighted with `healthError`; now the colon is no longer included).
* fix(checkhealth): mitigate issues with duplicate healthchecks #15919Javier Lopez2021-10-05
| | | | | | | | | | | | | | | * fix(runtime/health): mitigate issues with duplicate healthchecks Previously if a healthcheck was found as Lua and Vim it was executed both times. This new implementations prefers Lua, therefore if two are found It only runs the Lua one, this way a plugin can mantain both implementations the Lua one with the method `check()` and the autoload function `#check()` (for none HEAD nvim versions). **Note: This will require plugins to use `check()` as the function name, since the autoload function that wraps the lua implementation won't be called** * docs(health): use spaces and don't overuse backtics followup to #15259
* feat(ex_checkhealth): provide function for command line completionJavier López2021-10-04
| | | | | | | | | Move away from providing completion with ExpandRTDir to ExpandGeneric providing the function get_healthcheck_name which caches the results for the current command line prompt. It does the almost the same thing the Vim function 'get_healthcheck' implemented in 'runtime/autoload/health.vim' does.
* test(runtime/health): cover lua healthchecksJavier López2021-10-04
| | | | | | | - Add tests for lua healthchecks (failure, success and submodules). - Reword some of the test naming for improved logs readability. - Modify render test to accomodate the changes of the health autoload function. - Add test for :checkhealth completion of Lua healtchecks.
* vim-patch:ebdf3c964a90Jan Edmund Lazo2021-04-27
| | | | | | | Update runtime files. https://github.com/vim/vim/commit/ebdf3c964a901fc00c9009689f7cfda478342c51 Omit vim9.
* tests/ui: cleanup illegitimate usages of "attr_ignore"Björn Linse2019-10-13
| | | | | "attr_ignore" is an anti-pattern, with snapshot_util() just include all the highlights already.
* test: Eliminate plugin/helpers.luaJustin M. Keyes2019-08-05
|
* tests: :checkhealth completionMarco Hinz2018-01-18
|
* :checkhealth : validate 'runtimepath' (#7526)Justin M. Keyes2017-11-10
|
* :checkhealth : validate $VIMJustin M. Keyes2017-10-17
|
* doc: replace ":CheckHealth" with ":checkhealth"Justin M. Keyes2017-10-17
|
* ex-cmds: :checkhealthJustin M. Keyes2017-10-17
| | | | | | | | Built-in `:checkhealth` checks for valid $VIMRUNTIME by attempting to autoload `health#check()`. closes #2977 closes #3159
* health.vim: fix highlightingJustin M. Keyes2017-10-15
| | | | | | | | | | | `:syntax keyword` is affected by 'iskeyword'. When we aligned 'iskeyword' to that of filetype=help, colon (:) is now included. Simplest way to deal with this is to include colon (:) in the `:syntax keyword` directive. Also: - change "SUGGESTIONS" mouthful to "ADVICE" - change "SUCCESS" to "OK"
* health.vim: fix testJustin M. Keyes2017-07-15
|
* functests: Replace execute with either command or feed_commandZyX2017-04-09
| | | | | | | | | | Hope this will make people using feed_command less likely: this hides bugs. Already found at least two: 1. msgpackparse() will show internal error: hash_add() in case of duplicate keys, though it will still work correctly. Currently silenced. 2. ttimeoutlen was spelled incorrectly, resulting in option not being set when expected. Test was still functioning somehow though. Currently fixed.
* CheckHealth: Include v:throwpoint in error message (#5575)Tommy Allen2016-11-12
| | | | | | | | | | * health.vim: Include v:throwpoint in error message * health/provider.vim: Check for ruby executable * health/provider.vim: Combine subprocess stdout and stderr * test: Updated CheckHealth test
* CheckHealth: more checksJustin M. Keyes2016-10-25
|
* health.vim: Show results incrementally.Justin M. Keyes2016-09-05
| | | | | | | | Also: - improve precision of "No healthcheck found" - fix SUGGESTIONS syntax group definition - fix indentation of SUGGESTIONS
* CheckHealth: Accept [plugin1 [, plugin2 [, ...]]] args.Justin M. Keyes2016-08-21
| | | | | | | | | To healthcheck the "foo" plugin: :CheckHealth foo To healthcheck the "foo" and "bar" plugins: :CheckHealth foo bar To run all auto-discovered healthchecks: :CheckHealth