diff options
author | dundargoc <gocdundar@gmail.com> | 2024-05-18 18:35:26 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-05-19 11:46:34 +0200 |
commit | 0f4f7d32ce5d6d3b751b0b01455770f3b72531b9 (patch) | |
tree | 44341b33654b2361319c799de28a40bd06bb3fdf | |
parent | 63e3a63d2fcd72c40ed2b4128a232c0931ef21cf (diff) | |
download | rneovim-0f4f7d32ce5d6d3b751b0b01455770f3b72531b9.tar.gz rneovim-0f4f7d32ce5d6d3b751b0b01455770f3b72531b9.tar.bz2 rneovim-0f4f7d32ce5d6d3b751b0b01455770f3b72531b9.zip |
refactor!: remove `nvim` and `provider` module for checkhealth
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.*`.
-rw-r--r-- | runtime/lua/vim/health/health.lua (renamed from runtime/lua/nvim/health.lua) | 0 | ||||
-rw-r--r-- | runtime/lua/vim/provider/clipboard/health.lua (renamed from runtime/lua/provider/clipboard/health.lua) | 0 | ||||
-rw-r--r-- | runtime/lua/vim/provider/node/health.lua (renamed from runtime/lua/provider/node/health.lua) | 0 | ||||
-rw-r--r-- | runtime/lua/vim/provider/perl/health.lua (renamed from runtime/lua/provider/perl/health.lua) | 0 | ||||
-rw-r--r-- | runtime/lua/vim/provider/python/health.lua (renamed from runtime/lua/provider/python/health.lua) | 0 | ||||
-rw-r--r-- | runtime/lua/vim/provider/ruby/health.lua (renamed from runtime/lua/provider/ruby/health.lua) | 0 | ||||
-rw-r--r-- | test/functional/plugin/health_spec.lua | 9 |
7 files changed, 4 insertions, 5 deletions
diff --git a/runtime/lua/nvim/health.lua b/runtime/lua/vim/health/health.lua index 5bc03199ee..5bc03199ee 100644 --- a/runtime/lua/nvim/health.lua +++ b/runtime/lua/vim/health/health.lua diff --git a/runtime/lua/provider/clipboard/health.lua b/runtime/lua/vim/provider/clipboard/health.lua index e44f7d32cc..e44f7d32cc 100644 --- a/runtime/lua/provider/clipboard/health.lua +++ b/runtime/lua/vim/provider/clipboard/health.lua diff --git a/runtime/lua/provider/node/health.lua b/runtime/lua/vim/provider/node/health.lua index 471c625388..471c625388 100644 --- a/runtime/lua/provider/node/health.lua +++ b/runtime/lua/vim/provider/node/health.lua diff --git a/runtime/lua/provider/perl/health.lua b/runtime/lua/vim/provider/perl/health.lua index 535093d793..535093d793 100644 --- a/runtime/lua/provider/perl/health.lua +++ b/runtime/lua/vim/provider/perl/health.lua diff --git a/runtime/lua/provider/python/health.lua b/runtime/lua/vim/provider/python/health.lua index a5bd738063..a5bd738063 100644 --- a/runtime/lua/provider/python/health.lua +++ b/runtime/lua/vim/provider/python/health.lua diff --git a/runtime/lua/provider/ruby/health.lua b/runtime/lua/vim/provider/ruby/health.lua index 31c2fe3201..31c2fe3201 100644 --- a/runtime/lua/provider/ruby/health.lua +++ b/runtime/lua/vim/provider/ruby/health.lua diff --git a/test/functional/plugin/health_spec.lua b/test/functional/plugin/health_spec.lua index 78cffd07fb..327b5759c7 100644 --- a/test/functional/plugin/health_spec.lua +++ b/test/functional/plugin/health_spec.lua @@ -5,7 +5,7 @@ local Screen = require('test.functional.ui.screen') local clear = n.clear local curbuf_contents = n.curbuf_contents local command = n.command -local eq, neq, matches = t.eq, t.neq, t.matches +local eq, matches = t.eq, t.matches local getcompletion = n.fn.getcompletion local insert = n.insert local exec_lua = n.exec_lua @@ -36,16 +36,15 @@ describe(':checkhealth', function() clear() -- Do this after startup, otherwise it just breaks $VIMRUNTIME. command("let $VIM='zub'") - command('checkhealth nvim') + command('checkhealth vim.health') matches('ERROR $VIM .* zub', curbuf_contents()) end) it('completions can be listed via getcompletion()', function() clear() - eq('nvim', getcompletion('nvim', 'checkhealth')[1]) - eq('provider.clipboard', getcompletion('prov', 'checkhealth')[1]) + eq('vim.health', getcompletion('vim', 'checkhealth')[1]) + eq('vim.provider.clipboard', getcompletion('vim.prov', 'checkhealth')[1]) eq('vim.lsp', getcompletion('vim.ls', 'checkhealth')[1]) - neq('vim', getcompletion('^vim', 'checkhealth')[1]) -- should not complete vim.health end) it('completion checks for vim.health._complete() return type #28456', function() |