summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-08 15:59:23 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-08 15:59:23 +0800
commit77a276abe8281ac3b9892ecbc5d21c66c22801c7 (patch)
treedc6768605074aeca6b5e1706dd1645e56fd38b5c
parent4876958951dff23ed234523d89b47a854e88acea (diff)
downloadlua-language-server-77a276abe8281ac3b9892ecbc5d21c66c22801c7.zip
ignore case in Windows
-rw-r--r--meta/3rd/Jass/config.lua1
-rw-r--r--meta/3rd/OpenResty/config.lua16
-rw-r--r--script/library.lua14
3 files changed, 12 insertions, 19 deletions
diff --git a/meta/3rd/Jass/config.lua b/meta/3rd/Jass/config.lua
index dd37d66c..8623494e 100644
--- a/meta/3rd/Jass/config.lua
+++ b/meta/3rd/Jass/config.lua
@@ -1,4 +1,3 @@
--- matched words
words = {'jass.common'}
configs = {
{
diff --git a/meta/3rd/OpenResty/config.lua b/meta/3rd/OpenResty/config.lua
index 6cf1d8df..8bee2d10 100644
--- a/meta/3rd/OpenResty/config.lua
+++ b/meta/3rd/OpenResty/config.lua
@@ -1,7 +1,5 @@
--- list of matched words
-words = {}
-- list or matched file names
-files = {}
+files = {'resty/redis%.lua'}
-- lsit of settings to be changed
configs = {
{
@@ -9,16 +7,4 @@ configs = {
action = 'set',
value = 'LuaJIT',
},
- {
- key = 'Lua.diagnostics.globals',
- action = 'add',
- value = 'global1',
- }
}
-for _, name in ipairs {'global2', 'global3', 'global4'} do
- configs[#configs+1] = {
- key = 'Lua.diagnostics.globals',
- action = 'add',
- value = name,
- }
-end
diff --git a/script/library.lua b/script/library.lua
index 21004ab6..3d52baea 100644
--- a/script/library.lua
+++ b/script/library.lua
@@ -259,6 +259,17 @@ local function loadSingle3rdConfig(libraryDir)
cfg[k] = v
end
+ if cfg.files then
+ for i, filename in ipairs(cfg.files) do
+ if plat.OS == 'Windows' then
+ filename = filename:lower():gsub('/', '\\')
+ else
+ filename = filename:gsub('\\', '/')
+ end
+ cfg.files[i] = filename
+ end
+ end
+
return cfg
end
@@ -361,9 +372,6 @@ local function check3rdByFileName(uri, configs)
if cfg.files then
for _, filename in ipairs(cfg.files) do
await.delay()
- if plat.OS == 'Windows' then
- filename = filename:lower()
- end
if path:match(filename) then
askFor3rd(cfg)
return