@@ -94,6 +94,7 @@ interface ConfigStateReceived {
94
94
95
95
let displayedSelectCompiler : boolean = false ;
96
96
let secondPromptCounter : number = 0 ;
97
+ let scanForCompilersDone : boolean = false ;
97
98
98
99
let workspaceDisposables : vscode . Disposable [ ] = [ ] ;
99
100
export let workspaceReferences : refs . ReferencesManager ;
@@ -942,7 +943,7 @@ export class DefaultClient implements Client {
942
943
localize ( "select.compiler" , "Select a compiler to configure for IntelliSense" ) :
943
944
( vscode . workspace . workspaceFolders . length > 1 ?
944
945
localize ( "configure.intelliSense.forFolder" , "How would you like to configure IntelliSense for the '{0}' folder?" , this . RootFolder . name ) :
945
- localize ( "configure.intelliSense.thisFolder" , "How would you like to configure IntelliSense this folder?" ) ) ;
946
+ localize ( "configure.intelliSense.thisFolder" , "How would you like to configure IntelliSense for this folder?" ) ) ;
946
947
947
948
const items : IndexableQuickPickItem [ ] = [ ] ;
948
949
let isCompilerSection : boolean = false ;
@@ -1048,17 +1049,39 @@ export class DefaultClient implements Client {
1048
1049
}
1049
1050
if ( index === paths . length - 2 ) {
1050
1051
action = "help" ;
1052
+ // Because we need to conditionally enable/disable steps to alter their contents,
1053
+ // we need to determine which step is actually visible. If the steps change, this
1054
+ // logic will need to change to reflect them.
1055
+ let step : string = "ms-vscode.cpptools#" ;
1056
+ if ( ! scanForCompilersDone ) {
1057
+ step = step + "awaiting.activation." ;
1058
+ } else if ( compilerDefaults ?. knownCompilers === undefined || ! compilerDefaults . knownCompilers . length ) {
1059
+ step = step + "no.compilers.found." ;
1060
+ } else {
1061
+ step = step + "verify.compiler." ;
1062
+ }
1051
1063
switch ( os . platform ( ) ) {
1052
1064
case 'win32' :
1053
- void vscode . commands . executeCommand ( 'vscode.open' , "https://go.microsoft.com/fwlink/?linkid=2217614" ) ;
1054
- return ;
1065
+ step = step + "windows" ;
1066
+ break ;
1055
1067
case 'darwin' :
1056
- void vscode . commands . executeCommand ( 'vscode.open' , "https://go.microsoft.com/fwlink/?linkid=2217706" ) ;
1057
- return ;
1068
+ step = step + "mac" ;
1069
+ break ;
1058
1070
default : // Linux
1059
- void vscode . commands . executeCommand ( 'vscode.open' , "https://go.microsoft.com/fwlink/?linkid=2217615" ) ;
1060
- return ;
1071
+ step = step + "linux" ;
1072
+ break ;
1061
1073
}
1074
+ void vscode . commands . executeCommand (
1075
+ "workbench.action.openWalkthrough" ,
1076
+ { category : 'ms-vscode.cpptools#cppWelcome' , step } ,
1077
+ false )
1078
+ // Run it twice for now because of VS Code bug #187958
1079
+ . then ( ( ) => vscode . commands . executeCommand (
1080
+ "workbench.action.openWalkthrough" ,
1081
+ { category : 'ms-vscode.cpptools#cppWelcome' , step } ,
1082
+ false )
1083
+ ) ;
1084
+ return ;
1062
1085
}
1063
1086
const showButtonSender : string = "quickPick" ;
1064
1087
if ( index === paths . length - 3 ) {
@@ -2717,6 +2740,7 @@ export class DefaultClient implements Client {
2717
2740
newTrustedCompilerPath : newCompilerPath ?? ""
2718
2741
} ;
2719
2742
const results : configs . CompilerDefaults = await this . languageClient . sendRequest ( QueryCompilerDefaultsRequest , params ) ;
2743
+ scanForCompilersDone = true ;
2720
2744
void vscode . commands . executeCommand ( 'setContext' , 'cpptools.scanForCompilersDone' , true ) ;
2721
2745
void vscode . commands . executeCommand ( 'setContext' , 'cpptools.scanForCompilersEmpty' , results . knownCompilers === undefined || ! results . knownCompilers . length ) ;
2722
2746
void vscode . commands . executeCommand ( 'setContext' , 'cpptools.trustedCompilerFound' , results . trustedCompilerFound ) ;
0 commit comments