Skip to content

Commit a47d824

Browse files
committed
Made ClangdLSPClient private
1 parent fab9a95 commit a47d824

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

Diff for: ls/ls.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
type INOLanguageServer struct {
3131
config *Config
3232
IDE *IDELSPServer
33-
Clangd *ClangdLSPClient
33+
Clangd *clangdLSPClient
3434

3535
progressHandler *ProgressProxyHandler
3636
closing chan bool
@@ -196,7 +196,7 @@ func (ls *INOLanguageServer) InitializeReqFromIDE(ctx context.Context, logger js
196196
}
197197

198198
// Start clangd
199-
ls.Clangd = NewClangdLSPClient(logger, dataFolder, ls)
199+
ls.Clangd = newClangdLSPClient(logger, dataFolder, ls)
200200
go func() {
201201
defer streams.CatchAndLogPanic()
202202
ls.Clangd.Run()

Diff for: ls/lsp_client_clangd.go

+21-21
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ import (
1616
"go.bug.st/lsp/jsonrpc"
1717
)
1818

19-
type ClangdLSPClient struct {
19+
type clangdLSPClient struct {
2020
conn *lsp.Client
2121
ls *INOLanguageServer
2222
}
2323

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 {
2626
clangdConfFile := ls.buildPath.Join(".clangd")
2727
clangdConf := fmt.Sprintln("Diagnostics:")
2828
clangdConf += fmt.Sprintln(" Suppress: [anon_bitfield_qualifiers]")
@@ -69,7 +69,7 @@ func NewClangdLSPClient(logger jsonrpc.FunctionLogger, dataFolder *paths.Path, l
6969
go io.Copy(os.Stderr, clangdStderr)
7070
}
7171

72-
client := &ClangdLSPClient{
72+
client := &clangdLSPClient{
7373
ls: ls,
7474
}
7575
client.conn = lsp.NewClient(clangdStdio, clangdStdio, client)
@@ -84,89 +84,89 @@ func NewClangdLSPClient(logger jsonrpc.FunctionLogger, dataFolder *paths.Path, l
8484
}
8585

8686
// Run sends a Run notification to Clangd
87-
func (client *ClangdLSPClient) Run() {
87+
func (client *clangdLSPClient) Run() {
8888
client.conn.Run()
8989
}
9090

9191
// Close sends an Exit notification to Clangd
92-
func (client *ClangdLSPClient) Close() {
92+
func (client *clangdLSPClient) Close() {
9393
client.conn.Exit() // send "exit" notification to Clangd
9494
// TODO: kill client.conn
9595
}
9696

9797
// The following are events incoming from Clangd
9898

9999
// 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) {
101101
panic("unimplemented")
102102
}
103103

104104
// 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) {
106106
panic("unimplemented")
107107
}
108108

109109
// 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 {
111111
return client.ls.WindowWorkDoneProgressCreateReqFromClangd(ctx, logger, params)
112112
}
113113

114114
// 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 {
116116
panic("unimplemented")
117117
}
118118

119119
// 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 {
121121
panic("unimplemented")
122122
}
123123

124124
// 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) {
126126
panic("unimplemented")
127127
}
128128

129129
// 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) {
131131
panic("unimplemented")
132132
}
133133

134134
// 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) {
136136
panic("unimplemented")
137137
}
138138

139139
// 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 {
141141
panic("unimplemented")
142142
}
143143

144144
// 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) {
146146
client.ls.ProgressNotifFromClangd(logger, progress)
147147
}
148148

149149
// LogTrace is not implemented
150-
func (client *ClangdLSPClient) LogTrace(jsonrpc.FunctionLogger, *lsp.LogTraceParams) {
150+
func (client *clangdLSPClient) LogTrace(jsonrpc.FunctionLogger, *lsp.LogTraceParams) {
151151
panic("unimplemented")
152152
}
153153

154154
// WindowShowMessage is not implemented
155-
func (client *ClangdLSPClient) WindowShowMessage(jsonrpc.FunctionLogger, *lsp.ShowMessageParams) {
155+
func (client *clangdLSPClient) WindowShowMessage(jsonrpc.FunctionLogger, *lsp.ShowMessageParams) {
156156
panic("unimplemented")
157157
}
158158

159159
// WindowLogMessage is not implemented
160-
func (client *ClangdLSPClient) WindowLogMessage(jsonrpc.FunctionLogger, *lsp.LogMessageParams) {
160+
func (client *clangdLSPClient) WindowLogMessage(jsonrpc.FunctionLogger, *lsp.LogMessageParams) {
161161
panic("unimplemented")
162162
}
163163

164164
// TelemetryEvent is not implemented
165-
func (client *ClangdLSPClient) TelemetryEvent(jsonrpc.FunctionLogger, json.RawMessage) {
165+
func (client *clangdLSPClient) TelemetryEvent(jsonrpc.FunctionLogger, json.RawMessage) {
166166
panic("unimplemented")
167167
}
168168

169169
// 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) {
171171
go client.ls.PublishDiagnosticsNotifFromClangd(logger, params)
172172
}

0 commit comments

Comments
 (0)