mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
Follow up to PR #22021 to respond to feedback
This commit is contained in:
@@ -368,10 +368,10 @@ export function createApiFactory(initData: IInitData, threadService: IThreadServ
|
||||
set textDocuments(value) {
|
||||
throw errors.readonly();
|
||||
},
|
||||
openTextDocument(uriOrFileNameOrOptions?: vscode.Uri | string | { language?: string; contents?: string; }) {
|
||||
openTextDocument(uriOrFileNameOrOptions?: vscode.Uri | string | { language?: string; content?: string; }) {
|
||||
let uriPromise: TPromise<URI>;
|
||||
|
||||
let options = uriOrFileNameOrOptions as { language?: string; contents?: string; };
|
||||
let options = uriOrFileNameOrOptions as { language?: string; content?: string; };
|
||||
if (!options || typeof options.language === 'string') {
|
||||
uriPromise = extHostDocuments.createDocumentData(options);
|
||||
} else if (typeof uriOrFileNameOrOptions === 'string') {
|
||||
|
||||
@@ -120,7 +120,7 @@ export abstract class MainThreadDiagnosticsShape {
|
||||
}
|
||||
|
||||
export abstract class MainThreadDocumentsShape {
|
||||
$tryCreateDocument(options?: { language?: string; contents?: string; }): TPromise<any> { throw ni(); }
|
||||
$tryCreateDocument(options?: { language?: string; content?: string; }): TPromise<any> { throw ni(); }
|
||||
$tryOpenDocument(uri: URI): TPromise<any> { throw ni(); }
|
||||
$registerTextContentProvider(handle: number, scheme: string): void { throw ni(); }
|
||||
$onVirtualDocumentChange(uri: URI, value: ITextSource): void { throw ni(); }
|
||||
|
||||
@@ -101,7 +101,7 @@ export class ExtHostDocuments extends ExtHostDocumentsShape {
|
||||
return promise;
|
||||
}
|
||||
|
||||
public createDocumentData(options?: { language?: string; contents?: string }): TPromise<URI> {
|
||||
public createDocumentData(options?: { language?: string; content?: string }): TPromise<URI> {
|
||||
return this._proxy.$tryCreateDocument(options);
|
||||
}
|
||||
|
||||
|
||||
@@ -228,8 +228,8 @@ export class MainThreadDocuments extends MainThreadDocumentsShape {
|
||||
});
|
||||
}
|
||||
|
||||
$tryCreateDocument(options?: { language?: string, contents?: string }): TPromise<URI> {
|
||||
return this._doCreateUntitled(void 0, options ? options.language : void 0, options ? options.contents : void 0);
|
||||
$tryCreateDocument(options?: { language?: string, content?: string }): TPromise<URI> {
|
||||
return this._doCreateUntitled(void 0, options ? options.language : void 0, options ? options.content : void 0);
|
||||
}
|
||||
|
||||
private _handleAsResourceInput(uri: URI): TPromise<boolean> {
|
||||
|
||||
Reference in New Issue
Block a user