mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
fix(health): replace healthFoo with DiagnosticFoo (#23475)
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.
This commit is contained in:
parent
c14aa66cce
commit
c8ebb04e92
@ -12,7 +12,7 @@ any other environment conditions that a plugin might care about. Nvim ships
|
|||||||
with healthchecks for configuration, performance, python support, ruby
|
with healthchecks for configuration, performance, python support, ruby
|
||||||
support, clipboard support, and more.
|
support, clipboard support, and more.
|
||||||
|
|
||||||
To run all healthchecks, use: >
|
To run all healthchecks, use: >vim
|
||||||
|
|
||||||
:checkhealth
|
:checkhealth
|
||||||
<
|
<
|
||||||
@ -32,17 +32,17 @@ Commands *health-commands*
|
|||||||
|
|
||||||
:che[ckhealth] {plugins}
|
:che[ckhealth] {plugins}
|
||||||
Run healthcheck(s) for one or more plugins. E.g. to run only
|
Run healthcheck(s) for one or more plugins. E.g. to run only
|
||||||
the standard Nvim healthcheck: >
|
the standard Nvim healthcheck: >vim
|
||||||
:checkhealth nvim
|
:checkhealth nvim
|
||||||
<
|
<
|
||||||
To run the healthchecks for the "foo" and "bar" plugins
|
To run the healthchecks for the "foo" and "bar" plugins
|
||||||
(assuming they are on 'runtimepath' and they have implemented
|
(assuming they are on 'runtimepath' and they have implemented
|
||||||
the Lua `require("foo.health").check()` interface): >
|
the Lua `require("foo.health").check()` interface): >vim
|
||||||
:checkhealth foo bar
|
:checkhealth foo bar
|
||||||
<
|
<
|
||||||
To run healthchecks for Lua submodules, use dot notation or
|
To run healthchecks for Lua submodules, use dot notation or
|
||||||
"*" to refer to all submodules. For example Nvim provides
|
"*" to refer to all submodules. For example Nvim provides
|
||||||
`vim.lsp` and `vim.treesitter`: >
|
`vim.lsp` and `vim.treesitter`: >vim
|
||||||
:checkhealth vim.lsp vim.treesitter
|
:checkhealth vim.lsp vim.treesitter
|
||||||
:checkhealth vim*
|
:checkhealth vim*
|
||||||
<
|
<
|
||||||
@ -100,7 +100,7 @@ All such health modules must return a Lua table containing a `check()`
|
|||||||
function.
|
function.
|
||||||
|
|
||||||
Copy this sample code into `lua/foo/health.lua`, replacing "foo" in the path
|
Copy this sample code into `lua/foo/health.lua`, replacing "foo" in the path
|
||||||
with your plugin name: >
|
with your plugin name: >lua
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
@ -11,15 +11,10 @@ unlet! b:current_syntax
|
|||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
syn keyword healthError ERROR[:]
|
syn keyword DiagnosticError ERROR[:]
|
||||||
syn keyword healthWarning WARNING[:]
|
syn keyword DiagnosticWarning WARNING[:]
|
||||||
syn keyword healthSuccess OK[:]
|
syn keyword DiagnosticOk OK[:]
|
||||||
syn match helpSectionDelim "^======*\n.*$"
|
syn match helpSectionDelim "^======*\n.*$"
|
||||||
syn match healthHeadingChar "=" conceal cchar=─ contained containedin=helpSectionDelim
|
syn match healthHeadingChar "=" conceal cchar=─ contained containedin=helpSectionDelim
|
||||||
|
|
||||||
hi def link healthError Error
|
|
||||||
hi def link healthWarning WarningMsg
|
|
||||||
hi def healthSuccess guibg=#5fff00 guifg=#080808 ctermbg=82 ctermfg=232
|
|
||||||
hi def link healthHelp Identifier
|
|
||||||
|
|
||||||
let b:current_syntax = "checkhealth"
|
let b:current_syntax = "checkhealth"
|
||||||
|
@ -130,8 +130,8 @@ describe('health.vim', function()
|
|||||||
local screen = Screen.new(50, 12)
|
local screen = Screen.new(50, 12)
|
||||||
screen:attach()
|
screen:attach()
|
||||||
screen:set_default_attr_ids({
|
screen:set_default_attr_ids({
|
||||||
Ok = { foreground = Screen.colors.Grey3, background = 6291200 },
|
Ok = { foreground = Screen.colors.LightGreen },
|
||||||
Error = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
|
Error = { foreground = Screen.colors.Red },
|
||||||
Heading = { foreground = tonumber('0x6a0dad') },
|
Heading = { foreground = tonumber('0x6a0dad') },
|
||||||
Bar = { foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGrey },
|
Bar = { foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGrey },
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user