diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-11-30 19:35:00 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-11-30 19:35:00 +0800 |
commit | 5ef1973527cf63eb26215b74c71ed1806da92224 (patch) | |
tree | 214e863dd237b04da06fb52a884ab6a64a476769 /script/provider/provider.lua | |
parent | 8132f4c9da02858c23813d15c2cb6ded6df57ea1 (diff) | |
download | lua-language-server-5ef1973527cf63eb26215b74c71ed1806da92224.zip |
fix supporting for multi-workspace
Diffstat (limited to 'script/provider/provider.lua')
-rw-r--r-- | script/provider/provider.lua | 27 |
1 files changed, 16 insertions, 11 deletions
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 }, }, }, |