summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-22 20:31:58 +0800
committersumneko <sumneko@hotmail.com>2019-04-22 20:31:58 +0800
commit93e2f3eba87b85a8bb819bd5557aa13145143be2 (patch)
tree2342310c233203938ce8f6c274a7adafe6792896
parent05586ecd48300bbc4b8fb7f5a8e85a628eefda8e (diff)
downloadlua-language-server-93e2f3eba87b85a8bb819bd5557aa13145143be2.zip
修正windows平台下,require 没有无视大小写的BUG
-rw-r--r--server/src/workspace.lua1
-rw-r--r--server/test/crossfile/definition.lua12
2 files changed, 13 insertions, 0 deletions
diff --git a/server/src/workspace.lua b/server/src/workspace.lua
index 16649939..1efa16f0 100644
--- a/server/src/workspace.lua
+++ b/server/src/workspace.lua
@@ -408,6 +408,7 @@ function mt:matchPath(baseUri, input)
end
function mt:searchPath(baseUri, str)
+ str = getFileName(fs.path(str))
if self.searched[baseUri] and self.searched[baseUri][str] then
return self.searched[baseUri][str]
end
diff --git a/server/test/crossfile/definition.lua b/server/test/crossfile/definition.lua
index b824c9dc..aac08802 100644
--- a/server/test/crossfile/definition.lua
+++ b/server/test/crossfile/definition.lua
@@ -84,6 +84,18 @@ TEST {
TEST {
{
path = 'a.lua',
+ content = '',
+ target = {0, 0},
+ },
+ {
+ path = 'b.lua',
+ content = 'require <?"A"?>',
+ },
+}
+
+TEST {
+ {
+ path = 'a.lua',
content = 'local <!t!> = 1; return t',
},
{