File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -124,12 +124,11 @@ function m.isLibrary(uri)
124124end
125125
126126--- 获取库文件的根目录
127- function m .getLibraryUri (uri )
128- for _ , scp in ipairs (scope .folders ) do
129- local map = scp :get ' libraryMap'
130- if map and map [uri ] ~= nil then
131- return map [uri ]
132- end
127+ function m .getLibraryUri (suri , uri )
128+ local scp = scope .getScope (suri )
129+ local map = scp :get ' libraryMap'
130+ if map and map [uri ] ~= nil then
131+ return map [uri ]
133132 end
134133 return nil
135134end
Original file line number Diff line number Diff line change @@ -43,15 +43,12 @@ function m.getVisiblePath(suri, path)
4343 local strict = config .get (suri , ' Lua.runtime.pathStrict' )
4444 path = workspace .normalize (path )
4545 local uri = furi .encode (path )
46- local libraryPath = furi .decode (files .getLibraryUri (uri ))
46+ local libraryPath = furi .decode (files .getLibraryUri (suri , uri ))
4747 local scp = scope .getScope (suri )
4848 local cache = scp :get (' visiblePath' ) or scp :set (' visiblePath' , {})
4949 if not cache [path ] then
5050 local result = {}
5151 cache [path ] = result
52- if libraryPath then
53- libraryPath = libraryPath :gsub (' ^[/\\ ]+' , ' ' )
54- end
5552 for _ , searcher in ipairs (searchers ) do
5653 local isAbsolute = searcher :match ' ^[/\\ ]'
5754 or searcher :match ' ^%a+%:'
You can’t perform that action at this time.
0 commit comments