Skip to content

Commit

Permalink
Working prototype.
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-bloomerang committed Dec 17, 2020
1 parent 8e39015 commit 3f675d1
Show file tree
Hide file tree
Showing 2 changed files with 146 additions and 23 deletions.
115 changes: 111 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,123 @@
"Other"
],
"activationEvents": [
"onCommand:debug-in-titlebar.helloWorld"
"onCommand:debug-in-titlebar.debug-restart",
"onCommand:debug-in-titlebar.debug-pause",
"onCommand:debug-in-titlebar.debug-start",
"onCommand:debug-in-titlebar.debug-stop",
"onCommand:debug-in-titlebar.debug-continue",
"onCommand:debug-in-titlebar.debug-stepInto",
"onCommand:debug-in-titlebar.debug-stepOut",
"onCommand:debug-in-titlebar.debug-stepOver",
"onCommand:debug-in-titlebar.debug-toggleBreakpoints"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "debug-in-titlebar.helloWorld",
"title": "Hello World"
"command": "debug-in-titlebar.debug-restart",
"title": "Debug In Titlebar: Restart Debug",
"icon": "$(debug-restart)",
"enablement": "inDebugMode"
},
{
"command": "debug-in-titlebar.debug-pause",
"title": "Debug In Titlebar: Pause Debug",
"icon": "$(debug-pause)"
},
{
"command": "debug-in-titlebar.debug-start",
"title": "Debug In Titlebar: Start Debug",
"icon": "$(debug-start~spin)",
"enablement": "debugState != 'initializing'"
},
{
"command": "debug-in-titlebar.debug-stop",
"title": "Debug In Titlebar: Stop Debug",
"icon": "$(debug-stop)",
"enablement": "inDebugMode"
},
{
"command": "debug-in-titlebar.debug-continue",
"title": "Debug In Titlebar: Continue Debug",
"icon": "$(debug-continue)"
},
{
"command": "debug-in-titlebar.debug-stepInto",
"title": "Debug In Titlebar: Step Into",
"icon": "$(debug-step-into)",
"enablement": "inDebugMode && debugState == 'stopped'"
},
{
"command": "debug-in-titlebar.debug-stepOut",
"title": "Debug In Titlebar: Step Out",
"icon": "$(debug-step-out)",
"enablement": "inDebugMode && debugState == 'stopped'"
},
{
"command": "debug-in-titlebar.debug-stepOver",
"title": "Debug In Titlebar: Step Over",
"icon": "$(debug-step-over)",
"enablement": "inDebugMode && debugState == 'stopped'"
},
{
"command": "debug-in-titlebar.debug-toggleBreakpoints",
"title": "Debug In Titlebar: Toggle Breakpoints",
"icon": "$(activate-breakpoints)",
"enablement": "inDebugMode"
}
]
],
"menus": {
"editor/title": [
{
"command": "debug-in-titlebar.debug-start",
"group": "navigation@1999901",
"when": "debuggersAvailable && !inDebugMode || debugState == 'initializing'"

},
{
"command": "debug-in-titlebar.debug-pause",
"group": "navigation@1999901",
"when": "debuggersAvailable && inDebugMode && debugState == 'running'"
},
{
"command": "debug-in-titlebar.debug-continue",
"group": "navigation@1999901",
"when": "debuggersAvailable &&inDebugMode && debugState == 'stopped'"
},
{
"command": "debug-in-titlebar.debug-stepOver",
"group": "navigation@1999903",
"when": "debuggersAvailable"

},
{
"command": "debug-in-titlebar.debug-stepInto",
"group": "navigation@1999904",
"when": "debuggersAvailable"
},
{
"command": "debug-in-titlebar.debug-stepOut",
"group": "navigation@1999905",
"when": "debuggersAvailable"
},
{
"command": "debug-in-titlebar.debug-restart",
"group": "navigation@1999907",
"when": "debuggersAvailable"
},
{
"command": "debug-in-titlebar.debug-stop",
"group": "navigation@1999908",
"when": "debuggersAvailable"
},
{
"command": "debug-in-titlebar.debug-toggleBreakpoints",
"group": "navigation@1999908",
"when": "debuggersAvailable"
}
]
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
Expand Down
54 changes: 35 additions & 19 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,43 @@
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
var breakpointtoggle = true;
export function activate(context: vscode.ExtensionContext) {
// idea: hide the debug/toolbar ?

// Use the console to output diagnostic information (console.log) and errors (console.error)
// This line of code will only be executed once when your extension is activated
console.log('Congratulations, your extension "debug-in-titlebar" is now active!');

// The command has been defined in the package.json file
// Now provide the implementation of the command with registerCommand
// The commandId parameter must match the command field in package.json
let disposable = vscode.commands.registerCommand('debug-in-titlebar.helloWorld', () => {
// The code you place here will be executed every time your command is executed

// Display a message box to the user
vscode.window.showInformationMessage('Hello World from Debug In Titlebar!');
let debugRestart = vscode.commands.registerCommand(`debug-in-titlebar.debug-restart`, () => {
vscode.commands.executeCommand('workbench.action.debug.restart');
});
let debugPause = vscode.commands.registerCommand(`debug-in-titlebar.debug-pause`, () => {
vscode.commands.executeCommand('workbench.action.debug.pause');
});
let debugStart = vscode.commands.registerCommand(`debug-in-titlebar.debug-start`, () => {
vscode.commands.executeCommand('workbench.action.debug.start');
});
let debugStop = vscode.commands.registerCommand(`debug-in-titlebar.debug-stop`, () => {
vscode.commands.executeCommand('workbench.action.debug.stop');
});
let debugContinue = vscode.commands.registerCommand(`debug-in-titlebar.debug-continue`, () => {
vscode.commands.executeCommand('workbench.action.debug.continue');
});
let debugStepInto = vscode.commands.registerCommand(`debug-in-titlebar.debug-stepInto`, () => {
vscode.commands.executeCommand('workbench.action.debug.stepInto');
});
let debugStepOut = vscode.commands.registerCommand(`debug-in-titlebar.debug-stepOut`, () => {
vscode.commands.executeCommand('workbench.action.debug.stepOut');
});
let debugStepOver = vscode.commands.registerCommand(`debug-in-titlebar.debug-stepOver`, () => {
vscode.commands.executeCommand('workbench.action.debug.stepOver');
});
let debugToggleBreakPoints = vscode.commands.registerCommand(`debug-in-titlebar.debug-toggleBreakpoints`, () => {
if (!breakpointtoggle) {
vscode.commands.executeCommand('workbench.debug.viewlet.action.enableAllBreakpoints');
}
else {
vscode.commands.executeCommand('workbench.debug.viewlet.action.disableAllBreakpoints');
}
breakpointtoggle = !breakpointtoggle;
});

context.subscriptions.push(disposable);
context.subscriptions.push(debugRestart,debugStart,debugStop,debugContinue,debugStepInto,debugStepOut,debugStepOver,debugPause,debugToggleBreakPoints);
}

// this method is called when your extension is deactivated
export function deactivate() {}

0 comments on commit 3f675d1

Please sign in to comment.