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

Enable remote control on launch #503

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,11 @@
"type": "boolean",
"default": false,
"description": "Delete any currently installed dev channel before starting the debug session"
},
"enableRemoteControl": {
iBicha marked this conversation as resolved.
Show resolved Hide resolved
"type": "boolean",
iBicha marked this conversation as resolved.
Show resolved Hide resolved
"default": true,
"description": "Enable remote control mode when starting the debug session"
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion src/DebugConfigurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export class BrightScriptDebugConfigurationProvider implements DebugConfiguratio
enableDebugProtocol: false,
remotePort: 8060,
rendezvousTracking: true,
deleteDevChannelBeforeInstall: false
deleteDevChannelBeforeInstall: false,
enableRemoteControl: false
};

let config: any = vscode.workspace.getConfiguration('brightscript') || {};
Expand Down Expand Up @@ -243,6 +244,7 @@ export class BrightScriptDebugConfigurationProvider implements DebugConfiguratio
config.cwd = folderUri.fsPath;
config.rendezvousTracking = config.rendezvousTracking === false ? false : true;
config.deleteDevChannelBeforeInstall = config.deleteDevChannelBeforeInstall === true;
config.enableRemoteControl = config.enableRemoteControl === true ? true : this.configDefaults.enableRemoteControl;

if (config.request !== 'launch') {
await vscode.window.showErrorMessage(`roku-debug only supports the 'launch' request type`);
Expand Down Expand Up @@ -561,4 +563,10 @@ export interface BrightScriptLaunchConfiguration extends LaunchConfiguration {
* If injectRdbOnDeviceComponent is true and this is true the screen saver will be be disabled while the deployed application is running.
*/
disableScreenSaver?: boolean;

/**
* If true, the remote control will be enabled at the start of the debug session
* @default false
*/
enableRemoteControl?: boolean;
iBicha marked this conversation as resolved.
Show resolved Hide resolved
}
7 changes: 7 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ export class Extension {
//if this is a brightscript debug session
if (e.type === 'brightscript') {
this.chanperfStatusBar.hide();
const config = e.configuration as BrightScriptLaunchConfiguration;
if (config.enableRemoteControl) {
void this.remoteControlManager.setRemoteControlMode(false, 'launch');
}
}
});

Expand Down Expand Up @@ -212,6 +216,9 @@ export class Extension {
const config = e.body as BrightScriptLaunchConfiguration;
await docLinkProvider.setLaunchConfig(config);
logOutputManager.setLaunchConfig(config);
if (config.enableRemoteControl) {
void this.remoteControlManager.setRemoteControlMode(true, 'launch');
}
} else if (isChannelPublishedEvent(e)) {
this.webviewViewProviderManager.onChannelPublishedEvent(e);
//write debug server log statements to the DebugServer output channel
Expand Down
2 changes: 1 addition & 1 deletion src/managers/RemoteControlManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ export class RemoteControlManager {
}
}

export type RemoteControlModeInitiator = 'statusbar' | 'command';
export type RemoteControlModeInitiator = 'statusbar' | 'command' | 'launch';