@@ -62,69 +62,72 @@ async function validateCanContinue(): Promise<boolean> {
62
62
}
63
63
64
64
export default async function tutorialLoad ( context : vscode . ExtensionContext ) : Promise < void > {
65
+ console . log ( `tutorialLoad ${ JSON . stringify ( context ) } ` )
66
+
65
67
// setup connection to workspace
66
68
await rootSetup ( context )
67
-
68
- const modes = [ 'New' ]
69
-
70
- const canContinue = await validateCanContinue ( )
71
- if ( canContinue ) {
72
- modes . push ( 'Continue' )
73
- }
74
-
75
- const selectedMode : string | undefined = await vscode . window . showQuickPick ( modes )
76
-
77
- if ( ! selectedMode ) {
78
- throw new Error ( 'No mode selected' )
79
- return
80
- }
81
-
82
- interface TutorialQuickPickItem extends vscode . QuickPickItem {
83
- id : string
84
- }
85
-
86
- // load tutorial summaries
87
- const tutorialsData : { [ id : string ] : CR . TutorialSummary } = await fetch ( {
88
- resource : 'getTutorialsSummary' ,
89
- } )
90
- const selectableTutorials : TutorialQuickPickItem [ ] = Object . keys ( tutorialsData ) . map ( id => {
91
- const tutorial = tutorialsData [ id ]
92
- return {
93
- label : tutorial . title ,
94
- description : tutorial . description ,
95
- // detail: '', // optional additional info
96
- id,
97
- }
98
- } )
99
- const selectedTutorial : TutorialQuickPickItem | undefined = await vscode . window . showQuickPick ( selectableTutorials )
100
-
101
- if ( ! selectedTutorial ) {
102
- throw new Error ( 'No tutorial selected' )
103
- }
104
-
105
- // load specific tutorial
106
- const tutorial : CR . Tutorial | undefined = await fetch ( {
107
- resource : 'getTutorial' ,
108
- params : { id : selectedTutorial . id } ,
109
- } )
110
-
111
- if ( ! tutorial ) {
112
- throw new Error ( 'No tutorial found' )
113
- }
114
-
115
- switch ( selectedMode ) {
116
- // new tutorial
117
- case modes [ 0 ] :
118
- await newTutorial ( tutorial )
119
- break
120
- // continue
121
- case modes [ 1 ] :
122
- await continueTutorial ( )
123
- break
124
- }
125
-
126
- // setup hook to run tests on save
127
- onSaveHook ( tutorial . meta . languages )
69
+ return ;
70
+
71
+ // const modes = ['New']
72
+
73
+ // const canContinue = await validateCanContinue()
74
+ // if (canContinue) {
75
+ // modes.push('Continue')
76
+ // }
77
+
78
+ // const selectedMode: string | undefined = await vscode.window.showQuickPick(modes)
79
+
80
+ // if (!selectedMode) {
81
+ // throw new Error('No mode selected')
82
+ // return
83
+ // }
84
+
85
+ // interface TutorialQuickPickItem extends vscode.QuickPickItem {
86
+ // id: string
87
+ // }
88
+
89
+ // // load tutorial summaries
90
+ // const tutorialsData: { [id: string]: CR.TutorialSummary } = await fetch({
91
+ // resource: 'getTutorialsSummary',
92
+ // })
93
+ // const selectableTutorials: TutorialQuickPickItem[] = Object.keys(tutorialsData).map(id => {
94
+ // const tutorial = tutorialsData[id]
95
+ // return {
96
+ // label: tutorial.title,
97
+ // description: tutorial.description,
98
+ // // detail: '', // optional additional info
99
+ // id,
100
+ // }
101
+ // })
102
+ // const selectedTutorial: TutorialQuickPickItem | undefined = await vscode.window.showQuickPick(selectableTutorials)
103
+
104
+ // if (!selectedTutorial) {
105
+ // throw new Error('No tutorial selected')
106
+ // }
107
+
108
+ // // load specific tutorial
109
+ // const tutorial: CR.Tutorial | undefined = await fetch({
110
+ // resource: 'getTutorial',
111
+ // params: { id: selectedTutorial.id },
112
+ // })
113
+
114
+ // if (!tutorial) {
115
+ // throw new Error('No tutorial found')
116
+ // }
117
+
118
+ // switch (selectedMode) {
119
+ // // new tutorial
120
+ // case modes[0]:
121
+ // await newTutorial(tutorial)
122
+ // break
123
+ // // continue
124
+ // case modes[1]:
125
+ // await continueTutorial()
126
+ // break
127
+ // }
128
+
129
+ // // setup hook to run tests on save
130
+ // onSaveHook(tutorial.meta.languages)
128
131
129
132
// TODO: start
130
133
}
0 commit comments