diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-03-25 20:08:26 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-03-27 15:16:23 +0800 |
commit | 1dbf4ed28a095013837ecbbc0c7c1ba0e7ebacfa (patch) | |
tree | 59d954eff52c9345649a94d6770cdd63d893cb84 /platform.lua | |
parent | 2e78c013df3bf1f05ec5da7c97506b8e62d5280b (diff) | |
download | lua-language-server-1dbf4ed28a095013837ecbbc0c7c1ba0e7ebacfa.zip |
#462 supports debugger attach
Diffstat (limited to 'platform.lua')
-rw-r--r-- | platform.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/platform.lua b/platform.lua index eb318a84..e984a272 100644 --- a/platform.lua +++ b/platform.lua @@ -32,7 +32,7 @@ end local currentPath = debug.getinfo(1, 'S').source:sub(2) local fs = require 'bee.filesystem' local rootPath = fs.path(currentPath):remove_filename():string() -if dll == '.dll' then +if dll == 'dll' then rootPath = rootPath:gsub('/', '\\') package.path = rootPath .. script .. '\\?.lua' .. ';' .. rootPath .. script .. '\\?\\init.lua' @@ -50,7 +50,8 @@ package.searchers[2] = function (name) local f = io.open(filename) local buf = f:read '*a' f:close() - local init, err = load(buf, '@' .. name) + local relative = filename:sub(#rootPath + 1) + local init, err = load(buf, '@' .. relative) if not init then return err end |