Skip to content

Commit

Permalink
Workaround for asExternalUri failing with websocket URIs
Browse files Browse the repository at this point in the history
Can hopefully be reverted if microsoft/vscode#84819 is addressed.
  • Loading branch information
DanTup committed Nov 14, 2019
1 parent 23e7c8b commit 10bb52a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/extension/utils/vscode/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ class EnvUtils {
}

public async asExternalUri(uri: vs.Uri): Promise<vs.Uri> {
return vs.env.asExternalUri(uri);
// TODO: Remove this scheme mapping when https://github.com/microsoft/vscode/issues/84819
// is resolved.
const scheme = uri.scheme;
const fakeScheme = scheme === "ws" ? "http" : "https";
const mappedUri = await vs.env.asExternalUri(uri.with({ scheme: fakeScheme }));
return mappedUri.with({ scheme });
}
}

Expand Down

0 comments on commit 10bb52a

Please sign in to comment.