summaryrefslogtreecommitdiff
path: root/server-beta/src/proto/init.lua
blob: 5474b1d8ceabb751c721feef79e76f0a4efc9133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
local proto   = require 'proto.proto'
local util    = require 'utility'
local cap     = require 'proto.capability'

proto.on('initialize', function (params)
    log.debug(util.dump(params))
    return {
        capabilities = cap.initer,
    }
end)

proto.on('initialized', function (params)
    return true
end)

proto.on('exit', function ()
    log.info('Server exited.')
    os.exit(true)
end)

proto.on('shutdown', function ()
    log.info('Server shutdown.')
    return true
end)

proto.on('textDocument/hover', function ()
    return {
        contents = {
            value = 'Hello loli!',
            kind  = 'markdown',
        }
    }
end)

return proto