summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-19 14:29:31 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-19 14:29:31 +0800
commit282ac2d03f6aa686cc5510dfdce5ad5a3df625bb (patch)
tree14d6135914bb995cfdcc0cbadd6660ee075edf16
parent76eac284e385d671d9488ca4ddf683193a608bcb (diff)
downloadlua-language-server-282ac2d03f6aa686cc5510dfdce5ad5a3df625bb.zip
test
-rw-r--r--script/workspace/scope.lua8
-rw-r--r--script/workspace/workspace.lua4
2 files changed, 11 insertions, 1 deletions
diff --git a/script/workspace/scope.lua b/script/workspace/scope.lua
index 85190f25..a9e8447e 100644
--- a/script/workspace/scope.lua
+++ b/script/workspace/scope.lua
@@ -8,6 +8,14 @@
local mt = {}
mt.__index = mt
+function mt:__tostring()
+ if self.uri then
+ return ('{scope|%s|%s}'):format(self.type, self.uri)
+ else
+ return ('{scope|%s}'):format(self.type)
+ end
+end
+
---@param uri uri
function mt:addLink(uri)
self._links[uri] = true
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index 3676efb5..1867f70d 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -160,6 +160,7 @@ function m.getLibraryMatchers(scp)
if scp:get 'libraryMatcher' then
return scp:get 'libraryMatcher'
end
+ log.info('Build library matchers:', scp)
local librarys = {}
for path in pairs(config.get(scp.uri, 'Lua.workspace.library')) do
@@ -168,7 +169,7 @@ function m.getLibraryMatchers(scp)
librarys[m.normalize(path)] = true
end
end
- -- TODO
+ log.info('meta path:', scp:get 'metaPath')
if scp:get 'metaPath' then
librarys[m.normalize(scp:get 'metaPath')] = true
end
@@ -189,6 +190,7 @@ function m.getLibraryMatchers(scp)
end
scp:set('libraryMatcher', matchers)
+ log.debug('library matcher:', util.dump(matchers))
return matchers
end