@@ -75,24 +75,43 @@ 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 ) ;
92
109
93
110
if ( ! res . stdout ) {
94
- output . append ( prevError ) ;
95
- output . append ( res . stderr ) ;
111
+ console . log ( "error" ) ;
112
+
113
+ console . log ( prevError ) ;
114
+ console . log ( res . stderr ) ;
96
115
vscode . window . showErrorMessage ( "Failed to run west boards command. See Zephyr IDE Output for error message" ) ;
97
116
return ;
98
117
}
@@ -154,8 +173,8 @@ export async function pickBoard(setupState: SetupState, rootPath: string) {
154
173
boardDirectories . push ( "Select Other Folder" ) ;
155
174
const boardDirectoriesQpItems : QuickPickItem [ ] = boardDirectories . map ( label => ( { label } ) ) ;
156
175
157
- const title = "Board Picker" ;
158
-
176
+ const title = "Board Dir Picker" ;
177
+ console . log ( "picking directories" ) ;
159
178
let pickPromise = showQuickPick ( {
160
179
title,
161
180
step : 1 ,
@@ -173,9 +192,11 @@ export async function pickBoard(setupState: SetupState, rootPath: string) {
173
192
if ( ! pick ) {
174
193
return ;
175
194
} ;
195
+ console . log ( "Did not" ) ;
176
196
177
197
let relBoardDir : string | undefined = path . relative ( rootPath , ( pick . label ) ) ;
178
198
if ( pick . label === "Select Other Folder" ) {
199
+ console . log ( "selecting other folder" ) ;
179
200
const boarddir = await vscode . window . showOpenDialog ( {
180
201
canSelectFiles : false ,
181
202
canSelectFolders : true ,
@@ -192,13 +213,19 @@ export async function pickBoard(setupState: SetupState, rootPath: string) {
192
213
}
193
214
194
215
let boardList ;
216
+ console . log ( "getting board list" ) ;
217
+ console . log ( relBoardDir ) ;
218
+
195
219
if ( relBoardDir ) {
196
220
boardList = await getBoardlistWest ( setupState , vscode . Uri . file ( path . join ( rootPath , relBoardDir ) ) ) ;
197
221
} else {
198
222
boardList = await getBoardlistWest ( setupState , undefined ) ;
199
223
}
224
+ console . log ( "finished getting boar lsit" ) ;
200
225
201
226
if ( ! boardList ) {
227
+ console . log ( "empty board list" ) ;
228
+
202
229
return ;
203
230
}
204
231
@@ -213,12 +240,17 @@ export async function pickBoard(setupState: SetupState, rootPath: string) {
213
240
activeItem : undefined
214
241
} ) . catch ( ( error ) => {
215
242
console . error ( error ) ;
243
+
244
+ console . log ( "Pick Board error" ) ;
216
245
return undefined ;
217
246
} ) ;
218
247
pick = ( await pickPromise as QuickPickItem ) ;
219
248
if ( ! pick ) {
249
+ console . log ( "Pick error" ) ;
250
+
220
251
return ;
221
252
} ;
253
+ console . log ( pick ) ;
222
254
223
255
let pick_data = ( pick as BoardItem ) ;
224
256
@@ -256,17 +288,20 @@ export async function pickBoard(setupState: SetupState, rootPath: string) {
256
288
activeItem : revisionQPItems [ revisionIndex ]
257
289
} ) . catch ( ( error ) => {
258
290
console . error ( error ) ;
291
+
292
+ console . log ( "pick rev error" ) ;
259
293
return undefined ;
260
294
} ) ;
261
295
let pick = ( await pickPromise as QuickPickItem ) ;
262
296
if ( ! pick ) {
297
+
298
+ console . log ( "pick error" ) ;
263
299
return ;
264
300
} ;
265
301
revision = pick . label ;
266
302
}
267
303
268
-
269
-
304
+ console . log ( "returning board config" ) ;
270
305
let boardConfig = {
271
306
board : board ,
272
307
relBoardDir : relBoardDir ,
@@ -280,6 +315,7 @@ export async function buildSelector(context: ExtensionContext, setupState: Setup
280
315
const title = 'Add Build Configuration' ;
281
316
282
317
async function pickBoardStep ( input : MultiStepInput , state : Partial < BuildConfig > ) {
318
+ console . log ( "picking board" ) ;
283
319
let boardData = await pickBoard ( setupState , rootPath ) ;
284
320
if ( boardData ) {
285
321
state . relBoardDir = boardData . relBoardDir ;
0 commit comments