File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed
Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 148148--- @return integer min
149149--- @return number max
150150function vm .countReturnsOfCall (func , args , mark )
151- local funcs = vm .getMatchedFunctions (func , args )
151+ local funcs = vm .getMatchedFunctions (func , args , mark )
152152 --- @type integer ?
153153 local min
154154 --- @type number ?
197197
198198--- @param func parser.object
199199--- @param args parser.object[] ?
200+ --- @param mark ? table
200201--- @return parser.object[]
201- function vm .getMatchedFunctions (func , args )
202+ function vm .getMatchedFunctions (func , args , mark )
202203 local funcs = {}
203204 local node = vm .compileNode (func )
204205 for n in node :eachObject () do
@@ -211,7 +212,7 @@ function vm.getMatchedFunctions(func, args)
211212 return funcs
212213 end
213214
214- local amin , amax = vm .countList (args )
215+ local amin , amax = vm .countList (args , mark )
215216
216217 local matched = {}
217218 for _ , n in ipairs (funcs ) do
Original file line number Diff line number Diff line change @@ -169,9 +169,9 @@ function mt:findUrisByRequireName(suri, name)
169169 local searcherMap = {}
170170
171171 for _ , searcher in ipairs (searchers ) do
172- local fspath = searcher :gsub (' %?' , path )
173- if self .scp .uri then
174- local fullPath = workspace . getAbsolutePath ( self . scp . uri , fspath )
172+ local fspath = searcher :gsub (' %?' , path : gsub ( ' %% ' , ' %%%% ' ) )
173+ local fullPath = workspace . getAbsolutePath ( self .scp .uri , fspath )
174+ if fullPath then
175175 local fullUri = furi .encode (fullPath )
176176 if files .exists (fullUri )
177177 and fullUri ~= suri then
Original file line number Diff line number Diff line change @@ -404,12 +404,15 @@ function m.normalize(path)
404404 return path
405405end
406406
407- --- @param folderUri uri
407+ --- @param folderUri ? uri
408408--- @param path string
409- --- @return string
409+ --- @return string ?
410410function m .getAbsolutePath (folderUri , path )
411411 path = m .normalize (path )
412412 if fs .path (path ):is_relative () then
413+ if not folderUri then
414+ return nil
415+ end
413416 local folderPath = furi .decode (folderUri )
414417 path = m .normalize (folderPath .. ' /' .. path )
415418 end
You can’t perform that action at this time.
0 commit comments