From b7d400880ac08100bd168a22b70d217e6abfd6b9 Mon Sep 17 00:00:00 2001 From: Jackson Kearl Date: Mon, 23 Aug 2021 20:22:58 -0700 Subject: [PATCH] Add worksapce platform keys --- getting-started-sample/media/web.md | 9 ++++++ getting-started-sample/package.json | 34 ++++++++++++++++++++-- webview-sample/media/{main.js => ma in.js} | 0 webview-sample/src/extension.ts | 4 +-- 4 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 getting-started-sample/media/web.md rename webview-sample/media/{main.js => ma in.js} (100%) diff --git a/getting-started-sample/media/web.md b/getting-started-sample/media/web.md new file mode 100644 index 00000000..b2512bcd --- /dev/null +++ b/getting-started-sample/media/web.md @@ -0,0 +1,9 @@ +# Hello Web Users + +[Say hello](command:getting-started-sample.sayHello) + +![Small Image](./small-image.png) + +```ts +const a = 12; +``` \ No newline at end of file diff --git a/getting-started-sample/package.json b/getting-started-sample/package.json index 9c595637..f2a2aab4 100644 --- a/getting-started-sample/package.json +++ b/getting-started-sample/package.json @@ -69,24 +69,52 @@ }, { "id": "mac", - "title": "Platform: Mac", + "title": "UI Platform: Mac", "description": "This step will only show on a Mac.", "when": "isMac", "media": { "markdown": "media/mac.md"} }, { "id": "windows", - "title": "Platform: Windows", + "title": "UI Platform: Windows", "description": "This step will only show on Windows", "when": "isWindows", "media": { "markdown": "media/windows.md" } }, { "id": "linux", - "title": "Platform: Linux", + "title": "UI Platform: Linux", "description": "This step will only show on Linux", "when": "isLinux", "media": { "markdown": "media/linux.md" } + }, + { + "id": "macRemote", + "title": "Workspace Platform: Mac", + "description": "This step will only show on Mac remotes.", + "when": "workspacePlatform == 'mac'", + "media": { "markdown": "media/mac.md"} + }, + { + "id": "windowsRemote", + "title": "Workspace Platform: Windows", + "description": "This step will only show on Windows remotes", + "when": "workspacePlatform == 'windows'", + "media": { "markdown": "media/windows.md" } + }, + { + "id": "linuxRemote", + "title": "Workspace Platform: Linux", + "description": "This step will only show on Linux remotes", + "when": "workspacePlatform == 'linux'", + "media": { "markdown": "media/linux.md" } + }, + { + "id": "webRemote", + "title": "Workspace Platform: Web", + "description": "This step will only show on webworker remotes", + "when": "workspacePlatform == 'webworker'", + "media": { "markdown": "media/linux.md" } } ] } diff --git a/webview-sample/media/main.js b/webview-sample/media/ma in.js similarity index 100% rename from webview-sample/media/main.js rename to webview-sample/media/ma in.js diff --git a/webview-sample/src/extension.ts b/webview-sample/src/extension.ts index d2b6e26b..c7130fb2 100644 --- a/webview-sample/src/extension.ts +++ b/webview-sample/src/extension.ts @@ -168,10 +168,10 @@ class CatCodingPanel { private _getHtmlForWebview(webview: vscode.Webview, catGifPath: string) { // Local path to main script run in the webview - const scriptPathOnDisk = vscode.Uri.joinPath(this._extensionUri, 'media', 'main.js'); + const scriptPathOnDisk = vscode.Uri.joinPath(this._extensionUri, 'media', 'ma in.js'); // And the uri we use to load this script in the webview - const scriptUri = webview.asWebviewUri(scriptPathOnDisk); + const scriptUri = (scriptPathOnDisk).with({ 'scheme': 'vscode-resource' }); // Local path to css styles const styleResetPath = vscode.Uri.joinPath(this._extensionUri, 'media', 'reset.css');