summaryrefslogtreecommitdiff
path: root/server-beta/src/proto
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-09-20 16:13:53 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-09-20 16:13:53 +0800
commit665af3bd3d2c7e51b2b23336446eb04d5de2e060 (patch)
treea297a41989eb4ccf2c0872ef2a540212188979d9 /server-beta/src/proto
parent14fd68e06334352a9a7247b3d5bd9ba4259229a9 (diff)
downloadlua-language-server-665af3bd3d2c7e51b2b23336446eb04d5de2e060.zip
编译任务
Diffstat (limited to 'server-beta/src/proto')
-rw-r--r--server-beta/src/proto/init.lua22
1 files changed, 21 insertions, 1 deletions
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