diff --git a/assets/readmeFiles/clue/clue.png b/assets/readmeFiles/clue/clue.png index 11f3e276d..d0906e6b9 100644 Binary files a/assets/readmeFiles/clue/clue.png and b/assets/readmeFiles/clue/clue.png differ diff --git a/locales/en/package.i18n.json b/locales/en/package.i18n.json index 4f34f2536..86e67f9b4 100644 --- a/locales/en/package.i18n.json +++ b/locales/en/package.i18n.json @@ -13,5 +13,6 @@ "deviceSimulatorExpressExtension.configuration.title": "Device Simulator Express configuration", "deviceSimulatorExpressExtension.configuration.properties.configEnvOnChange": "When you change the Python interpreter, the Device Simulator Express will automatically configure itself for the required dependencies.", "deviceSimulatorExpressExtension.configuration.properties.debuggerPort": "The port the Server will listen on for communication with the debugger.", - "deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask if we can download dependencies. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files." + "deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask if we can download dependencies. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files.", + "deviceSimulatorExpressExtension.configuration.properties.previewMode": "Enable this to test out and play with the new Adafruit CLUE simulator!" } \ No newline at end of file diff --git a/package.json b/package.json index 324f681dd..cc1b237bd 100644 --- a/package.json +++ b/package.json @@ -144,6 +144,12 @@ "default": 5577, "description": "%deviceSimulatorExpressExtension.configuration.properties.debuggerPort%", "scope": "resource" + }, + "deviceSimulatorExpress.previewMode": { + "type": "boolean", + "default": false, + "description": "%deviceSimulatorExpressExtension.configuration.properties.previewMode%", + "scope": "resource" } } }, diff --git a/package.nls.json b/package.nls.json index e662c005a..ea3ad1667 100644 --- a/package.nls.json +++ b/package.nls.json @@ -13,5 +13,6 @@ "deviceSimulatorExpressExtension.configuration.title": "Device Simulator Express configuration", "deviceSimulatorExpressExtension.configuration.properties.configEnvOnChange": "When you change the Python interpreter, the Device Simulator Express will automatically configure itself for the required dependencies.", "deviceSimulatorExpressExtension.configuration.properties.debuggerPort": "The port the Server will listen on for communication with the debugger.", - "deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask for dependency downloads. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files." + "deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask for dependency downloads. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files.", + "deviceSimulatorExpressExtension.configuration.properties.previewMode": "Enable this to test out and play with the new Adafruit CLUE simulator!" } \ No newline at end of file diff --git a/src/constants.ts b/src/constants.ts index 488a23b5c..fb77451e7 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -22,6 +22,7 @@ export const CONFIG = { PYTHON_PATH: "python.pythonPath", SHOW_DEPENDENCY_INSTALL: "deviceSimulatorExpress.showDependencyInstall", SHOW_NEW_FILE_POPUP: "deviceSimulatorExpress.showNewFilePopup", + ENABLE_PREVIEW_MODE: "deviceSimulatorExpress.previewMode", }; export const CONSTANTS = { diff --git a/src/extension.ts b/src/extension.ts index efb2d16e2..cae41100f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -307,8 +307,14 @@ export async function activate(context: vscode.ExtensionContext) { const openSimulator: vscode.Disposable = vscode.commands.registerCommand( "deviceSimulatorExpress.common.openSimulator", async () => { + const isPreviewMode = getIsPreviewMode(); + const chosen_device = await vscode.window.showQuickPick( - Object.values(CONSTANTS.DEVICE_NAME_FORMAL) + Object.values(CONSTANTS.DEVICE_NAME_FORMAL).filter( + device => + isPreviewMode || + device !== CONSTANTS.DEVICE_NAME_FORMAL.CLUE + ) ); if (!chosen_device) { @@ -411,8 +417,14 @@ export async function activate(context: vscode.ExtensionContext) { const newFile: vscode.Disposable = vscode.commands.registerCommand( "deviceSimulatorExpress.common.newFile", async () => { + const isPreviewMode = getIsPreviewMode(); + const chosen_device = await vscode.window.showQuickPick( - Object.values(CONSTANTS.DEVICE_NAME_FORMAL) + Object.values(CONSTANTS.DEVICE_NAME_FORMAL).filter( + device => + isPreviewMode || + device !== CONSTANTS.DEVICE_NAME_FORMAL.CLUE + ) ); if (!chosen_device) { @@ -782,8 +794,14 @@ export async function activate(context: vscode.ExtensionContext) { const deployToDevice: vscode.Disposable = vscode.commands.registerCommand( "deviceSimulatorExpress.common.deployToDevice", async () => { + const isPreviewMode = getIsPreviewMode(); + const chosen_device = await vscode.window.showQuickPick( - Object.values(CONSTANTS.DEVICE_NAME_FORMAL) + Object.values(CONSTANTS.DEVICE_NAME_FORMAL).filter( + device => + isPreviewMode || + device !== CONSTANTS.DEVICE_NAME_FORMAL.CLUE + ) ); if (!chosen_device) { @@ -1003,6 +1021,13 @@ export async function activate(context: vscode.ExtensionContext) { } ); + const getIsPreviewMode = (): boolean => { + const isPreviewMode: boolean = vscode.workspace + .getConfiguration() + .get(CONFIG.ENABLE_PREVIEW_MODE); + return isPreviewMode; + }; + context.subscriptions.push( installDependencies, runSimulator, diff --git a/src/view/pages/__snapshots__/gettingStarted.spec.tsx.snap b/src/view/pages/__snapshots__/gettingStarted.spec.tsx.snap index b1021ea93..ce37a115b 100644 --- a/src/view/pages/__snapshots__/gettingStarted.spec.tsx.snap +++ b/src/view/pages/__snapshots__/gettingStarted.spec.tsx.snap @@ -213,6 +213,58 @@ exports[`GettingStartedPage component should render correctly 1`] = `

Tutorial for CLUE

+

+ 0. Enable Preview Mode to use the CLUE (This is required) +

+

+ a. Access your settings: +

+ Open settings + +

+ b. Check the + + "Device Simulator Express: Preview Mode" + + setting. +

+ Enable preview mode

1. Import the the main CLUE library (This is required)

diff --git a/src/view/pages/gettingStarted.tsx b/src/view/pages/gettingStarted.tsx index 358f9a6a6..0065da1f9 100644 --- a/src/view/pages/gettingStarted.tsx +++ b/src/view/pages/gettingStarted.tsx @@ -136,6 +136,15 @@ export class GettingStartedPage extends React.Component { {/* prettier-ignore */}

Tutorial for CLUE

+

0. Enable Preview Mode to use the CLUE (This is required)

+

a. Access your settings:

+ Open settings + +

b. Check the "Device Simulator Express: Preview Mode" setting.

+ Enable preview mode

1. Import the the main CLUE library (This is required)