diff options
author | fesily <fesil@foxmail.com> | 2024-02-21 15:07:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-21 15:07:51 +0800 |
commit | 27e0c1ec951bb3b980ce6cabb2d9b9a3b2dea609 (patch) | |
tree | cf0c43185eef8eec2fbd8ea37df0fd7cb54392be | |
parent | adfac399b1815731de6f12af1fc3e38516969dc7 (diff) | |
parent | 3e6fd3ce1f2f0528336ded939d776a29bbfaf2eb (diff) | |
download | lua-language-server-27e0c1ec951bb3b980ce6cabb2d9b9a3b2dea609.zip |
Merge branch 'master' into automatic-infer-function-param-type
-rw-r--r-- | script/encoder/ansi.lua | 12 | ||||
-rw-r--r-- | script/proto/proto.lua | 11 |
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') |