Skip to content

Commit 88f74b7

Browse files
authored
ext host - log error when attempting to open/show a document of invalid remote URI (microsoft#199844) (microsoft#203594)
* ext host - log error when attempting to open/show a document of invalid remote URI (microsoft#199844) * use `extHostApiDeprecation`
1 parent c15e48b commit 88f74b7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
675675
return extHostTerminalService.terminals;
676676
},
677677
async showTextDocument(documentOrUri: vscode.TextDocument | vscode.Uri, columnOrOptions?: vscode.ViewColumn | vscode.TextDocumentShowOptions, preserveFocus?: boolean): Promise<vscode.TextEditor> {
678+
if (URI.isUri(documentOrUri) && documentOrUri.scheme === Schemas.vscodeRemote && !documentOrUri.authority) {
679+
extHostApiDeprecation.report('workspace.showTextDocument', extension, `A URI of 'vscode-remote' scheme requires an authority.`);
680+
}
678681
const document = await (URI.isUri(documentOrUri)
679682
? Promise.resolve(workspace.openTextDocument(documentOrUri))
680683
: Promise.resolve(<vscode.TextDocument>documentOrUri));
@@ -1004,6 +1007,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
10041007
}
10051008

10061009
return uriPromise.then(uri => {
1010+
if (uri.scheme === Schemas.vscodeRemote && !uri.authority) {
1011+
extHostApiDeprecation.report('workspace.openTextDocument', extension, `A URI of 'vscode-remote' scheme requires an authority.`);
1012+
}
10071013
return extHostDocuments.ensureDocumentData(uri).then(documentData => {
10081014
return documentData.document;
10091015
});

0 commit comments

Comments
 (0)