@@ -427,14 +427,24 @@ async function pickAdditions(
427427 return new Promise < string [ ] > ( ( resolve ) => {
428428 let result : string [ ] = [ ] ;
429429 const quickPick = vscode . window . createQuickPick < PickAdditionsItem > ( ) ;
430- quickPick . title = `Select items in namespace '${ api . ns . toUpperCase ( ) } ' to add to project '${ project } '.` ;
430+ quickPick . title = `Select items in namespace '${ api . ns } ' to add to project '${ project } '.` ;
431431 quickPick . ignoreFocusOut = true ;
432432 quickPick . canSelectMany = true ;
433433 quickPick . keepScrollPosition = true ;
434434 quickPick . matchOnDescription = true ;
435435 quickPick . buttons = [
436- { iconPath : new vscode . ThemeIcon ( "library" ) , tooltip : "Show system items" } ,
437- { iconPath : new vscode . ThemeIcon ( "server-process" ) , tooltip : "Show generated items" } ,
436+ {
437+ iconPath : new vscode . ThemeIcon ( "library" ) ,
438+ tooltip : "System" ,
439+ location : vscode . QuickInputButtonLocation . Input ,
440+ toggle : { checked : false } ,
441+ } ,
442+ {
443+ iconPath : new vscode . ThemeIcon ( "server-process" ) ,
444+ tooltip : "Generated" ,
445+ location : vscode . QuickInputButtonLocation . Input ,
446+ toggle : { checked : false } ,
447+ } ,
438448 ] ;
439449
440450 const getCSPRootItems = ( ) : Promise < PickAdditionsItem [ ] > => {
@@ -548,67 +558,26 @@ async function pickAdditions(
548558 } ) ;
549559 quickPick . onDidTriggerButton ( ( button ) => {
550560 quickPick . busy = true ;
551- if ( button . tooltip . charAt ( 0 ) == "S" ) {
552- if ( button . tooltip . includes ( "system" ) ) {
553- // Update the button
554- quickPick . buttons = [
555- { iconPath : new vscode . ThemeIcon ( "library" ) , tooltip : "Hide system items" } ,
556- quickPick . buttons [ 1 ] ,
557- ] ;
558- // Change value of correct parameter in array
559- sys = "1" ;
560- if ( [ "RTN" , "INC" , "OTH" ] . includes ( category ) ) {
561- parameters [ 0 ] = sys ;
562- } else if ( category != undefined ) {
563- parameters [ 1 ] = sys ;
564- } else {
565- parameters [ 0 ] = sys ;
566- parameters [ 4 ] = sys ;
567- }
561+ // Change value of correct parameter in array
562+ if ( button . tooltip == "System" ) {
563+ sys = button . toggle . checked ? "1" : "0" ;
564+ if ( [ "RTN" , "INC" , "OTH" ] . includes ( category ) ) {
565+ parameters [ 0 ] = sys ;
566+ } else if ( category != undefined ) {
567+ parameters [ 1 ] = sys ;
568568 } else {
569- quickPick . buttons = [
570- quickPick . buttons [ 0 ] ,
571- { iconPath : new vscode . ThemeIcon ( "server-process" ) , tooltip : "Hide generated items" } ,
572- ] ;
573- gen = "1" ;
574- if ( [ "RTN" , "INC" , "OTH" ] . includes ( category ) ) {
575- parameters [ 1 ] = gen ;
576- } else if ( category != undefined ) {
577- parameters [ 2 ] = gen ;
578- } else {
579- parameters [ 1 ] = gen ;
580- parameters [ 5 ] = gen ;
581- }
569+ parameters [ 0 ] = sys ;
570+ parameters [ 4 ] = sys ;
582571 }
583572 } else {
584- if ( button . tooltip . includes ( "system" ) ) {
585- quickPick . buttons = [
586- { iconPath : new vscode . ThemeIcon ( "library" ) , tooltip : "Show system items" } ,
587- quickPick . buttons [ 1 ] ,
588- ] ;
589- sys = "0" ;
590- if ( [ "RTN" , "INC" , "OTH" ] . includes ( category ) ) {
591- parameters [ 0 ] = sys ;
592- } else if ( category != undefined ) {
593- parameters [ 1 ] = sys ;
594- } else {
595- parameters [ 0 ] = sys ;
596- parameters [ 4 ] = sys ;
597- }
573+ gen = button . toggle . checked ? "1" : "0" ;
574+ if ( [ "RTN" , "INC" , "OTH" ] . includes ( category ) ) {
575+ parameters [ 1 ] = gen ;
576+ } else if ( category != undefined ) {
577+ parameters [ 2 ] = gen ;
598578 } else {
599- quickPick . buttons = [
600- quickPick . buttons [ 0 ] ,
601- { iconPath : new vscode . ThemeIcon ( "server-process" ) , tooltip : "Show generated items" } ,
602- ] ;
603- gen = "0" ;
604- if ( [ "RTN" , "INC" , "OTH" ] . includes ( category ) ) {
605- parameters [ 1 ] = gen ;
606- } else if ( category != undefined ) {
607- parameters [ 2 ] = gen ;
608- } else {
609- parameters [ 1 ] = gen ;
610- parameters [ 5 ] = gen ;
611- }
579+ parameters [ 1 ] = gen ;
580+ parameters [ 5 ] = gen ;
612581 }
613582 }
614583 // Refresh the items list
0 commit comments