@@ -4,45 +4,43 @@ local h = vim.health
44local start = vim .health .start
55local ok , err , warn = h .ok , h .error , h .warn
66
7- H .mod = function ()
8- if require (' down.config' ). mod == nil then
9- h .error ' config.mod is nil'
7+ H .user = function ()
8+ if require (" down.config" ). user == nil then
9+ h .error ( " config.mod is nil" )
1010 else
11- h .ok ' config.mod is not nil'
11+ h .ok ( " config.mod is not nil" )
1212 end
1313end
1414
1515H .workspace = function ()
16- if require (' down.config' ). mod .workspace .config .workspaces == nil then
17- h .error ' config.mod.workspace.workspaces is nil'
16+ if require (" down.config" ). user .workspace .config .workspaces == nil then
17+ h .error ( " config.mod.workspace.workspaces is nil" )
1818 else
19- h .ok ' config.mod.workspace.workspaces is not nil'
20- end
21- end
22-
23- H .user = function ()
24- if require (' down.config' ).user == nil then
25- h .error ' config.user is nil'
26- else
27- h .ok ' config.user is not nil'
19+ h .ok (" config.mod.workspace.workspaces is not nil" )
2820 end
2921end
3022
3123H .deps = {
32- [' nvim-treesitter' ] = ' nvim-treesitter/nvim-treesitter' ,
33- [' plenary.nvim' ] = ' nvim-lua/plenary.nvim' ,
34- [' dressing.nvim' ] = ' stevearc/dressing.nvim' ,
35- [' nui.nvim' ] = " MunifTanjim/nui.nvim"
24+ [" nvim-treesitter" ] = " nvim-treesitter/nvim-treesitter" ,
25+ [" plenary.nvim" ] = " nvim-lua/plenary.nvim" ,
26+ [" nui.nvim" ] = " MunifTanjim/nui.nvim" ,
3627}
3728
3829H .optional = {
39- [' telescope.nvim' ] = ' nvim-telescope/telescope.nvim' ,
30+ [" telescope.nvim" ] = " nvim-telescope/telescope.nvim" ,
4031 [" nvim-web-devicons" ] = " kyazdani42/nvim-web-devicons" ,
41- [" mini.icons" ] = " wuelnerdotexe/mini.icons"
32+ [" mini.icons" ] = " wuelnerdotexe/mini.icons" ,
4233}
4334
35+ --- @param i ? down.mod.ui.icon.Provider.Name
36+ H .has_icon_provider = function (i )
37+ if require (" down.mod.ui.icon.util" ).has_provider (i ) then
38+ return h .ok (" Icon provider is available" )
39+ end
40+ end
41+
4442H .check_dep = function (dep )
45- local lazyok , lazy = pcall (require , ' lazy.core.config' )
43+ local lazyok , lazy = pcall (require , " lazy.core.config" )
4644 if lazyok then
4745 return lazy .plugins [dep ] ~= nil
4846 else
@@ -51,35 +49,36 @@ H.check_dep = function(dep)
5149end
5250
5351H .check_optional = function ()
54- if H .check_dep (' telescope.nvim' ) then
55- h .ok (H .optional [' telescope.nvim' ] .. ' is installed' )
52+ if H .check_dep (" telescope.nvim" ) then
53+ h .ok (H .optional [" telescope.nvim" ] .. " is installed" )
5654 else
57- h .warn (H .optional [' telescope.nvim' ] .. ' is not installed' )
55+ h .warn (H .optional [" telescope.nvim" ] .. " is not installed" )
5856 end
59- if H .check_dep (' nvim-web-devicons' )
60- or H .check_dep (' mini.icons' ) then
61- h .warn (H .optional [' mini.icons' ] .. ' is not installed' )
57+ if H .check_dep (" nvim-web-devicons" ) or H .check_dep (" mini.icons" ) then
58+ h .warn (H .optional [" mini.icons" ] .. " is not installed" )
6259 else
63- h .warn (H .optional [' mini.icons' ] or H .optional [' nvim-web-devicons' ] .. ' is not installed' )
60+ h .warn (
61+ H .optional [" mini.icons" ]
62+ or H .optional [" nvim-web-devicons" ] .. " is not installed"
63+ )
6464 end
6565end
6666
6767H .check_req = function ()
6868 for dep , repo in pairs (H .deps ) do
6969 if H .check_dep (dep ) then
70- h .ok (dep .. ' is installed' )
70+ h .ok (dep .. " is installed" .. repo )
7171 else
72- h .error (dep .. ' is not installed' )
72+ h .error (dep .. " is not installed" .. repo )
7373 end
7474 end
7575end
7676
7777H .check = function ()
78- h .start ' down.nvim'
78+ h .start ( " down.nvim" )
7979 H .check_optional ()
8080 H .check_req ()
8181 H .user ()
82- H .mod ()
8382 H .workspace ()
8483end
8584
0 commit comments