File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 14
14
--- @field nvim_meta PlenaryNvimMeta
15
15
--- @field operators PlenaryOperators
16
16
--- @field path PlenaryPath
17
+ --- @field reload PlenaryReload
17
18
--- @field scandir PlenaryScandir
18
19
--- @field strings PlenaryStrings
19
20
--- @field tbl PlenaryTbl
Original file line number Diff line number Diff line change
1
+ --- @class PlenaryReload
1
2
local reload = {}
2
3
4
+ --- @param module_name string
5
+ --- @param starts_with_only ? boolean
3
6
reload .reload_module = function (module_name , starts_with_only )
4
7
-- Default to starts with only
5
8
if starts_with_only == nil then
@@ -9,17 +12,22 @@ reload.reload_module = function(module_name, starts_with_only)
9
12
-- TODO: Might need to handle cpath / compiled lua packages? Not sure.
10
13
local matcher
11
14
if not starts_with_only then
15
+ --- @param pack string
16
+ --- @return integer ?
12
17
matcher = function (pack )
13
18
return string.find (pack , module_name , 1 , true )
14
19
end
15
20
else
16
21
local module_name_pattern = vim .pesc (module_name )
22
+ --- @param pack string
23
+ --- @return integer ?
17
24
matcher = function (pack )
18
25
return string.find (pack , " ^" .. module_name_pattern )
19
26
end
20
27
end
21
28
22
29
-- Handle impatient.nvim automatically.
30
+ --- @diagnostic disable-next-line : undefined-field
23
31
local luacache = (_G .__luacache or {}).cache
24
32
25
33
for pack , _ in pairs (package.loaded ) do
You can’t perform that action at this time.
0 commit comments