Skip to content
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

refactor!: remove nvim and provider module for checkhealth #28839

Merged
merged 1 commit into from
May 19, 2024

Conversation

dundargoc
Copy link
Member

@dundargoc dundargoc commented May 18, 2024

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.*.

@dundargoc dundargoc marked this pull request as ready for review May 18, 2024 17:12
@github-actions github-actions bot added refactor changes that are not features or bugfixes breaking-change labels May 18, 2024
@dundargoc
Copy link
Member Author

dundargoc commented May 18, 2024

Future improvements:

  • Reduce the five provider checks into a single checks. Triple nested checkhealths is overkill in granularity.
  • :checkhealth vim should run all healthchecks under the vim module IMO. Right now it does nothing and requires it to be run as a glob with :checkhealth vim.*.
  • Maybe remove the globbing functionality entirely and focus solely on module based healthchecks (meaning :che vi* would not work). I suspect this functionality isn't well known tbh. On the other hand it's not expensive, but on the other other hand with module-based approach and improved completion we wouldn't need to rely on globbing.

@dundargoc dundargoc force-pushed the refactor/checkhealth branch 3 times, most recently from b92b4d3 to 5d89db8 Compare May 18, 2024 19:07
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.*`.
@dundargoc dundargoc merged commit 0f4f7d3 into neovim:master May 19, 2024
29 checks passed
@dundargoc dundargoc deleted the refactor/checkhealth branch May 19, 2024 09:46
@wookayin
Copy link
Member

wookayin commented May 19, 2024

Looks great, and I like the change. But shouldn't it be mentioned in news.txt?

@dundargoc
Copy link
Member Author

Tbh does anyone care about this?

@justinmk
Copy link
Member

"nvim" was for non-provider checks, especially configuration-related checks. Is :che vim.health now the way to do that? The provider checks can be slow.

@dundargoc
Copy link
Member Author

"nvim" was for non-provider checks, especially configuration-related checks.

I know, but neovim is the only thing that has multiple top-level checkhealth modules. Remember, there was no real way to run neovim only healthchecks before.

Is :che vim.health now the way to do that?

Ye, because runtime/vim/health.vim which provides vim.health is blocking the :checkhealth vim space. Not much that can be done. I'm up for suggestions if you have something else in mind. Something like :checkhealth vim.config?

@justinmk
Copy link
Member

As long as there's a way to run non-provider Nvim checks, I think it's fine. Not worried about the name too much, in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change ci:skip-news refactor changes that are not features or bugfixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants