Skip to content

Commit 07011ac

Browse files
committed
Reorganized repository
1 parent dec44e9 commit 07011ac

File tree

10 files changed

+422
-422
lines changed

10 files changed

+422
-422
lines changed

Diff for: handler/builder.go renamed to ls/builder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package handler
1+
package ls
22

33
import (
44
"bytes"

Diff for: handler/handler.go renamed to ls/ls.go

+387-387
Large diffs are not rendered by default.

Diff for: handler/clangd_client.go renamed to ls/lsp_client_clangd.go

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package handler
1+
package ls
22

33
import (
44
"context"
@@ -15,16 +15,16 @@ import (
1515
"go.bug.st/lsp/jsonrpc"
1616
)
1717

18-
type ClangdClient struct {
19-
conn *lsp.Client
20-
handler *INOLanguageServer
18+
type ClangdLSPClient struct {
19+
conn *lsp.Client
20+
ls *INOLanguageServer
2121
}
2222

23-
func NewClangdClient(logger jsonrpc.FunctionLogger,
23+
func NewClangdLSPClient(logger jsonrpc.FunctionLogger,
2424
buildPath, buildSketchCpp, dataFolder *paths.Path,
2525
connectionClosedCB func(),
2626
inoLanguageServer *INOLanguageServer,
27-
) *ClangdClient {
27+
) *ClangdLSPClient {
2828
clangdStdout, clangdStdin, clangdStderr := startClangd(logger, buildPath, buildSketchCpp, dataFolder)
2929
clangdStdio := streams.NewReadWriteCloser(clangdStdin, clangdStdout)
3030
if enableLogging {
@@ -34,8 +34,8 @@ func NewClangdClient(logger jsonrpc.FunctionLogger,
3434
go io.Copy(os.Stderr, clangdStderr)
3535
}
3636

37-
client := &ClangdClient{
38-
handler: inoLanguageServer,
37+
client := &ClangdLSPClient{
38+
ls: inoLanguageServer,
3939
}
4040
client.conn = lsp.NewClient(clangdStdio, clangdStdio, client)
4141
client.conn.SetLogger(&LSPLogger{IncomingPrefix: "IDE LS <-- Clangd", OutgoingPrefix: "IDE LS --> Clangd"})
@@ -74,68 +74,68 @@ func startClangd(logger jsonrpc.FunctionLogger, compileCommandsDir, sketchCpp, d
7474
}
7575
}
7676

77-
func (client *ClangdClient) Close() {
77+
func (client *ClangdLSPClient) Close() {
7878
panic("unimplemented")
7979
}
8080

8181
// The following are events incoming from Clangd
8282

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) {
8484
panic("unimplemented")
8585
}
8686

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) {
8888
panic("unimplemented")
8989
}
9090

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)
9393
}
9494

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 {
9696
panic("unimplemented")
9797
}
9898

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

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

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) {
108108
panic("unimplemented")
109109
}
110110

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) {
112112
panic("unimplemented")
113113
}
114114

115-
func (client *ClangdClient) WorkspaceCodeLensRefresh(context.Context, jsonrpc.FunctionLogger) *jsonrpc.ResponseError {
115+
func (client *ClangdLSPClient) WorkspaceCodeLensRefresh(context.Context, jsonrpc.FunctionLogger) *jsonrpc.ResponseError {
116116
panic("unimplemented")
117117
}
118118

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)
121121
}
122122

123-
func (client *ClangdClient) LogTrace(jsonrpc.FunctionLogger, *lsp.LogTraceParams) {
123+
func (client *ClangdLSPClient) LogTrace(jsonrpc.FunctionLogger, *lsp.LogTraceParams) {
124124
panic("unimplemented")
125125
}
126126

127-
func (client *ClangdClient) WindowShowMessage(jsonrpc.FunctionLogger, *lsp.ShowMessageParams) {
127+
func (client *ClangdLSPClient) WindowShowMessage(jsonrpc.FunctionLogger, *lsp.ShowMessageParams) {
128128
panic("unimplemented")
129129
}
130130

131-
func (client *ClangdClient) WindowLogMessage(jsonrpc.FunctionLogger, *lsp.LogMessageParams) {
131+
func (client *ClangdLSPClient) WindowLogMessage(jsonrpc.FunctionLogger, *lsp.LogMessageParams) {
132132
panic("unimplemented")
133133
}
134134

135-
func (client *ClangdClient) TelemetryEvent(jsonrpc.FunctionLogger, json.RawMessage) {
135+
func (client *ClangdLSPClient) TelemetryEvent(jsonrpc.FunctionLogger, json.RawMessage) {
136136
panic("unimplemented")
137137
}
138138

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)
141141
}

Diff for: handler/lsp_logger.go renamed to ls/lsp_logger.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package handler
1+
package ls
22

33
import (
44
"fmt"

Diff for: handler/progress.go renamed to ls/progress.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package handler
1+
package ls
22

33
import (
44
"context"

Diff for: main.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"os"
88
"os/signal"
99

10-
"github.com/arduino/arduino-language-server/handler"
10+
"github.com/arduino/arduino-language-server/ls"
1111
"github.com/arduino/arduino-language-server/streams"
1212
"github.com/arduino/go-paths-helper"
1313
)
@@ -52,15 +52,15 @@ func main() {
5252
log.Fatal("Path to ArduinoCLI config file must be set.")
5353
}
5454

55-
handler.Setup(cliPath, cliConfigPath, clangdPath, formatFilePath, enableLogging)
56-
initialBoard := handler.Board{Fqbn: initialFqbn, Name: initialBoardName}
55+
ls.Setup(cliPath, cliConfigPath, clangdPath, formatFilePath, enableLogging)
56+
initialBoard := ls.Board{Fqbn: initialFqbn, Name: initialBoardName}
5757

5858
stdio := streams.NewReadWriteCloser(os.Stdin, os.Stdout)
5959
if enableLogging {
6060
stdio = streams.LogReadWriteCloserAs(stdio, "inols.log")
6161
}
6262

63-
inoHandler := handler.NewINOLanguageServer(stdio, stdio, initialBoard)
63+
inoHandler := ls.NewINOLanguageServer(stdio, stdio, initialBoard)
6464

6565
// Intercept kill signal
6666
c := make(chan os.Signal, 2)

Diff for: handler/sourcemapper/ino.go renamed to sourcemapper/ino.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strconv"
1010
"strings"
1111

12-
"github.com/arduino/arduino-language-server/handler/textutils"
12+
"github.com/arduino/arduino-language-server/textutils"
1313
"github.com/arduino/go-paths-helper"
1414
"github.com/pkg/errors"
1515
"go.bug.st/lsp"
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)