From 665af3bd3d2c7e51b2b23336446eb04d5de2e060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 20 Sep 2019 16:13:53 +0800 Subject: =?UTF-8?q?=E7=BC=96=E8=AF=91=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/src/proto/init.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'server-beta/src/proto') diff --git a/server-beta/src/proto/init.lua b/server-beta/src/proto/init.lua index 5474b1d8..6e52fcbe 100644 --- a/server-beta/src/proto/init.lua +++ b/server-beta/src/proto/init.lua @@ -1,9 +1,11 @@ local proto = require 'proto.proto' local util = require 'utility' local cap = require 'proto.capability' +local pub = require 'pub' +local task = require 'task' proto.on('initialize', function (params) - log.debug(util.dump(params)) + --log.debug(util.dump(params)) return { capabilities = cap.initer, } @@ -32,4 +34,22 @@ proto.on('textDocument/hover', function () } end) +proto.on('textDocument/didOpen', function (params) + local doc = params.textDocument + local uri = doc.uri + local text = doc.text + local state = pub.task('compile', text) +end) + +proto.on('textDocument/didClose', function (params) +end) + +proto.on('textDocument/didChange', function (params) + local doc = params.textDocument + local change = params.contentChanges + local uri = doc.uri + local text = change[1].text + local state = pub.task('compile', text) +end) + return proto -- cgit v1.2.3