Skip to content

Commit 8b0d382

Browse files
committed
#847 normalize ./
1 parent edf22ab commit 8b0d382

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

script/workspace/workspace.lua

+1
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ function m.normalize(path)
488488
end
489489
end)
490490
path = util.expandPath(path)
491+
path = path:gsub('^%.[/\\]+', '')
491492
if platform.OS == 'Windows' then
492493
path = path:gsub('[/\\]+', '\\')
493494
:gsub('[/\\]+$', '')

test/crossfile/definition.lua

+25
Original file line numberDiff line numberDiff line change
@@ -867,3 +867,28 @@ print(t.<?x?>)
867867
]]
868868
}
869869
}
870+
871+
local originRuntimePath = config.get 'Lua.runtime.path'
872+
config.set('Lua.runtime.path', {
873+
'./?.lua'
874+
})
875+
876+
TEST {
877+
{
878+
path = 'a.lua',
879+
content = [[
880+
return {
881+
<!x!> = 1,
882+
}
883+
]],
884+
},
885+
{
886+
path = 'b.lua',
887+
content = [[
888+
local t = require 'a'
889+
print(t.<?x?>)
890+
]]
891+
}
892+
}
893+
894+
config.set('Lua.runtime.path', originRuntimePath)

0 commit comments

Comments
 (0)