summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/provider/capability.lua3
-rw-r--r--script/provider/provider.lua27
2 files changed, 19 insertions, 11 deletions
diff --git a/script/provider/capability.lua b/script/provider/capability.lua
index 4e63f571..19024a54 100644
--- a/script/provider/capability.lua
+++ b/script/provider/capability.lua
@@ -40,6 +40,9 @@ local function resolve(t)
return m.resolvedMap[key] or ''
end)
end
+ if type(v) == 'function' then
+ t[k] = v()
+ end
end
end
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 10feb783..f1ef08e9 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -109,7 +109,7 @@ m.register 'initialize' {
if params.rootUri then
workspace.initRoot(params.rootUri)
- cap.resolve('ROOT_URI', furi.decode(params.rootUri):gsub('\\', '/') .. '/')
+ cap.resolve('ROOT_PATH', furi.decode(params.rootUri):gsub('\\', '/') .. '/')
end
if params.workspaceFolders then
@@ -186,16 +186,21 @@ m.register 'workspace/didRenameFiles' {
workspace = {
fileOperations = {
didRename = {
- filters = {
- {
- pattern = {
- glob = '{ROOT_URI}**',
- options = {
- ignoreCase = true,
- }
- },
- },
- },
+ filters = function ()
+ local filters = {}
+ for i, scp in ipairs(workspace.folders) do
+ local path = furi.decode(scp.uri):gsub('\\', '/')
+ filters[i] = {
+ pattern = {
+ glob = path .. '/**',
+ options = {
+ ignoreCase = true,
+ }
+ },
+ }
+ end
+ return filters
+ end
},
},
},