summaryrefslogtreecommitdiff
path: root/script/workspace
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-04 16:39:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-04 16:39:49 +0800
commit6e7c082aa3e1011cdecd1761f7d04eabc0e2b8ba (patch)
treebbb69bdde3ef94b47269d18251834637873428a3 /script/workspace
parent9699b6c6f6ee1ce658bc93343479b5271c18b7f4 (diff)
downloadlua-language-server-6e7c082aa3e1011cdecd1761f7d04eabc0e2b8ba.zip
fix #377 watched file must check workspace
Diffstat (limited to 'script/workspace')
-rw-r--r--script/workspace/workspace.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index 667a05f2..88451940 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -434,6 +434,12 @@ function m.getRelativePath(uri)
end
end
+function m.isWorkspaceUri(uri)
+ local luri = files.getUri(uri)
+ local ruri = files.getUri(m.uri)
+ return luri:sub(1, #ruri) == ruri
+end
+
--- 获取工作区等级的缓存
function m.getCache(name)
if not m.cache[name] then