mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
Fix configure ts/jsconfig.json inserting duplicate snippet for unsaved file. Fixes #27793
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user