Home > other >  vscode - Is there a way to create an instance of `vscode.TextEditor`?
vscode - Is there a way to create an instance of `vscode.TextEditor`?

Time:06-15

vscode - Is there a way to create an instance of `vscode.TextDocument`?

The question above except instead of textdocument I want for texteditor given the filepath.

Thanks in advance

CodePudding user response:

No, there is not.

You can only show a TextDocument, using vscode.window.showTextDocument(someTextDocument, ...), where someTextDocument refers to some TextDocument instance, previously opened.

Hope this helps

  • Related