From 979676be219b83c7295409824ee8280a3335cc5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 6 Dec 2018 18:07:10 +0800 Subject: =?UTF-8?q?=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/service.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'server/src/service.lua') diff --git a/server/src/service.lua b/server/src/service.lua index ab33b8e2..98d993f2 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -66,20 +66,20 @@ end function mt:_doProto(proto) local id = proto.id - local method = proto.method + local name = proto.method local params = proto.params - local response, err = self:_callMethod(method, params) + local response, err = self:_callMethod(name, params) if not id then return end - local proto = json.table() - proto.id = id + local container = table.container() + container.id = id if err then - proto.error = err + container.error = err else - proto.result = response + container.result = response end - self:_send(proto) + self:_send(container) end function mt:_doDiagnostic() @@ -95,11 +95,11 @@ function mt:_doDiagnostic() self._needDiagnostics[uri] = nil end for uri, data in pairs(copy) do - local method = 'textDocument/publishDiagnostics' - local res = self:_callMethod(method, data) + local name = 'textDocument/publishDiagnostics' + local res = self:_callMethod(name, data) if res then self:_send { - method = method, + method = name, params = { uri = uri, diagnostics = res, -- cgit v1.2.3