@@ -27,8 +27,8 @@ import (
27
27
// GetInstalledBoards is an helper function useful to autocomplete.
28
28
// It returns a list of fqbn
29
29
// it's taken from cli/board/listall.go
30
- func GetInstalledBoards (srv rpc. ArduinoCoreServiceServer , ctx context. Context ) []string {
31
- inst := instance .CreateAndInit (srv , ctx )
30
+ func GetInstalledBoards (ctx context. Context , srv rpc. ArduinoCoreServiceServer ) []string {
31
+ inst := instance .CreateAndInit (ctx , srv )
32
32
33
33
list , _ := srv .BoardListAll (context .Background (), & rpc.BoardListAllRequest {
34
34
Instance : inst ,
@@ -45,8 +45,8 @@ func GetInstalledBoards(srv rpc.ArduinoCoreServiceServer, ctx context.Context) [
45
45
46
46
// GetInstalledProgrammers is an helper function useful to autocomplete.
47
47
// It returns a list of programmers available based on the installed boards
48
- func GetInstalledProgrammers (srv rpc. ArduinoCoreServiceServer , ctx context. Context ) []string {
49
- inst := instance .CreateAndInit (srv , ctx )
48
+ func GetInstalledProgrammers (ctx context. Context , srv rpc. ArduinoCoreServiceServer ) []string {
49
+ inst := instance .CreateAndInit (ctx , srv )
50
50
51
51
// we need the list of the available fqbn in order to get the list of the programmers
52
52
listAllReq := & rpc.BoardListAllRequest {
@@ -78,8 +78,8 @@ func GetInstalledProgrammers(srv rpc.ArduinoCoreServiceServer, ctx context.Conte
78
78
79
79
// GetUninstallableCores is an helper function useful to autocomplete.
80
80
// It returns a list of cores which can be uninstalled
81
- func GetUninstallableCores (srv rpc. ArduinoCoreServiceServer , ctx context. Context ) []string {
82
- inst := instance .CreateAndInit (srv , ctx )
81
+ func GetUninstallableCores (ctx context. Context , srv rpc. ArduinoCoreServiceServer ) []string {
82
+ inst := instance .CreateAndInit (ctx , srv )
83
83
84
84
platforms , _ := commands .PlatformSearch (& rpc.PlatformSearchRequest {
85
85
Instance : inst ,
@@ -99,8 +99,8 @@ func GetUninstallableCores(srv rpc.ArduinoCoreServiceServer, ctx context.Context
99
99
100
100
// GetInstallableCores is an helper function useful to autocomplete.
101
101
// It returns a list of cores which can be installed/downloaded
102
- func GetInstallableCores (srv rpc. ArduinoCoreServiceServer , ctx context. Context ) []string {
103
- inst := instance .CreateAndInit (srv , ctx )
102
+ func GetInstallableCores (ctx context. Context , srv rpc. ArduinoCoreServiceServer ) []string {
103
+ inst := instance .CreateAndInit (ctx , srv )
104
104
105
105
platforms , _ := commands .PlatformSearch (& rpc.PlatformSearchRequest {
106
106
Instance : inst ,
@@ -118,18 +118,18 @@ func GetInstallableCores(srv rpc.ArduinoCoreServiceServer, ctx context.Context)
118
118
119
119
// GetInstalledLibraries is an helper function useful to autocomplete.
120
120
// It returns a list of libs which are currently installed, including the builtin ones
121
- func GetInstalledLibraries (srv rpc. ArduinoCoreServiceServer , ctx context. Context ) []string {
122
- return getLibraries (srv , ctx , true )
121
+ func GetInstalledLibraries (ctx context. Context , srv rpc. ArduinoCoreServiceServer ) []string {
122
+ return getLibraries (ctx , srv , true )
123
123
}
124
124
125
125
// GetUninstallableLibraries is an helper function useful to autocomplete.
126
126
// It returns a list of libs which can be uninstalled
127
- func GetUninstallableLibraries (srv rpc. ArduinoCoreServiceServer , ctx context. Context ) []string {
128
- return getLibraries (srv , ctx , false )
127
+ func GetUninstallableLibraries (ctx context. Context , srv rpc. ArduinoCoreServiceServer ) []string {
128
+ return getLibraries (ctx , srv , false )
129
129
}
130
130
131
- func getLibraries (srv rpc. ArduinoCoreServiceServer , ctx context. Context , all bool ) []string {
132
- inst := instance .CreateAndInit (srv , ctx )
131
+ func getLibraries (ctx context. Context , srv rpc. ArduinoCoreServiceServer , all bool ) []string {
132
+ inst := instance .CreateAndInit (ctx , srv )
133
133
libs , _ := commands .LibraryList (context .Background (), & rpc.LibraryListRequest {
134
134
Instance : inst ,
135
135
All : all ,
@@ -147,8 +147,8 @@ func getLibraries(srv rpc.ArduinoCoreServiceServer, ctx context.Context, all boo
147
147
148
148
// GetInstallableLibs is an helper function useful to autocomplete.
149
149
// It returns a list of libs which can be installed/downloaded
150
- func GetInstallableLibs (srv rpc. ArduinoCoreServiceServer , ctx context. Context ) []string {
151
- inst := instance .CreateAndInit (srv , ctx )
150
+ func GetInstallableLibs (ctx context. Context , srv rpc. ArduinoCoreServiceServer ) []string {
151
+ inst := instance .CreateAndInit (ctx , srv )
152
152
153
153
libs , _ := commands .LibrarySearch (context .Background (), & rpc.LibrarySearchRequest {
154
154
Instance : inst ,
@@ -165,9 +165,9 @@ func GetInstallableLibs(srv rpc.ArduinoCoreServiceServer, ctx context.Context) [
165
165
// GetAvailablePorts is an helper function useful to autocomplete.
166
166
// It returns a list of upload port of the boards which are currently connected.
167
167
// It will not suggests network ports because the timeout is not set.
168
- func GetAvailablePorts (srv rpc. ArduinoCoreServiceServer , ctx context. Context ) []* rpc.Port {
168
+ func GetAvailablePorts (ctx context. Context , srv rpc. ArduinoCoreServiceServer ) []* rpc.Port {
169
169
// Get the port list
170
- inst := instance .CreateAndInit (srv , ctx )
170
+ inst := instance .CreateAndInit (ctx , srv )
171
171
list , _ := srv .BoardList (ctx , & rpc.BoardListRequest {Instance : inst })
172
172
173
173
// Transform the data structure for the completion (DetectedPort -> Port)
0 commit comments