-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qatls.go
41 lines (34 loc) · 914 Bytes
/
qatls.go
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
36
37
38
39
40
41
package qatls
import (
"github.com/tliron/glsp"
protocol "github.com/tliron/glsp/protocol_3_16"
)
type QatClient struct {
handler protocol.Handler
workspaces []protocol.WorkspaceFolder
}
const lsName = "qatls"
var lsVersion string = "0.1.0"
var client QatClient
func main() {
client.workspaces = []protocol.WorkspaceFolder{}
client.handler = protocol.Handler{
Initialize: initFn,
}
}
func initFn(ctx *glsp.Context, params *protocol.InitializeParams) (any, error) {
capabilities := client.handler.CreateServerCapabilities()
if params.WorkspaceFolders != nil {
client.workspaces = params.WorkspaceFolders
}
client.handler.LogTrace(ctx, &protocol.LogTraceParams{
Message: "Intialised the QAT language server",
})
return protocol.InitializeResult{
Capabilities: capabilities,
ServerInfo: &protocol.InitializeResultServerInfo{
Name: lsName,
Version: &lsVersion,
},
}, nil
}