Skip to content

Commit 81324c0

Browse files
committed
Updated gRPC client
1 parent 765d63a commit 81324c0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Diff for: ls/ls.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"sync"
2929
"time"
3030

31-
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/settings/v1"
31+
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
3232
"github.com/arduino/arduino-language-server/globals"
3333
"github.com/arduino/arduino-language-server/sourcemapper"
3434
"github.com/arduino/arduino-language-server/streams"
@@ -40,6 +40,7 @@ import (
4040
"go.bug.st/lsp/jsonrpc"
4141
"go.bug.st/lsp/textedits"
4242
"google.golang.org/grpc"
43+
"google.golang.org/grpc/credentials/insecure"
4344
)
4445

4546
// INOLanguageServer is a JSON-RPC handler that delegates messages to clangd.
@@ -1430,14 +1431,17 @@ func (ls *INOLanguageServer) extractDataFolderFromArduinoCLI(logger jsonrpc.Func
14301431
var dataDir string
14311432
if ls.config.CliPath == nil {
14321433
// Establish a connection with the arduino-cli gRPC server
1433-
conn, err := grpc.Dial(ls.config.CliDaemonAddress, grpc.WithInsecure(), grpc.WithBlock())
1434+
conn, err := grpc.Dial(
1435+
ls.config.CliDaemonAddress,
1436+
grpc.WithTransportCredentials(insecure.NewCredentials()),
1437+
grpc.WithBlock())
14341438
if err != nil {
14351439
return nil, fmt.Errorf("error connecting to arduino-cli rpc server: %w", err)
14361440
}
14371441
defer conn.Close()
1438-
client := rpc.NewSettingsServiceClient(conn)
1442+
client := rpc.NewArduinoCoreServiceClient(conn)
14391443

1440-
resp, err := client.GetValue(context.Background(), &rpc.GetValueRequest{
1444+
resp, err := client.SettingsGetValue(context.Background(), &rpc.SettingsGetValueRequest{
14411445
Key: "directories.data",
14421446
})
14431447
if err != nil {

0 commit comments

Comments
 (0)