Skip to content

Commit 1df1960

Browse files
authored
fix(#3265): rename module api.health to api.appearance, to avoid :checkhealth detection (#3266)
1 parent 2f1010c commit 1df1960

File tree

8 files changed

+36
-37
lines changed

8 files changed

+36
-37
lines changed

doc/nvim-tree-lua.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,9 @@ All commands execute public API.
278278
keep_buffers = true
279279
})
280280
<
281-
*:NvimTreeHiTest* |nvim_tree.api.health.hi_test()| >lua
281+
*:NvimTreeHiTest* |nvim_tree.api.appearance.hi_test()| >lua
282282

283-
require("nvim-tree.api").health.hi_test()
283+
require("nvim-tree.api").appearance.hi_test()
284284
<
285285
*:NvimTreeResize* |nvim_tree.api.tree.resize()| >lua
286286

@@ -903,7 +903,7 @@ Deprecated API with unchanged function signature:
903903
`api.config.mappings.get_keymap_default` |nvim_tree.api.map.keymap.default()|
904904
`api.config.mappings.default_on_attach` |nvim_tree.api.map.on_attach.default()|
905905

906-
`api.diagnostics.hi_test` |nvim_tree.api.health.hi_test()|
906+
`api.diagnostics.hi_test` |nvim_tree.api.appearance.hi_test()|
907907

908908
`api.live_filter.start` |nvim_tree.api.filter.live.start()|
909909
`api.live_filter.clear` |nvim_tree.api.filter.live.clear()|
@@ -2287,12 +2287,12 @@ Please do not require or use modules other than `nvim-tree.api`, as internal
22872287
modules will change without notice.
22882288

22892289
The API is separated into multiple modules:
2290+
|nvim-tree-api-appearance|
22902291
|nvim-tree-api-commands|
22912292
|nvim-tree-api-events|
22922293
|nvim-tree-api-filter|
22932294
|nvim-tree-api-fs|
22942295
|nvim-tree-api-git|
2295-
|nvim-tree-api-health|
22962296
|nvim-tree-api-map|
22972297
|nvim-tree-api-marks|
22982298
|nvim-tree-api-node|
@@ -2354,6 +2354,16 @@ e.g. the following are functionally identical: >lua
23542354

23552355

23562356

2357+
==============================================================================
2358+
API: appearance *nvim-tree-api-appearance*
2359+
2360+
hi_test() *nvim_tree.api.appearance.hi_test()*
2361+
Open a new buffer displaying all nvim-tree highlight groups, their link
2362+
chain and concrete definition.
2363+
2364+
Similar to `:so $VIMRUNTIME/syntax/hitest.vim` as per |:highlight|
2365+
2366+
23572367
==============================================================================
23582368
API: commands *nvim-tree-api-commands*
23592369

@@ -2530,16 +2540,6 @@ reload() *nvim_tree.api.git.reload()*
25302540
Update the git status of the entire tree.
25312541

25322542

2533-
==============================================================================
2534-
API: health *nvim-tree-api-health*
2535-
2536-
hi_test() *nvim_tree.api.health.hi_test()*
2537-
Open a new buffer displaying all nvim-tree highlight groups, their link
2538-
chain and concrete definition.
2539-
2540-
Similar to `:so $VIMRUNTIME/syntax/hitest.vim` as per |:highlight|
2541-
2542-
25432543
==============================================================================
25442544
API: map *nvim-tree-api-map*
25452545

Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---@meta
2-
local nvim_tree = { api = { health = {} } }
2+
local nvim_tree = { api = { appearance = {} } }
33

44
---
55
---Open a new buffer displaying all nvim-tree highlight groups, their link chain and concrete definition.
66
---
77
---Similar to `:so $VIMRUNTIME/syntax/hitest.vim` as per |:highlight|
88
---
9-
function nvim_tree.api.health.hi_test() end
9+
function nvim_tree.api.appearance.hi_test() end
1010

11-
return nvim_tree.api.health
11+
return nvim_tree.api.appearance

lua/nvim-tree/_meta/api/deprecated.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function nvim_tree.api.live_filter.clear() end
2727

2828
nvim_tree.api.diagnostics = {}
2929

30-
---@deprecated use `nvim_tree.api.health.hi_test()`
30+
---@deprecated use `nvim_tree.api.appearance.hi_test()`
3131
function nvim_tree.api.diagnostics.hi_test() end
3232

3333
nvim_tree.api.decorator = {}

lua/nvim-tree/api.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
---
66
---The API is separated into multiple modules:
77
---
8+
---- [nvim-tree-api-appearance]
89
---- [nvim-tree-api-commands]
910
---- [nvim-tree-api-events]
1011
---- [nvim-tree-api-filter]
1112
---- [nvim-tree-api-fs]
1213
---- [nvim-tree-api-git]
13-
---- [nvim-tree-api-health]
1414
---- [nvim-tree-api-map]
1515
---- [nvim-tree-api-marks]
1616
---- [nvim-tree-api-node]
@@ -75,12 +75,12 @@
7575
---@class nvim_tree.api
7676
---@nodoc
7777
local api = {
78+
appearance = require("nvim-tree._meta.api.appearance"),
7879
commands = require("nvim-tree._meta.api.commands"),
7980
events = require("nvim-tree._meta.api.events"),
8081
filter = require("nvim-tree._meta.api.filter"),
8182
fs = require("nvim-tree._meta.api.fs"),
8283
git = require("nvim-tree._meta.api.git"),
83-
health = require("nvim-tree._meta.api.health"),
8484
map = require("nvim-tree._meta.api.map"),
8585
marks = require("nvim-tree._meta.api.marks"),
8686
node = require("nvim-tree._meta.api.node"),

lua/nvim-tree/api/impl/pre.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function M.hydrate(api)
4848
api.map.keymap.default = keymap.get_keymap_default
4949

5050
-- lazy functions
51-
api.health.hi_test = function() require("nvim-tree.appearance.hi-test")() end
51+
api.appearance.hi_test = function() require("nvim-tree.appearance.hi-test")() end
5252

5353
-- classes
5454
api.Decorator = Decorator:extend()

lua/nvim-tree/commands.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ local CMDS = {
143143
desc = "nvim-tree: highlight test",
144144
},
145145
command = function()
146-
require("nvim-tree.api").health.hi_test()
146+
require("nvim-tree.api").appearance.hi_test()
147147
end,
148148
},
149149
}

lua/nvim-tree/legacy.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ function M.map_api(api)
174174
api.tree.toggle_no_bookmark_filter = api.filter.no_bookmark.toggle
175175

176176
api.diagnostics = api.diagnostics or {}
177-
api.diagnostics.hi_test = api.health.hi_test
177+
api.diagnostics.hi_test = api.appearance.hi_test
178178

179179
api.decorator.UserDecorator = api.Decorator
180180
end

scripts/vimdoc_config.lua

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,19 @@ local srcs_config = {
4646

4747
---@type Src[]
4848
local srcs_api = {
49-
{ helptag = "nvim-tree-api", section = "API", path = base .. "api.lua", },
50-
51-
{ helptag = "nvim-tree-api-commands", section = "API: commands", path = base .. "_meta/api/commands.lua", },
52-
{ helptag = "nvim-tree-api-events", section = "API: events", path = base .. "_meta/api/events.lua", },
53-
{ helptag = "nvim-tree-api-filter", section = "API: filter", path = base .. "_meta/api/filter.lua", },
54-
{ helptag = "nvim-tree-api-fs", section = "API: fs", path = base .. "_meta/api/fs.lua", },
55-
{ helptag = "nvim-tree-api-git", section = "API: git", path = base .. "_meta/api/git.lua", },
56-
{ helptag = "nvim-tree-api-health", section = "API: health", path = base .. "_meta/api/health.lua", },
57-
{ helptag = "nvim-tree-api-map", section = "API: map", path = base .. "_meta/api/map.lua", },
58-
{ helptag = "nvim-tree-api-marks", section = "API: marks", path = base .. "_meta/api/marks.lua", },
59-
{ helptag = "nvim-tree-api-node", section = "API: node", path = base .. "_meta/api/node.lua", },
60-
{ helptag = "nvim-tree-api-tree", section = "API: tree", path = base .. "_meta/api/tree.lua", },
61-
62-
{ helptag = "nvim-tree-class", section = "PLACEHOLDER", path = placeholder, },
49+
{ helptag = "nvim-tree-api", section = "API", path = base .. "api.lua", },
50+
{ helptag = "nvim-tree-api-appearance", section = "API: appearance", path = base .. "_meta/api/appearance.lua", },
51+
{ helptag = "nvim-tree-api-commands", section = "API: commands", path = base .. "_meta/api/commands.lua", },
52+
{ helptag = "nvim-tree-api-events", section = "API: events", path = base .. "_meta/api/events.lua", },
53+
{ helptag = "nvim-tree-api-filter", section = "API: filter", path = base .. "_meta/api/filter.lua", },
54+
{ helptag = "nvim-tree-api-fs", section = "API: fs", path = base .. "_meta/api/fs.lua", },
55+
{ helptag = "nvim-tree-api-git", section = "API: git", path = base .. "_meta/api/git.lua", },
56+
{ helptag = "nvim-tree-api-map", section = "API: map", path = base .. "_meta/api/map.lua", },
57+
{ helptag = "nvim-tree-api-marks", section = "API: marks", path = base .. "_meta/api/marks.lua", },
58+
{ helptag = "nvim-tree-api-node", section = "API: node", path = base .. "_meta/api/node.lua", },
59+
{ helptag = "nvim-tree-api-tree", section = "API: tree", path = base .. "_meta/api/tree.lua", },
60+
61+
{ helptag = "nvim-tree-class", section = "PLACEHOLDER", path = placeholder, },
6362
}
6463

6564
---@type Src[]

0 commit comments

Comments
 (0)