@@ -75,24 +75,45 @@ async function getBoardlistWest(setupState: SetupState, folder: vscode.Uri | und
75
75
}
76
76
77
77
let prevError : any ;
78
- if ( setupState . zephyrVersion === undefined ) { return ; }
78
+ console . log ( "zephyrVersion" ) ;
79
+ console . log ( setupState . zephyrVersion ) ;
80
+
81
+ if ( setupState . zephyrVersion === undefined ) {
82
+ console . log ( "Returning because zephyrVersion is not set" ) ;
83
+ return ;
84
+ }
79
85
let res ;
80
86
let has_qualifiers = false ;
81
87
let has_revisions = false ;
88
+ console . log ( "Getting board list" ) ;
89
+
82
90
if ( isVersionNumberGreater ( setupState . zephyrVersion , 4 , 1 , 0 ) ) {
91
+
92
+ console . log ( "Getting board list1" ) ;
83
93
res = await executeShellCommandInPythonEnv ( "west boards -f '{name};{dir};{qualifiers};{revisions};{revision_default}'" + boardRootString , setupState . setupPath , setupState , false ) ;
84
94
has_qualifiers = true ;
85
95
has_revisions = true ;
86
96
} else if ( isVersionNumberGreaterEqual ( setupState . zephyrVersion , 3 , 7 , 0 ) ) {
97
+ console . log ( "Getting board list2" ) ;
87
98
res = await executeShellCommandInPythonEnv ( "west boards -f '{name};{dir};{qualifiers}'" + boardRootString , setupState . setupPath , setupState , false ) ;
88
99
has_qualifiers = true ;
89
100
} else {
101
+
102
+ console . log ( "Getting board list3" ) ;
90
103
res = await executeShellCommandInPythonEnv ( "west boards -f '{name};{dir}'" + boardRootString , setupState . setupPath , setupState , false ) ;
91
104
}
105
+ console . log ( "Got board list" ) ;
106
+
107
+ console . log ( res ) ;
108
+ console . log ( res . stdout ) ;
109
+ console . log ( res . stderr ) ;
110
+ console . log ( JSON . stringify ( res ) ) ;
92
111
93
- if ( ! res . stdout ) {
94
- output . append ( prevError ) ;
95
- output . append ( res . stderr ) ;
112
+ if ( ! res . stdout || res . stdout === "" ) {
113
+ console . log ( "error" ) ;
114
+
115
+ console . log ( prevError ) ;
116
+ console . log ( res . stderr ) ;
96
117
vscode . window . showErrorMessage ( "Failed to run west boards command. See Zephyr IDE Output for error message" ) ;
97
118
return ;
98
119
}
@@ -154,8 +175,8 @@ export async function pickBoard(setupState: SetupState, rootPath: string) {
154
175
boardDirectories . push ( "Select Other Folder" ) ;
155
176
const boardDirectoriesQpItems : QuickPickItem [ ] = boardDirectories . map ( label => ( { label } ) ) ;
156
177
157
- const title = "Board Picker" ;
158
-
178
+ const title = "Board Dir Picker" ;
179
+ console . log ( "picking directories" ) ;
159
180
let pickPromise = showQuickPick ( {
160
181
title,
161
182
step : 1 ,
@@ -176,6 +197,7 @@ export async function pickBoard(setupState: SetupState, rootPath: string) {
176
197
177
198
let relBoardDir : string | undefined = path . relative ( rootPath , ( pick . label ) ) ;
178
199
if ( pick . label === "Select Other Folder" ) {
200
+ console . log ( "selecting other folder" ) ;
179
201
const boarddir = await vscode . window . showOpenDialog ( {
180
202
canSelectFiles : false ,
181
203
canSelectFolders : true ,
@@ -192,13 +214,19 @@ export async function pickBoard(setupState: SetupState, rootPath: string) {
192
214
}
193
215
194
216
let boardList ;
217
+ console . log ( "getting board list" ) ;
218
+ console . log ( relBoardDir ) ;
219
+
195
220
if ( relBoardDir ) {
196
221
boardList = await getBoardlistWest ( setupState , vscode . Uri . file ( path . join ( rootPath , relBoardDir ) ) ) ;
197
222
} else {
198
223
boardList = await getBoardlistWest ( setupState , undefined ) ;
199
224
}
225
+ console . log ( "finished getting boar lsit" ) ;
200
226
201
227
if ( ! boardList ) {
228
+ console . log ( "empty board list" ) ;
229
+
202
230
return ;
203
231
}
204
232
@@ -213,12 +241,17 @@ export async function pickBoard(setupState: SetupState, rootPath: string) {
213
241
activeItem : undefined
214
242
} ) . catch ( ( error ) => {
215
243
console . error ( error ) ;
244
+
245
+ console . log ( "Pick Board error" ) ;
216
246
return undefined ;
217
247
} ) ;
218
248
pick = ( await pickPromise as QuickPickItem ) ;
219
249
if ( ! pick ) {
250
+ console . log ( "Pick error" ) ;
251
+
220
252
return ;
221
253
} ;
254
+ console . log ( pick ) ;
222
255
223
256
let pick_data = ( pick as BoardItem ) ;
224
257
@@ -256,17 +289,20 @@ export async function pickBoard(setupState: SetupState, rootPath: string) {
256
289
activeItem : revisionQPItems [ revisionIndex ]
257
290
} ) . catch ( ( error ) => {
258
291
console . error ( error ) ;
292
+
293
+ console . log ( "pick rev error" ) ;
259
294
return undefined ;
260
295
} ) ;
261
296
let pick = ( await pickPromise as QuickPickItem ) ;
262
297
if ( ! pick ) {
298
+
299
+ console . log ( "pick error" ) ;
263
300
return ;
264
301
} ;
265
302
revision = pick . label ;
266
303
}
267
304
268
-
269
-
305
+ console . log ( "returning board config" ) ;
270
306
let boardConfig = {
271
307
board : board ,
272
308
relBoardDir : relBoardDir ,
@@ -280,6 +316,7 @@ export async function buildSelector(context: ExtensionContext, setupState: Setup
280
316
const title = 'Add Build Configuration' ;
281
317
282
318
async function pickBoardStep ( input : MultiStepInput , state : Partial < BuildConfig > ) {
319
+ console . log ( "picking board" ) ;
283
320
let boardData = await pickBoard ( setupState , rootPath ) ;
284
321
if ( boardData ) {
285
322
state . relBoardDir = boardData . relBoardDir ;
0 commit comments