mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Add ability to open untitled document with initial content (#22021)
This commit is contained in:
committed by
Benjamin Pasero
parent
1dd884a88a
commit
503f8f516e
@@ -368,10 +368,10 @@ export function createApiFactory(initData: IInitData, threadService: IThreadServ
|
||||
set textDocuments(value) {
|
||||
throw errors.readonly();
|
||||
},
|
||||
openTextDocument(uriOrFileNameOrOptions?: vscode.Uri | string | { language: string; }) {
|
||||
openTextDocument(uriOrFileNameOrOptions?: vscode.Uri | string | { language?: string; contents?: string; }) {
|
||||
let uriPromise: TPromise<URI>;
|
||||
|
||||
let options = uriOrFileNameOrOptions as { language: string; };
|
||||
let options = uriOrFileNameOrOptions as { language?: string; contents?: string; };
|
||||
if (!options || typeof options.language === 'string') {
|
||||
uriPromise = extHostDocuments.createDocumentData(options);
|
||||
} else if (typeof uriOrFileNameOrOptions === 'string') {
|
||||
|
||||
Reference in New Issue
Block a user