summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorfesily <fesil@foxmail.com>2024-02-21 15:07:51 +0800
committerGitHub <noreply@github.com>2024-02-21 15:07:51 +0800
commit27e0c1ec951bb3b980ce6cabb2d9b9a3b2dea609 (patch)
treecf0c43185eef8eec2fbd8ea37df0fd7cb54392be /script
parentadfac399b1815731de6f12af1fc3e38516969dc7 (diff)
parent3e6fd3ce1f2f0528336ded939d776a29bbfaf2eb (diff)
downloadlua-language-server-27e0c1ec951bb3b980ce6cabb2d9b9a3b2dea609.zip
Merge branch 'master' into automatic-infer-function-param-type
Diffstat (limited to 'script')
-rw-r--r--script/encoder/ansi.lua12
-rw-r--r--script/proto/proto.lua11
2 files changed, 12 insertions, 11 deletions
diff --git a/script/encoder/ansi.lua b/script/encoder/ansi.lua
index f5273c51..7cb64ec3 100644
--- a/script/encoder/ansi.lua
+++ b/script/encoder/ansi.lua
@@ -1,24 +1,24 @@
local platform = require 'bee.platform'
-local unicode
+local windows
if platform.OS == 'Windows' then
- unicode = require 'bee.unicode'
+ windows = require 'bee.windows'
end
local m = {}
function m.toutf8(text)
- if not unicode then
+ if not windows then
return text
end
- return unicode.a2u(text)
+ return windows.a2u(text)
end
function m.fromutf8(text)
- if not unicode then
+ if not windows then
return text
end
- return unicode.u2a(text)
+ return windows.u2a(text)
end
return m
diff --git a/script/proto/proto.lua b/script/proto/proto.lua
index d01c8f36..2460b4ec 100644
--- a/script/proto/proto.lua
+++ b/script/proto/proto.lua
@@ -1,5 +1,3 @@
-local subprocess = require 'bee.subprocess'
-local socket = require 'bee.socket'
local util = require 'utility'
local await = require 'await'
local pub = require 'pub'
@@ -7,7 +5,7 @@ local jsonrpc = require 'jsonrpc'
local define = require 'proto.define'
local json = require 'json'
local inspect = require 'inspect'
-local thread = require 'bee.thread'
+local platform = require 'bee.platform'
local fs = require 'bee.filesystem'
local net = require 'service.net'
local timer = require 'timer'
@@ -234,8 +232,11 @@ end
function m.listen(mode, socketPort)
m.mode = mode
if mode == 'stdio' then
- subprocess.filemode(io.stdin, 'b')
- subprocess.filemode(io.stdout, 'b')
+ if platform.OS == 'Windows' then
+ local windows = require 'bee.windows'
+ windows.filemode(io.stdin, 'b')
+ windows.filemode(io.stdout, 'b')
+ end
io.stdin:setvbuf 'no'
io.stdout:setvbuf 'no'
pub.task('loadProtoByStdio')