From 7506b2ba5ae3ee1052bff44d2f5129a61312b37b Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 24 Sep 2020 18:29:25 +0200 Subject: [PATCH] :lipstick: more use of Schemas.file for easier reference --- src/vs/editor/contrib/links/links.ts | 2 +- .../platform/webview/electron-main/webviewProtocolProvider.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/contrib/links/links.ts b/src/vs/editor/contrib/links/links.ts index ba54876ebce13..cbee654068fbf 100644 --- a/src/vs/editor/contrib/links/links.ts +++ b/src/vs/editor/contrib/links/links.ts @@ -298,7 +298,7 @@ export class LinkDetector implements IEditorContribution { // Support for relative file URIs of the shape file://./relativeFile.txt or file:///./relativeFile.txt if (typeof uri === 'string' && this.editor.hasModel()) { const modelUri = this.editor.getModel().uri; - if (modelUri.scheme === Schemas.file && uri.startsWith('file:')) { + if (modelUri.scheme === Schemas.file && uri.startsWith(`${Schemas.file}:`)) { const parsedUri = URI.parse(uri); if (parsedUri.scheme === Schemas.file) { const fsPath = resources.originalFSPath(parsedUri); diff --git a/src/vs/platform/webview/electron-main/webviewProtocolProvider.ts b/src/vs/platform/webview/electron-main/webviewProtocolProvider.ts index 32fdd04cd2830..77b451c90056e 100644 --- a/src/vs/platform/webview/electron-main/webviewProtocolProvider.ts +++ b/src/vs/platform/webview/electron-main/webviewProtocolProvider.ts @@ -136,7 +136,7 @@ export class WebviewProtocolProvider extends Disposable { } else { url = require.toUrl(`vs/workbench/contrib/webview/browser/pre/${entry}`); } - return callback(decodeURIComponent(url.replace('file://', ''))); + return callback(decodeURIComponent(url.replace(`${Schemas.file}://`, ''))); } } catch { // noop