1
- package handler
1
+ package ls
2
2
3
3
import (
4
4
"context"
@@ -15,16 +15,16 @@ import (
15
15
"go.bug.st/lsp/jsonrpc"
16
16
)
17
17
18
- type ClangdClient struct {
19
- conn * lsp.Client
20
- handler * INOLanguageServer
18
+ type ClangdLSPClient struct {
19
+ conn * lsp.Client
20
+ ls * INOLanguageServer
21
21
}
22
22
23
- func NewClangdClient (logger jsonrpc.FunctionLogger ,
23
+ func NewClangdLSPClient (logger jsonrpc.FunctionLogger ,
24
24
buildPath , buildSketchCpp , dataFolder * paths.Path ,
25
25
connectionClosedCB func (),
26
26
inoLanguageServer * INOLanguageServer ,
27
- ) * ClangdClient {
27
+ ) * ClangdLSPClient {
28
28
clangdStdout , clangdStdin , clangdStderr := startClangd (logger , buildPath , buildSketchCpp , dataFolder )
29
29
clangdStdio := streams .NewReadWriteCloser (clangdStdin , clangdStdout )
30
30
if enableLogging {
@@ -34,8 +34,8 @@ func NewClangdClient(logger jsonrpc.FunctionLogger,
34
34
go io .Copy (os .Stderr , clangdStderr )
35
35
}
36
36
37
- client := & ClangdClient {
38
- handler : inoLanguageServer ,
37
+ client := & ClangdLSPClient {
38
+ ls : inoLanguageServer ,
39
39
}
40
40
client .conn = lsp .NewClient (clangdStdio , clangdStdio , client )
41
41
client .conn .SetLogger (& LSPLogger {IncomingPrefix : "IDE LS <-- Clangd" , OutgoingPrefix : "IDE LS --> Clangd" })
@@ -74,68 +74,68 @@ func startClangd(logger jsonrpc.FunctionLogger, compileCommandsDir, sketchCpp, d
74
74
}
75
75
}
76
76
77
- func (client * ClangdClient ) Close () {
77
+ func (client * ClangdLSPClient ) Close () {
78
78
panic ("unimplemented" )
79
79
}
80
80
81
81
// The following are events incoming from Clangd
82
82
83
- func (client * ClangdClient ) WindowShowMessageRequest (context.Context , jsonrpc.FunctionLogger , * lsp.ShowMessageRequestParams ) (* lsp.MessageActionItem , * jsonrpc.ResponseError ) {
83
+ func (client * ClangdLSPClient ) WindowShowMessageRequest (context.Context , jsonrpc.FunctionLogger , * lsp.ShowMessageRequestParams ) (* lsp.MessageActionItem , * jsonrpc.ResponseError ) {
84
84
panic ("unimplemented" )
85
85
}
86
86
87
- func (client * ClangdClient ) WindowShowDocument (context.Context , jsonrpc.FunctionLogger , * lsp.ShowDocumentParams ) (* lsp.ShowDocumentResult , * jsonrpc.ResponseError ) {
87
+ func (client * ClangdLSPClient ) WindowShowDocument (context.Context , jsonrpc.FunctionLogger , * lsp.ShowDocumentParams ) (* lsp.ShowDocumentResult , * jsonrpc.ResponseError ) {
88
88
panic ("unimplemented" )
89
89
}
90
90
91
- func (client * ClangdClient ) WindowWorkDoneProgressCreate (ctx context.Context , logger jsonrpc.FunctionLogger , params * lsp.WorkDoneProgressCreateParams ) * jsonrpc.ResponseError {
92
- return client .handler .WindowWorkDoneProgressCreateFromClangd (ctx , logger , params )
91
+ func (client * ClangdLSPClient ) WindowWorkDoneProgressCreate (ctx context.Context , logger jsonrpc.FunctionLogger , params * lsp.WorkDoneProgressCreateParams ) * jsonrpc.ResponseError {
92
+ return client .ls .WindowWorkDoneProgressCreateFromClangd (ctx , logger , params )
93
93
}
94
94
95
- func (client * ClangdClient ) ClientRegisterCapability (context.Context , jsonrpc.FunctionLogger , * lsp.RegistrationParams ) * jsonrpc.ResponseError {
95
+ func (client * ClangdLSPClient ) ClientRegisterCapability (context.Context , jsonrpc.FunctionLogger , * lsp.RegistrationParams ) * jsonrpc.ResponseError {
96
96
panic ("unimplemented" )
97
97
}
98
98
99
- func (client * ClangdClient ) ClientUnregisterCapability (context.Context , jsonrpc.FunctionLogger , * lsp.UnregistrationParams ) * jsonrpc.ResponseError {
99
+ func (client * ClangdLSPClient ) ClientUnregisterCapability (context.Context , jsonrpc.FunctionLogger , * lsp.UnregistrationParams ) * jsonrpc.ResponseError {
100
100
panic ("unimplemented" )
101
101
}
102
102
103
- func (client * ClangdClient ) WorkspaceWorkspaceFolders (context.Context , jsonrpc.FunctionLogger ) ([]lsp.WorkspaceFolder , * jsonrpc.ResponseError ) {
103
+ func (client * ClangdLSPClient ) WorkspaceWorkspaceFolders (context.Context , jsonrpc.FunctionLogger ) ([]lsp.WorkspaceFolder , * jsonrpc.ResponseError ) {
104
104
panic ("unimplemented" )
105
105
}
106
106
107
- func (client * ClangdClient ) WorkspaceConfiguration (context.Context , jsonrpc.FunctionLogger , * lsp.ConfigurationParams ) ([]json.RawMessage , * jsonrpc.ResponseError ) {
107
+ func (client * ClangdLSPClient ) WorkspaceConfiguration (context.Context , jsonrpc.FunctionLogger , * lsp.ConfigurationParams ) ([]json.RawMessage , * jsonrpc.ResponseError ) {
108
108
panic ("unimplemented" )
109
109
}
110
110
111
- func (client * ClangdClient ) WorkspaceApplyEdit (context.Context , jsonrpc.FunctionLogger , * lsp.ApplyWorkspaceEditParams ) (* lsp.ApplyWorkspaceEditResult , * jsonrpc.ResponseError ) {
111
+ func (client * ClangdLSPClient ) WorkspaceApplyEdit (context.Context , jsonrpc.FunctionLogger , * lsp.ApplyWorkspaceEditParams ) (* lsp.ApplyWorkspaceEditResult , * jsonrpc.ResponseError ) {
112
112
panic ("unimplemented" )
113
113
}
114
114
115
- func (client * ClangdClient ) WorkspaceCodeLensRefresh (context.Context , jsonrpc.FunctionLogger ) * jsonrpc.ResponseError {
115
+ func (client * ClangdLSPClient ) WorkspaceCodeLensRefresh (context.Context , jsonrpc.FunctionLogger ) * jsonrpc.ResponseError {
116
116
panic ("unimplemented" )
117
117
}
118
118
119
- func (client * ClangdClient ) Progress (logger jsonrpc.FunctionLogger , progress * lsp.ProgressParams ) {
120
- client .handler .ProgressFromClangd (logger , progress )
119
+ func (client * ClangdLSPClient ) Progress (logger jsonrpc.FunctionLogger , progress * lsp.ProgressParams ) {
120
+ client .ls .ProgressFromClangd (logger , progress )
121
121
}
122
122
123
- func (client * ClangdClient ) LogTrace (jsonrpc.FunctionLogger , * lsp.LogTraceParams ) {
123
+ func (client * ClangdLSPClient ) LogTrace (jsonrpc.FunctionLogger , * lsp.LogTraceParams ) {
124
124
panic ("unimplemented" )
125
125
}
126
126
127
- func (client * ClangdClient ) WindowShowMessage (jsonrpc.FunctionLogger , * lsp.ShowMessageParams ) {
127
+ func (client * ClangdLSPClient ) WindowShowMessage (jsonrpc.FunctionLogger , * lsp.ShowMessageParams ) {
128
128
panic ("unimplemented" )
129
129
}
130
130
131
- func (client * ClangdClient ) WindowLogMessage (jsonrpc.FunctionLogger , * lsp.LogMessageParams ) {
131
+ func (client * ClangdLSPClient ) WindowLogMessage (jsonrpc.FunctionLogger , * lsp.LogMessageParams ) {
132
132
panic ("unimplemented" )
133
133
}
134
134
135
- func (client * ClangdClient ) TelemetryEvent (jsonrpc.FunctionLogger , json.RawMessage ) {
135
+ func (client * ClangdLSPClient ) TelemetryEvent (jsonrpc.FunctionLogger , json.RawMessage ) {
136
136
panic ("unimplemented" )
137
137
}
138
138
139
- func (client * ClangdClient ) TextDocumentPublishDiagnostics (logger jsonrpc.FunctionLogger , params * lsp.PublishDiagnosticsParams ) {
140
- client .handler .PublishDiagnosticsFromClangd (logger , params )
139
+ func (client * ClangdLSPClient ) TextDocumentPublishDiagnostics (logger jsonrpc.FunctionLogger , params * lsp.PublishDiagnosticsParams ) {
140
+ client .ls .PublishDiagnosticsFromClangd (logger , params )
141
141
}
0 commit comments