File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,14 @@ async function getFileContent(
4949 return cycle ;
5050 } ) ( file ) ;
5151 if ( has_cycle ) {
52- vscode . window . showWarningMessage ( 'Cyclic dependency found from template' ) ;
52+ const choice = await vscode . window . showWarningMessage (
53+ 'Cyclic dependency found! Do you still want to insert the template?' ,
54+ 'Yes' ,
55+ 'No' ,
56+ ) ;
57+ if ( choice === 'No' ) {
58+ return undefined ;
59+ }
5360 }
5461
5562 const contents = await Promise . all (
@@ -225,6 +232,10 @@ function registerCommands(context: vscode.ExtensionContext): void {
225232 baseDirectory ,
226233 dependencies ?? { } ,
227234 ) ;
235+ if ( ! content ) {
236+ return ;
237+ }
238+
228239 const inserted = vscode . window . activeTextEditor ?. edit (
229240 ( edit : vscode . TextEditorEdit ) => {
230241 if ( vscode . window . activeTextEditor ) {
You can’t perform that action at this time.
0 commit comments