diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-09-04 14:32:09 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-09-04 14:32:09 +0800 |
commit | e942fb2edfc386c1d5bfbdc644ca370d1899e06b (patch) | |
tree | 8968e6610b0ee89d4c71b8f0fb841338a6bea98f | |
parent | 3087a24d9a9ebecf7c7f2b603ad7c6277051da54 (diff) | |
download | lua-language-server-e942fb2edfc386c1d5bfbdc644ca370d1899e06b.zip |
优先尝试 Windows 平台
-rw-r--r-- | server/main.lua | 2 | ||||
-rw-r--r-- | server/platform.lua | 17 |
2 files changed, 9 insertions, 10 deletions
diff --git a/server/main.lua b/server/main.lua index 1f4bfac7..a01db8cb 100644 --- a/server/main.lua +++ b/server/main.lua @@ -1,6 +1,6 @@ local currentPath = debug.getinfo(1, 'S').source:sub(2) local rootPath = currentPath:gsub('[^/\\]-$', '') -dofile('./' .. rootPath .. 'platform.lua') +dofile(rootPath .. 'platform.lua') local fs = require 'bee.filesystem' ROOT = fs.absolute(fs.path(rootPath)):parent_path():parent_path() LANG = LANG or 'en-US' diff --git a/server/platform.lua b/server/platform.lua index 5b903ea1..5384ad3d 100644 --- a/server/platform.lua +++ b/server/platform.lua @@ -1,7 +1,13 @@ local currentPath = debug.getinfo(1, 'S').source:sub(2) local rootPath = currentPath:gsub('[^/\\]-$', '') - -if package.loadlib(rootPath .. 'macOS/bin/bee.so', 'luaopen_bee_platform') then +if package.loadlib(rootPath .. 'Windows/bin/bee.dll', 'luaopen_bee_platform') then + if rootPath == '' then + rootPath = '.\\' + end + package.cpath = rootPath .. 'Windows\\bin\\?.dll' + package.path = rootPath .. 'src\\?.lua' + .. ';' .. rootPath .. 'src\\?\\init.lua' +elseif package.loadlib(rootPath .. 'macOS/bin/bee.so', 'luaopen_bee_platform') then if rootPath == '' then rootPath = './' end @@ -15,13 +21,6 @@ elseif package.loadlib(rootPath .. 'Linux/bin/bee.so', 'luaopen_bee_platform') t package.cpath = rootPath .. 'Linux/bin/?.so' package.path = rootPath .. 'src/?.lua' .. ';' .. rootPath .. 'src/?/init.lua' -elseif package.loadlib(rootPath .. 'Windows/bin/bee.dll', 'luaopen_bee_platform') then - if rootPath == '' then - rootPath = '.\\' - end - package.cpath = rootPath .. 'Windows\\bin\\?.dll' - package.path = rootPath .. 'src\\?.lua' - .. ';' .. rootPath .. 'src\\?\\init.lua' else error([[It doesn't seem to support your OS, please let me know at https://github.com/sumneko/lua-language-server/issues]]) end |