Skip to content

Commit be6dc4a

Browse files
committed
doc: Added missing types
1 parent a533c68 commit be6dc4a

12 files changed

Lines changed: 1057 additions & 35 deletions

File tree

lua/bars/components/statuscolumn.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ffi.cdef(table.concat(C, "\n"));
2222
--- Line number.
2323
---@param buffer integer
2424
---@param window integer
25-
---@param config statuscolumn.components.lnum
25+
---@param config bars.statuscolumn.lnum
2626
---@return string
2727
scC.lnum = function (buffer, window, config)
2828
---|fS
@@ -118,7 +118,7 @@ scC.lnum = function (buffer, window, config)
118118
end
119119

120120
--- Empty section
121-
---@param config statuscolumn.components.empty
121+
---@param config bars.statuscolumn.empty
122122
---@return string
123123
scC.empty = function (_, _, config)
124124
return table.concat({
@@ -128,7 +128,7 @@ scC.empty = function (_, _, config)
128128
end
129129

130130
--- Border.
131-
---@param config statuscolumn.components.border
131+
---@param config bars.statuscolumn.border
132132
---@return string
133133
scC.border = function (_, _, config)
134134
---|fS
@@ -156,7 +156,7 @@ end
156156
--- Fold column.
157157
---@param buffer integer
158158
---@param window integer
159-
---@param config statuscolumn.components.folds
159+
---@param config bars.statuscolumn.folds
160160
---@return string
161161
scC.folds = function (buffer, window, config)
162162
---|fS
@@ -303,7 +303,7 @@ end
303303
--- Sign column.
304304
---@param buffer integer
305305
---@param _ integer
306-
---@param config statuscolumn.components.signs
306+
---@param config bars.statuscolumn.signs
307307
---@return string
308308
scC.signs = function (buffer, _, config)
309309
---|fS
@@ -357,7 +357,7 @@ scC.signs = function (buffer, _, config)
357357
end
358358

359359
--- Custom column.
360-
---@param config statusline.components.custom
360+
---@param config bars.statusline.custom
361361
---@return string
362362
scC.custom = function (_, _, config)
363363
return config.value --[[ @as string ]];

lua/bars/components/statusline.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ local utils = require("bars.utils");
5757
--- Shows current git branch.
5858
---@param buffer integer
5959
---@param window integer
60-
---@param main_config statusline.components.branch
60+
---@param main_config bars.statusline.branch
6161
---@return string
6262
slC.branch = function (buffer, window, main_config)
6363
---|fS
@@ -201,7 +201,7 @@ end
201201
--- Shows the buffer name.
202202
---@param buffer integer
203203
---@param _ integer
204-
---@param main_config statusline.components.bufname
204+
---@param main_config bars.statusline.bufname
205205
slC.bufname = function (buffer, _, main_config)
206206
---|fS
207207

@@ -301,7 +301,7 @@ end
301301
--- Diagnostics section
302302
---@param buffer integer
303303
---@param window integer
304-
---@param config statusline.components.diagnostics
304+
---@param config bars.statusline.diagnostics
305305
---@return string
306306
slC.diagnostics = function (buffer, window, config)
307307
---|fS
@@ -414,14 +414,14 @@ slC.diagnostics = function (buffer, window, config)
414414
end
415415

416416
--- Empty section.
417-
---@param config statusline.components.empty
417+
---@param config bars.statusline.empty
418418
---@return string
419419
slC.empty = function (_, _, config)
420420
return utils.set_hl(config.hl) .. "%=";
421421
end
422422

423423
--- Shows current mode.
424-
---@param main_config statusline.components.mode
424+
---@param main_config bars.statusline.mode
425425
---@return string
426426
slC.mode = function (_, _, main_config)
427427
---|fS
@@ -462,7 +462,7 @@ slC.mode = function (_, _, main_config)
462462
end
463463

464464
--- Custom section.
465-
---@param config statusline.components.section
465+
---@param config bars.statusline.section
466466
---@return string
467467
slC.section = function (_, _, config, _)
468468
---|fS
@@ -489,7 +489,7 @@ end
489489
--- Ruler.
490490
---@param _ integer
491491
---@param window integer
492-
---@param main_config statusline.components.ruler
492+
---@param main_config bars.statusline.ruler
493493
---@return string
494494
slC.ruler = function (_, window, main_config)
495495
---|fS
@@ -533,7 +533,7 @@ slC.ruler = function (_, window, main_config)
533533
end
534534

535535
--- Macro recording & executing.
536-
---@param config statusline.components.macro
536+
---@param config bars.statusline.macro
537537
---@return string
538538
slC.macro = function (_, _, config)
539539
---|fS
@@ -555,7 +555,7 @@ end
555555
--- Ruler.
556556
---@param buffer integer
557557
---@param window integer
558-
---@param config statusline.components.progress
558+
---@param config bars.statusline.progress
559559
---@return string?
560560
slC.progress = function (buffer, window, config)
561561
---|fS
@@ -662,7 +662,7 @@ slC.progress = function (buffer, window, config)
662662
end
663663

664664
--- Custom section.
665-
---@param config statusline.components.custom
665+
---@param config bars.statusline.custom
666666
---@return string
667667
slC.custom = function (_, _, config)
668668
return config.value --[[ @as string ]];

lua/bars/components/tabline.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ local function wrapped_index (max, val)
2424
end
2525

2626
--- Empty section.
27-
---@param config tabline.components.empty
27+
---@param config bars.tabline.empty
2828
---@return string
2929
tlC.empty = function (_, _, config)
3030
---|fS
@@ -38,7 +38,7 @@ tlC.empty = function (_, _, config)
3838
end
3939

4040
--- Tab list.
41-
---@param config tabline.components.tabs
41+
---@param config bars.tabline.tabs
4242
---@return string
4343
tlC.tabs = function (_, _, config)
4444
---|fS
@@ -224,7 +224,7 @@ tlC.tabs = function (_, _, config)
224224
end
225225

226226
--- Buffer list.
227-
---@param config tabline.components.bufs
227+
---@param config bars.tabline.bufs
228228
---@return string
229229
tlC.bufs = function (_, _, config)
230230
---|fS
@@ -427,7 +427,7 @@ tlC.bufs = function (_, _, config)
427427
end
428428

429429
--- Custom section
430-
---@param config tabline.components.custom
430+
---@param config bars.tabline.custom
431431
---@return string
432432
tlC.custom = function (_, _, config)
433433
return config.value --[[ @as string ]];

lua/bars/components/winbar.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ local utils = require("bars.utils");
44
--- Node under cursor
55
---@param buffer integer
66
---@param window integer
7-
---@param main_config winbar.components.node
7+
---@param main_config bars.winbar.node
88
---@return string
99
wbC.node = function (buffer, window, main_config)
1010
---|fS
@@ -170,7 +170,7 @@ end
170170
--- Node under cursor
171171
---@param buffer integer
172172
---@param window integer
173-
---@param main_config winbar.components.path
173+
---@param main_config bars.winbar.path
174174
---@return string
175175
wbC.path = function (buffer, window, main_config)
176176
---|fS
@@ -247,7 +247,7 @@ wbC.path = function (buffer, window, main_config)
247247
end
248248

249249
--- Custom section.
250-
---@param config winbar.components.custom
250+
---@param config bars.winbar.custom
251251
---@return string
252252
wbC.custom = function (_, _, config)
253253
return config.value --[[ @as string ]];

lua/bars/generic.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ function generic:set_default_state ()
88
window_state = {},
99
};
1010

11+
---@diagnostic disable-next-line: missing-fields
1112
self.config = {};
1213
self.use_blank_output = false;
1314
end

lua/bars/statuscolumn.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ local gradient_map = {
3434
};
3535

3636

37-
---@type statuscolumn.config
3837
statuscolumn.config = {
3938
force_attach = {},
4039

lua/bars/statusline.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ statusline.default = "%!v:lua.require('bars.statusline').render()";
55
statusline.var_name = "bars_statusline_style";
66

77
--[[ Reusable configuration templates. ]]
8-
---@type table<string, statusline.component>
8+
---@type table<string, bars.statusline.component>
99
local TEMPLATES;
1010

1111
TEMPLATES = {
1212
---|fS
1313

14-
---@type statusline.components.mode
14+
---@type bars.statusline.mode
1515
mode = {
1616
---|fS "Mode configuration"
1717

@@ -125,7 +125,7 @@ TEMPLATES = {
125125

126126
---|fE
127127
},
128-
---@type statusline.components.bufname
128+
---@type bars.statusline.bufname
129129
bufname = {
130130
---|fS
131131

@@ -163,7 +163,7 @@ TEMPLATES = {
163163

164164
---|fE
165165
},
166-
---@type statusline.components.diagnostics
166+
---@type bars.statusline.diagnostics
167167
diagnostics = {
168168
---|fS
169169

@@ -191,7 +191,7 @@ TEMPLATES = {
191191

192192
---|fE
193193
},
194-
---@type statusline.components.macro
194+
---@type bars.statusline.macro
195195
macro = {
196196
---|fS
197197

@@ -231,7 +231,7 @@ TEMPLATES = {
231231

232232
---|fE
233233
},
234-
---@type statusline.components.branch
234+
---@type bars.statusline.branch
235235
git_branch = {
236236
---|fS
237237

@@ -250,7 +250,7 @@ TEMPLATES = {
250250

251251
---|fE
252252
},
253-
---@type statusline.components.custom
253+
---@type bars.statusline.custom
254254
lsp = {
255255
---|fS
256256

@@ -303,7 +303,7 @@ TEMPLATES = {
303303
---|fE
304304
},
305305

306-
---@type statusline.components.ruler
306+
---@type bars.statusline.ruler
307307
ruler = {
308308
---|fS
309309

0 commit comments

Comments
 (0)