Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow multiple runtime preview for same document #5

Merged
merged 2 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ Open _Command Palette_, choose `Live Code: Open Preview to the Side`, or simply

```json
{
"liveCode.defaultPlatform": {
"type": "string",
"default": "browser",
"description": "Set the execution environment of the preview",
"enum": ["browser", "node"]
},
"liveCode.renderJSX": {
"type": "boolean",
"default": true,
Expand Down
1 change: 1 addition & 0 deletions images/browser-plain.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/browser.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion images/electron.svg

This file was deleted.

4 changes: 4 additions & 0 deletions images/logo-plain.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/node-plain.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 54 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,63 +27,92 @@
"contributes": {
"commands": [
{
"command": "liveCode.openPreviewToSide",
"title": "Open Preview to the Side",
"command": "liveCode.choosePreviewToTheSide",
"title": "Choose Preview to the Side",
"category": "Live Code",
"icon": "images/logo.svg"
"icon": "images/logo-plain.svg"
},
{
"command": "liveCode.changePlatform",
"title": "Change Platform",
"command": "liveCode.openBrowserPreviewToSide",
"title": "Open Browser Preview to the Side",
"category": "Live Code",
"icon": "$(notebook-kernel-select)"
"icon": "images/browser-plain.svg"
},
{
"command": "liveCode.openNodePreviewToSide",
"title": "Open Node.js Preview to the Side",
"category": "Live Code",
"icon": "images/node-plain.svg"
},
{
"command": "liveCode.changeCurrentRuntimeOfPreview",
"title": "Change Current Runtime of Preview",
"category": "Live Code",
"icon": "images/logo-plain.svg"
}
],
"menus": {
"editor/context": [
{
"command": "liveCode.openPreviewToSide",
"command": "liveCode.openBrowserPreviewToSide",
"when": "editorLangId in liveCode.supportedLanguageIds",
"group": "liveCode"
},
{
"command": "liveCode.openNodePreviewToSide",
"when": "editorLangId in liveCode.supportedLanguageIds",
"group": "liveCode"
}
],
"editor/title": [
{
"command": "liveCode.openPreviewToSide",
"when": "editorLangId in liveCode.supportedLanguageIds",
"command": "liveCode.openBrowserPreviewToSide",
"when": "editorLangId in liveCode.supportedLanguageIds && config.liveCode.showBrowserPreviewInTitle",
"group": "navigation"
},
{
"command": "liveCode.openNodePreviewToSide",
"when": "editorLangId in liveCode.supportedLanguageIds && config.liveCode.showNodePreviewInTitle",
"group": "navigation"
},
{
"command": "liveCode.choosePreviewToTheSide",
"when": "editorLangId in liveCode.supportedLanguageIds && config.liveCode.showChoosePreviewInTitle",
"group": "navigation"
},
{
"command": "liveCode.changePlatform",
"when": "liveCode.isPreviewFocus",
"command": "liveCode.changeCurrentRuntimeOfPreview",
"when": "activeWebviewPanelId == 'liveCode.preview'",
"group": "navigation"
}
]
},
"keybindings": [
{
"command": "liveCode.openPreviewToSide",
"command": "liveCode.choosePreviewToTheSide",
"key": "ctrl+k l",
"mac": "cmd+k l",
"when": "editorLangId in liveCode.supportedLanguageIds && !liveCode.isPreviewFocus"
"when": "editorLangId in liveCode.supportedLanguageIds"
}
],
"configuration": {
"type": "object",
"title": "Live Code",
"properties": {
"liveCode.defaultPlatform": {
"type": "string",
"default": "browser",
"description": "Set the execution environment for the preview",
"enum": [
"browser",
"node"
],
"enumDescriptions": [
"Execute code in web browser",
"Execute code in Node.js"
]
"liveCode.showChoosePreviewInTitle": {
"type": "boolean",
"default": false,
"description": "Wether to show the 'Choose Preview to the Side' button in the editor title"
},
"liveCode.showBrowserPreviewInTitle": {
"type": "boolean",
"default": true,
"description": "Wether to show the 'Open Browser Preview to the Side' button in the editor title"
},
"liveCode.showNodePreviewInTitle": {
"type": "boolean",
"default": true,
"description": "Wether to show the 'Open Node.js Preview to the Side' button in the editor title"
},
"liveCode.renderJSX": {
"type": "boolean",
Expand Down
Loading
Loading