summaryrefslogtreecommitdiff
path: root/script/service.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-07-21 20:47:05 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-07-21 20:47:05 +0800
commita8e09c73183228518cd77f686e01ffbfc9dfdc5a (patch)
treedd36a8ed5d1fc27706db5eb87cc0b606df9f8a26 /script/service.lua
parent100bea883a79b4d57e413c7eb2dfcf7b112b2ec5 (diff)
downloadlua-language-server-a8e09c73183228518cd77f686e01ffbfc9dfdc5a.zip
改成用 json.null
Diffstat (limited to 'script/service.lua')
-rw-r--r--script/service.lua11
1 files changed, 4 insertions, 7 deletions
diff --git a/script/service.lua b/script/service.lua
index b5db8080..69343f3f 100644
--- a/script/service.lua
+++ b/script/service.lua
@@ -92,13 +92,10 @@ function mt:_callMethod(name, params)
end
function mt:responseProto(id, response, err)
- local container = table.container()
- if err then
- container.error = err
- else
- container.result = response
- end
- rpc:response(id, container)
+ rpc:response(id, {
+ error = err and err or nil,
+ result = response and response or json.null,
+ })
end
function mt:_doProto(proto)