Skip to content

Commit a4aa3dc

Browse files
committed
#436 cannot ignore case in non-Windows platforms
1 parent b9e9b9e commit a4aa3dc

File tree

3 files changed

+66
-5
lines changed

3 files changed

+66
-5
lines changed

Diff for: changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 1.17.3
44
* `CHG` intelli-scense: treat `V[]` as `table<integer, V>` in `pairs`
55
* `FIX` [#435](https://github.com/sumneko/lua-language-server/issues/435)
6+
* `FIX` [#436](https://github.com/sumneko/lua-language-server/issues/436)
67

78
## 1.17.2
89
`2021-3-2`

Diff for: script/workspace/workspace.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,10 @@ function m.findUrisByFilePath(path)
328328
if type(path) ~= 'string' then
329329
return {}
330330
end
331-
local lpath = path:lower():gsub('[/\\]+', '/')
331+
local lpath = path:gsub('[/\\]+', '/')
332+
if platform.OS == 'Windows' then
333+
lpath = lpath:lower()
334+
end
332335
local vm = require 'vm'
333336
local resultCache = vm.getCache 'findUrisByRequirePath.result'
334337
if resultCache[path] then

Diff for: test/crossfile/definition.lua

+61-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
local files = require 'files'
2-
local furi = require 'file-uri'
3-
local core = require 'core.definition'
4-
local config = require 'config'
1+
local files = require 'files'
2+
local furi = require 'file-uri'
3+
local core = require 'core.definition'
4+
local config = require 'config'
5+
local platform = require 'bee.platform'
56

67
rawset(_G, 'TEST', true)
78

@@ -662,3 +663,59 @@ TEST {
662663
]]
663664
}
664665
}
666+
667+
local originOS = platform.OS
668+
platform.OS = 'Linux'
669+
670+
TEST {
671+
{
672+
path = 'test.lua',
673+
content = [[
674+
return {
675+
<!x!> = 1,
676+
}
677+
]],
678+
},
679+
{
680+
path = 'Test.lua',
681+
content = [[
682+
return {
683+
x = 1,
684+
}
685+
]],
686+
},
687+
{
688+
path = 'b.lua',
689+
content = [[
690+
local t = require 'test'
691+
print(t.<?x?>)
692+
]]
693+
}
694+
}
695+
696+
TEST {
697+
{
698+
path = 'test.lua',
699+
content = [[
700+
return {
701+
x = 1,
702+
}
703+
]],
704+
},
705+
{
706+
path = 'Test.lua',
707+
content = [[
708+
return {
709+
<!x!> = 1,
710+
}
711+
]],
712+
},
713+
{
714+
path = 'b.lua',
715+
content = [[
716+
local t = require 'Test'
717+
print(t.<?x?>)
718+
]]
719+
}
720+
}
721+
platform.OS = originOS

0 commit comments

Comments
 (0)