From e4f80b9523f4ee9b0430e9d746af47be78f4e326 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 26 Sep 2022 08:49:36 +0200 Subject: fix: pathStrict should also look for strict path uris in workspace libraries --- script/workspace/require-path.lua | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'script/workspace/require-path.lua') diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua index 1b7b25f9..1e7c81e5 100644 --- a/script/workspace/require-path.lua +++ b/script/workspace/require-path.lua @@ -179,21 +179,21 @@ function mt:findUrisByRequireName(suri, name) searcherMap[fullUri] = searcher end end - if not strict then - local tail = '/' .. furi.encode(fspath):gsub('^file:[/]*', '') - for uri in files.eachFile(self.scp.uri) do - if not searcherMap[uri] - and suri ~= uri - and util.stringEndWith(uri, tail) then - results[#results+1] = uri - local parentUri = files.getLibraryUri(self.scp.uri, uri) or self.scp.uri - if parentUri == nil or parentUri == '' then - parentUri = furi.encode '' - end - local relative = uri:sub(#parentUri + 1):sub(1, - #tail) - searcherMap[uri] = workspace.normalize(relative .. searcher) - end - end + local tail = '/' .. furi.encode(fspath):gsub('^file:[/]*', '') + for uri in files.eachFile(self.scp.uri) do + if not searcherMap[uri] + and suri ~= uri + and util.stringEndWith(uri, tail) then + local parentUri = files.getLibraryUri(self.scp.uri, uri) or self.scp.uri + if parentUri == nil or parentUri == '' then + parentUri = furi.encode '' + end + local relative = uri:sub(#parentUri + 1):sub(1, - #tail) + if not strict or relative == "/" then + results[#results+1] = uri + end + searcherMap[uri] = workspace.normalize(relative .. searcher) + end end end -- cgit v1.2.3