Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 81324c0

Browse filesBrowse files
committed
Updated gRPC client
1 parent 765d63a commit 81324c0
Copy full SHA for 81324c0

File tree

Expand file treeCollapse file tree

1 file changed

+8
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-4
lines changed

‎ls/ls.go

Copy file name to clipboardExpand all lines: ls/ls.go
+8-4Lines changed: 8 additions & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.