diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-04-08 00:41:41 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2024-04-15 13:54:33 +0200 |
commit | 26765e8461c1ba1e9a351632212cf89900221781 (patch) | |
tree | 6cc8401fb7a758ee3a3eed570b9fa0e9b8b8087f /src/nvim/api/buffer.c | |
parent | 57adf8c6e01d9395eb52fe03571c535571efdc4b (diff) | |
download | rneovim-26765e8461c1ba1e9a351632212cf89900221781.tar.gz rneovim-26765e8461c1ba1e9a351632212cf89900221781.tar.bz2 rneovim-26765e8461c1ba1e9a351632212cf89900221781.zip |
feat(diagnostic): is_enabled, enable(…, enable:boolean)
Problem:
`vim.diagnostic.is_disabled` and `vim.diagnostic.disable` are unnecessary
and inconsistent with the "toggle" pattern (established starting with
`vim.lsp.inlay_hint`, see https://github.com/neovim/neovim/pull/25512#pullrequestreview-1676750276
As a reminder, the rationale is:
- we always need `enable()`
- we always end up needing `is_enabled()`
- "toggle" can be achieved via `enable(not is_enabled())`
- therefore,
- `toggle()` and `disable()` are redundant
- `is_disabled()` is a needless inconsistency
Solution:
- Introduce `vim.diagnostic.is_enabled`, and `vim.diagnostic.enable(…, enable:boolean)`
- Note: Future improvement would be to add an `enable()` overload `enable(enable:boolean, opts: table)`.
- Deprecate `vim.diagnostic.is_disabled`, `vim.diagnostic.disable`
Diffstat (limited to 'src/nvim/api/buffer.c')
0 files changed, 0 insertions, 0 deletions