@@ -16,13 +16,13 @@ import (
16
16
"go.bug.st/lsp/jsonrpc"
17
17
)
18
18
19
- type ClangdLSPClient struct {
19
+ type clangdLSPClient struct {
20
20
conn * lsp.Client
21
21
ls * INOLanguageServer
22
22
}
23
23
24
- // NewClangdLSPClient creates and returns a new client
25
- func NewClangdLSPClient (logger jsonrpc.FunctionLogger , dataFolder * paths.Path , ls * INOLanguageServer ) * ClangdLSPClient {
24
+ // newClangdLSPClient creates and returns a new client
25
+ func newClangdLSPClient (logger jsonrpc.FunctionLogger , dataFolder * paths.Path , ls * INOLanguageServer ) * clangdLSPClient {
26
26
clangdConfFile := ls .buildPath .Join (".clangd" )
27
27
clangdConf := fmt .Sprintln ("Diagnostics:" )
28
28
clangdConf += fmt .Sprintln (" Suppress: [anon_bitfield_qualifiers]" )
@@ -69,7 +69,7 @@ func NewClangdLSPClient(logger jsonrpc.FunctionLogger, dataFolder *paths.Path, l
69
69
go io .Copy (os .Stderr , clangdStderr )
70
70
}
71
71
72
- client := & ClangdLSPClient {
72
+ client := & clangdLSPClient {
73
73
ls : ls ,
74
74
}
75
75
client .conn = lsp .NewClient (clangdStdio , clangdStdio , client )
@@ -84,89 +84,89 @@ func NewClangdLSPClient(logger jsonrpc.FunctionLogger, dataFolder *paths.Path, l
84
84
}
85
85
86
86
// Run sends a Run notification to Clangd
87
- func (client * ClangdLSPClient ) Run () {
87
+ func (client * clangdLSPClient ) Run () {
88
88
client .conn .Run ()
89
89
}
90
90
91
91
// Close sends an Exit notification to Clangd
92
- func (client * ClangdLSPClient ) Close () {
92
+ func (client * clangdLSPClient ) Close () {
93
93
client .conn .Exit () // send "exit" notification to Clangd
94
94
// TODO: kill client.conn
95
95
}
96
96
97
97
// The following are events incoming from Clangd
98
98
99
99
// WindowShowMessageRequest is not implemented
100
- func (client * ClangdLSPClient ) WindowShowMessageRequest (context.Context , jsonrpc.FunctionLogger , * lsp.ShowMessageRequestParams ) (* lsp.MessageActionItem , * jsonrpc.ResponseError ) {
100
+ func (client * clangdLSPClient ) WindowShowMessageRequest (context.Context , jsonrpc.FunctionLogger , * lsp.ShowMessageRequestParams ) (* lsp.MessageActionItem , * jsonrpc.ResponseError ) {
101
101
panic ("unimplemented" )
102
102
}
103
103
104
104
// WindowShowDocument is not implemented
105
- func (client * ClangdLSPClient ) WindowShowDocument (context.Context , jsonrpc.FunctionLogger , * lsp.ShowDocumentParams ) (* lsp.ShowDocumentResult , * jsonrpc.ResponseError ) {
105
+ func (client * clangdLSPClient ) WindowShowDocument (context.Context , jsonrpc.FunctionLogger , * lsp.ShowDocumentParams ) (* lsp.ShowDocumentResult , * jsonrpc.ResponseError ) {
106
106
panic ("unimplemented" )
107
107
}
108
108
109
109
// WindowWorkDoneProgressCreate is not implemented
110
- func (client * ClangdLSPClient ) WindowWorkDoneProgressCreate (ctx context.Context , logger jsonrpc.FunctionLogger , params * lsp.WorkDoneProgressCreateParams ) * jsonrpc.ResponseError {
110
+ func (client * clangdLSPClient ) WindowWorkDoneProgressCreate (ctx context.Context , logger jsonrpc.FunctionLogger , params * lsp.WorkDoneProgressCreateParams ) * jsonrpc.ResponseError {
111
111
return client .ls .WindowWorkDoneProgressCreateReqFromClangd (ctx , logger , params )
112
112
}
113
113
114
114
// ClientRegisterCapability is not implemented
115
- func (client * ClangdLSPClient ) ClientRegisterCapability (context.Context , jsonrpc.FunctionLogger , * lsp.RegistrationParams ) * jsonrpc.ResponseError {
115
+ func (client * clangdLSPClient ) ClientRegisterCapability (context.Context , jsonrpc.FunctionLogger , * lsp.RegistrationParams ) * jsonrpc.ResponseError {
116
116
panic ("unimplemented" )
117
117
}
118
118
119
119
// ClientUnregisterCapability is not implemented
120
- func (client * ClangdLSPClient ) ClientUnregisterCapability (context.Context , jsonrpc.FunctionLogger , * lsp.UnregistrationParams ) * jsonrpc.ResponseError {
120
+ func (client * clangdLSPClient ) ClientUnregisterCapability (context.Context , jsonrpc.FunctionLogger , * lsp.UnregistrationParams ) * jsonrpc.ResponseError {
121
121
panic ("unimplemented" )
122
122
}
123
123
124
124
// WorkspaceWorkspaceFolders is not implemented
125
- func (client * ClangdLSPClient ) WorkspaceWorkspaceFolders (context.Context , jsonrpc.FunctionLogger ) ([]lsp.WorkspaceFolder , * jsonrpc.ResponseError ) {
125
+ func (client * clangdLSPClient ) WorkspaceWorkspaceFolders (context.Context , jsonrpc.FunctionLogger ) ([]lsp.WorkspaceFolder , * jsonrpc.ResponseError ) {
126
126
panic ("unimplemented" )
127
127
}
128
128
129
129
// WorkspaceConfiguration is not implemented
130
- func (client * ClangdLSPClient ) WorkspaceConfiguration (context.Context , jsonrpc.FunctionLogger , * lsp.ConfigurationParams ) ([]json.RawMessage , * jsonrpc.ResponseError ) {
130
+ func (client * clangdLSPClient ) WorkspaceConfiguration (context.Context , jsonrpc.FunctionLogger , * lsp.ConfigurationParams ) ([]json.RawMessage , * jsonrpc.ResponseError ) {
131
131
panic ("unimplemented" )
132
132
}
133
133
134
134
// WorkspaceApplyEdit is not implemented
135
- func (client * ClangdLSPClient ) WorkspaceApplyEdit (context.Context , jsonrpc.FunctionLogger , * lsp.ApplyWorkspaceEditParams ) (* lsp.ApplyWorkspaceEditResult , * jsonrpc.ResponseError ) {
135
+ func (client * clangdLSPClient ) WorkspaceApplyEdit (context.Context , jsonrpc.FunctionLogger , * lsp.ApplyWorkspaceEditParams ) (* lsp.ApplyWorkspaceEditResult , * jsonrpc.ResponseError ) {
136
136
panic ("unimplemented" )
137
137
}
138
138
139
139
// WorkspaceCodeLensRefresh is not implemented
140
- func (client * ClangdLSPClient ) WorkspaceCodeLensRefresh (context.Context , jsonrpc.FunctionLogger ) * jsonrpc.ResponseError {
140
+ func (client * clangdLSPClient ) WorkspaceCodeLensRefresh (context.Context , jsonrpc.FunctionLogger ) * jsonrpc.ResponseError {
141
141
panic ("unimplemented" )
142
142
}
143
143
144
144
// Progress sends a Progress notification
145
- func (client * ClangdLSPClient ) Progress (logger jsonrpc.FunctionLogger , progress * lsp.ProgressParams ) {
145
+ func (client * clangdLSPClient ) Progress (logger jsonrpc.FunctionLogger , progress * lsp.ProgressParams ) {
146
146
client .ls .ProgressNotifFromClangd (logger , progress )
147
147
}
148
148
149
149
// LogTrace is not implemented
150
- func (client * ClangdLSPClient ) LogTrace (jsonrpc.FunctionLogger , * lsp.LogTraceParams ) {
150
+ func (client * clangdLSPClient ) LogTrace (jsonrpc.FunctionLogger , * lsp.LogTraceParams ) {
151
151
panic ("unimplemented" )
152
152
}
153
153
154
154
// WindowShowMessage is not implemented
155
- func (client * ClangdLSPClient ) WindowShowMessage (jsonrpc.FunctionLogger , * lsp.ShowMessageParams ) {
155
+ func (client * clangdLSPClient ) WindowShowMessage (jsonrpc.FunctionLogger , * lsp.ShowMessageParams ) {
156
156
panic ("unimplemented" )
157
157
}
158
158
159
159
// WindowLogMessage is not implemented
160
- func (client * ClangdLSPClient ) WindowLogMessage (jsonrpc.FunctionLogger , * lsp.LogMessageParams ) {
160
+ func (client * clangdLSPClient ) WindowLogMessage (jsonrpc.FunctionLogger , * lsp.LogMessageParams ) {
161
161
panic ("unimplemented" )
162
162
}
163
163
164
164
// TelemetryEvent is not implemented
165
- func (client * ClangdLSPClient ) TelemetryEvent (jsonrpc.FunctionLogger , json.RawMessage ) {
165
+ func (client * clangdLSPClient ) TelemetryEvent (jsonrpc.FunctionLogger , json.RawMessage ) {
166
166
panic ("unimplemented" )
167
167
}
168
168
169
169
// TextDocumentPublishDiagnostics sends a notification to Publish Dignostics
170
- func (client * ClangdLSPClient ) TextDocumentPublishDiagnostics (logger jsonrpc.FunctionLogger , params * lsp.PublishDiagnosticsParams ) {
170
+ func (client * clangdLSPClient ) TextDocumentPublishDiagnostics (logger jsonrpc.FunctionLogger , params * lsp.PublishDiagnosticsParams ) {
171
171
go client .ls .PublishDiagnosticsNotifFromClangd (logger , params )
172
172
}
0 commit comments