-
Notifications
You must be signed in to change notification settings - Fork 7
/
handler.go
56 lines (47 loc) · 1.26 KB
/
handler.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package hyprls
import (
"context"
"go.lsp.dev/protocol"
"go.uber.org/zap"
)
type Handler struct {
protocol.Server
Logger *zap.Logger
}
func NewHandler(ctx context.Context, server protocol.Server, logger *zap.Logger) (Handler, context.Context, error) {
return Handler{
Server: server,
Logger: logger,
}, context.WithValue(ctx, "state", state{}), nil
}
func (h Handler) Initialize(ctx context.Context, params *protocol.InitializeParams) (*protocol.InitializeResult, error) {
logger = h.Logger
return &protocol.InitializeResult{
Capabilities: protocol.ServerCapabilities{
HoverProvider: true,
DocumentSymbolProvider: true,
ColorProvider: true,
CompletionProvider: &protocol.CompletionOptions{
ResolveProvider: false,
TriggerCharacters: []string{},
},
TextDocumentSync: protocol.TextDocumentSyncOptions{
OpenClose: true,
Change: protocol.TextDocumentSyncKindFull,
},
},
ServerInfo: &protocol.ServerInfo{
Name: "hyprls",
Version: Version,
},
}, nil
}
func (h Handler) Initialized(ctx context.Context, params *protocol.InitializedParams) error {
return nil
}
func (h Handler) Shutdown(ctx context.Context) error {
return nil
}
func (h Handler) Exit(ctx context.Context) error {
return nil
}