summaryrefslogtreecommitdiff
path: root/server-beta/src/proto
diff options
context:
space:
mode:
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