diff --git a/extensions/typescript/src/typescriptMain.ts b/extensions/typescript/src/typescriptMain.ts index 197cff2b6ef..e217aa00400 100644 --- a/extensions/typescript/src/typescriptMain.ts +++ b/extensions/typescript/src/typescriptMain.ts @@ -593,7 +593,13 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { }, _ => { return workspace.openTextDocument(configFile.with({ scheme: 'untitled' })) .then(doc => window.showTextDocument(doc, col)) - .then(editor => editor.insertSnippet(new SnippetString('{\n\t$0\n}'))); + .then(editor => { + if (editor.document.getText().length === 0) { + return editor.insertSnippet(new SnippetString('{\n\t$0\n}')) + .then(_ => editor); + } + return editor; + }); }); case ProjectConfigAction.LearnMore: