How to open file and insert text using the VSCode API
<p>How can I open a new read-only text file in tab and insert some formatted text in that file using the Visual Studio Code API?</p>

<p>I didnt find any example regarding this to add simple text</p>

<p>Following is my code that opens some untitled file.</p>

<pre><code>var setting: vscode.Uri = vscode.Uri.parse("untitled:" + "C:\summary.txt");
vscode.workspace.openTextDocument(setting).then((a: vscode.TextDocument) =&gt; {
    vscode.window.showTextDocument(a, 1, false);
}, (error: any) =&gt; {
    console.error(error);
    debugger;
});
</code></pre>

<p>Please give the simple example that can be added to these lines to add the text.
As the official examples are little complex.</p>