SQL Operations Studio Public Preview 1 (0.23) release source code

This commit is contained in:
Karl Burtram
2017-11-09 14:30:27 -08:00
parent b88ecb8d93
commit 3cdac41339
8829 changed files with 759707 additions and 286 deletions

View File

@@ -0,0 +1,158 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!../browser/media/breakpointWidget';
import * as nls from 'vs/nls';
import * as errors from 'vs/base/common/errors';
import { KeyCode } from 'vs/base/common/keyCodes';
import { isWindows, isMacintosh } from 'vs/base/common/platform';
import { SelectBox } from 'vs/base/browser/ui/selectBox/selectBox';
import * as lifecycle from 'vs/base/common/lifecycle';
import * as dom from 'vs/base/browser/dom';
import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { ZoneWidget } from 'vs/editor/contrib/zoneWidget/browser/zoneWidget';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IDebugService, IBreakpoint, IRawBreakpoint } from 'vs/workbench/parts/debug/common/debug';
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { once } from 'vs/base/common/functional';
import { attachInputBoxStyler, attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
import { IThemeService } from 'vs/platform/theme/common/themeService';
const $ = dom.$;
const EXPRESSION_PLACEHOLDER = nls.localize('breakpointWidgetExpressionPlaceholder', "Break when expression evaluates to true. 'Enter' to accept, 'esc' to cancel.");
const EXPRESSION_ARIA_LABEL = nls.localize('breakpointWidgetAriaLabel', "The program will only stop here if this condition is true. Press Enter to accept or Escape to cancel.");
const HIT_COUNT_PLACEHOLDER = nls.localize('breakpointWidgetHitCountPlaceholder', "Break when hit count condition is met. 'Enter' to accept, 'esc' to cancel.");
const HIT_COUNT_ARIA_LABEL = nls.localize('breakpointWidgetHitCountAriaLabel', "The program will only stop here if the hit count is met. Press Enter to accept or Escape to cancel.");
export class BreakpointWidget extends ZoneWidget {
private inputBox: InputBox;
private toDispose: lifecycle.IDisposable[];
private hitCountContext: boolean;
private hitCountInput: string;
private conditionInput: string;
constructor(editor: ICodeEditor, private lineNumber: number, private column: number,
@IContextViewService private contextViewService: IContextViewService,
@IDebugService private debugService: IDebugService,
@IThemeService private themeService: IThemeService
) {
super(editor, { showFrame: true, showArrow: false, frameWidth: 1 });
this.toDispose = [];
this.hitCountInput = '';
this.conditionInput = '';
this.create();
}
private get placeholder(): string {
return this.hitCountContext ? HIT_COUNT_PLACEHOLDER : EXPRESSION_PLACEHOLDER;
}
private get ariaLabel(): string {
return this.hitCountContext ? HIT_COUNT_ARIA_LABEL : EXPRESSION_ARIA_LABEL;
}
private getInputBoxValue(breakpoint: IBreakpoint): string {
if (this.hitCountContext) {
return breakpoint && breakpoint.hitCondition ? breakpoint.hitCondition : this.hitCountInput;
}
return breakpoint && breakpoint.condition ? breakpoint.condition : this.conditionInput;
}
protected _fillContainer(container: HTMLElement): void {
this.setCssClass('breakpoint-widget');
const uri = this.editor.getModel().uri;
const breakpoint = this.debugService.getModel().getBreakpoints().filter(bp => bp.lineNumber === this.lineNumber && bp.column === this.column && bp.uri.toString() === uri.toString()).pop();
this.hitCountContext = breakpoint && breakpoint.hitCondition && !breakpoint.condition;
const selected = this.hitCountContext ? 1 : 0;
const selectBox = new SelectBox([nls.localize('expression', "Expression"), nls.localize('hitCount', "Hit Count")], selected);
this.toDispose.push(attachSelectBoxStyler(selectBox, this.themeService));
selectBox.render(dom.append(container, $('.breakpoint-select-container')));
selectBox.onDidSelect(e => {
this.hitCountContext = e.selected === 'Hit Count';
if (this.hitCountContext) {
this.conditionInput = this.inputBox.value;
} else {
this.hitCountInput = this.inputBox.value;
}
this.inputBox.setAriaLabel(this.ariaLabel);
this.inputBox.setPlaceHolder(this.placeholder);
this.inputBox.value = this.getInputBoxValue(breakpoint);
});
const inputBoxContainer = dom.append(container, $('.inputBoxContainer'));
this.inputBox = new InputBox(inputBoxContainer, this.contextViewService, {
placeholder: this.placeholder,
ariaLabel: this.ariaLabel
});
this.toDispose.push(attachInputBoxStyler(this.inputBox, this.themeService));
this.toDispose.push(this.inputBox);
dom.addClass(this.inputBox.inputElement, isWindows ? 'windows' : isMacintosh ? 'mac' : 'linux');
this.inputBox.value = this.getInputBoxValue(breakpoint);
// Due to an electron bug we have to do the timeout, otherwise we do not get focus
setTimeout(() => this.inputBox.focus(), 0);
let disposed = false;
const wrapUp = once((success: boolean) => {
if (!disposed) {
disposed = true;
if (success) {
// if there is already a breakpoint on this location - remove it.
const oldBreakpoint = this.debugService.getModel().getBreakpoints()
.filter(bp => bp.lineNumber === this.lineNumber && bp.column === this.column && bp.uri.toString() === uri.toString()).pop();
const raw: IRawBreakpoint = {
lineNumber: this.lineNumber,
column: oldBreakpoint ? oldBreakpoint.column : undefined,
enabled: true,
condition: oldBreakpoint && oldBreakpoint.condition,
hitCondition: oldBreakpoint && oldBreakpoint.hitCondition
};
if (this.hitCountContext) {
raw.hitCondition = this.inputBox.value;
if (this.conditionInput) {
raw.condition = this.conditionInput;
}
} else {
raw.condition = this.inputBox.value;
if (this.hitCountInput) {
raw.hitCondition = this.hitCountInput;
}
}
if (oldBreakpoint) {
this.debugService.removeBreakpoints(oldBreakpoint.getId()).done(null, errors.onUnexpectedError);
}
this.debugService.addBreakpoints(uri, [raw]).done(null, errors.onUnexpectedError);
}
this.dispose();
}
});
this.toDispose.push(dom.addStandardDisposableListener(this.inputBox.inputElement, 'keydown', (e: IKeyboardEvent) => {
const isEscape = e.equals(KeyCode.Escape);
const isEnter = e.equals(KeyCode.Enter);
if (isEscape || isEnter) {
e.stopPropagation();
wrapUp(isEnter);
}
}));
}
public dispose(): void {
super.dispose();
lifecycle.dispose(this.toDispose);
setTimeout(() => this.editor.focus(), 0);
}
}

View File

@@ -0,0 +1,216 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import * as lifecycle from 'vs/base/common/lifecycle';
import * as errors from 'vs/base/common/errors';
import { IAction, IActionRunner } from 'vs/base/common/actions';
import { KeyCode } from 'vs/base/common/keyCodes';
import * as dom from 'vs/base/browser/dom';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { SelectBox } from 'vs/base/browser/ui/selectBox/selectBox';
import { SelectActionItem, IActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { EventEmitter } from 'vs/base/common/eventEmitter';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
import { IDebugService } from 'vs/workbench/parts/debug/common/debug';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { attachSelectBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import { selectBorder } from 'vs/platform/theme/common/colorRegistry';
const $ = dom.$;
export class StartDebugActionItem extends EventEmitter implements IActionItem {
private static SEPARATOR = '─────────';
public actionRunner: IActionRunner;
private container: HTMLElement;
private start: HTMLElement;
private selectBox: SelectBox;
private options: { label: string, handler: (() => boolean) }[];
private toDispose: lifecycle.IDisposable[];
private selected: number;
constructor(
private context: any,
private action: IAction,
@IDebugService private debugService: IDebugService,
@IThemeService private themeService: IThemeService,
@IConfigurationService private configurationService: IConfigurationService,
@ICommandService private commandService: ICommandService,
@IQuickOpenService private quickOpenService: IQuickOpenService
) {
super();
this.toDispose = [];
this.selectBox = new SelectBox([], -1);
this.toDispose.push(attachSelectBoxStyler(this.selectBox, themeService, {
selectBackground: SIDE_BAR_BACKGROUND
}));
this.registerListeners();
}
private registerListeners(): void {
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => {
if (e.sourceConfig.launch) {
this.updateOptions();
}
}));
this.toDispose.push(this.selectBox.onDidSelect(e => {
if (this.options[e.index].handler()) {
this.selected = e.index;
} else {
// Some select options should not remain selected https://github.com/Microsoft/vscode/issues/31526
this.selectBox.select(this.selected);
}
}));
this.toDispose.push(this.debugService.getConfigurationManager().onDidSelectConfiguration(() => {
this.updateOptions();
}));
}
public render(container: HTMLElement): void {
this.container = container;
dom.addClass(container, 'start-debug-action-item');
this.start = dom.append(container, $('.icon'));
this.start.title = this.action.label;
this.start.tabIndex = 0;
this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.CLICK, () => {
this.start.blur();
this.actionRunner.run(this.action, this.context).done(null, errors.onUnexpectedError);
}));
this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.MOUSE_DOWN, (e: MouseEvent) => {
if (this.action.enabled && e.button === 0) {
dom.addClass(this.start, 'active');
}
}));
this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.MOUSE_UP, () => {
dom.removeClass(this.start, 'active');
}));
this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.MOUSE_OUT, () => {
dom.removeClass(this.start, 'active');
}));
this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => {
const event = new StandardKeyboardEvent(e);
if (event.equals(KeyCode.Enter)) {
this.actionRunner.run(this.action, this.context).done(null, errors.onUnexpectedError);
}
if (event.equals(KeyCode.RightArrow)) {
this.selectBox.focus();
event.stopPropagation();
}
}));
const selectBoxContainer = $('.configuration');
this.selectBox.render(dom.append(container, selectBoxContainer));
this.toDispose.push(dom.addDisposableListener(selectBoxContainer, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => {
const event = new StandardKeyboardEvent(e);
if (event.equals(KeyCode.LeftArrow)) {
this.start.focus();
event.stopPropagation();
}
}));
this.toDispose.push(attachStylerCallback(this.themeService, { selectBorder }, colors => {
this.container.style.border = colors.selectBorder ? `1px solid ${colors.selectBorder}` : null;
selectBoxContainer.style.borderLeft = colors.selectBorder ? `1px solid ${colors.selectBorder}` : null;
}));
this.updateOptions();
}
public setActionContext(context: any): void {
this.context = context;
}
public isEnabled(): boolean {
return true;
}
public focus(fromRight?: boolean): void {
if (fromRight) {
this.selectBox.focus();
} else {
this.start.focus();
}
}
public blur(): void {
this.container.blur();
}
public dispose(): void {
this.toDispose = lifecycle.dispose(this.toDispose);
}
private updateOptions(): void {
this.selected = 0;
this.options = [];
const manager = this.debugService.getConfigurationManager();
const launches = manager.getLaunches();
manager.getLaunches().forEach(launch =>
launch.getConfigurationNames().forEach(name => {
if (name === manager.selectedName && launch === manager.selectedLaunch) {
this.selected = this.options.length;
}
const label = launches.length > 1 ? `${name} (${launch.name})` : name;
this.options.push({ label, handler: () => { manager.selectConfiguration(launch, name); return true; } });
}));
if (this.options.length === 0) {
this.options.push({ label: nls.localize('noConfigurations', "No Configurations"), handler: () => false });
}
this.options.push({ label: StartDebugActionItem.SEPARATOR, handler: undefined });
const disabledIdx = this.options.length - 1;
launches.forEach(l => {
const label = launches.length > 1 ? nls.localize("addConfigTo", "Add Config ({0})...", l.name) : nls.localize('addConfiguration', "Add Configuration...");
this.options.push({
label, handler: () => {
this.commandService.executeCommand('debug.addConfiguration', l.workspaceUri.toString()).done(undefined, errors.onUnexpectedError);
return false;
}
});
});
this.selectBox.setOptions(this.options.map(data => data.label), this.selected, disabledIdx);
}
}
export class FocusProcessActionItem extends SelectActionItem {
constructor(
action: IAction,
@IDebugService private debugService: IDebugService,
@IThemeService themeService: IThemeService
) {
super(null, action, [], -1);
this.toDispose.push(attachSelectBoxStyler(this.selectBox, themeService));
this.debugService.getViewModel().onDidFocusStackFrame(() => {
const process = this.debugService.getViewModel().focusedProcess;
if (process) {
const index = this.debugService.getModel().getProcesses().indexOf(process);
this.select(index);
}
});
this.debugService.getModel().onDidChangeCallStack(() => this.update());
this.update();
}
private update() {
const process = this.debugService.getViewModel().focusedProcess;
const processes = this.debugService.getModel().getProcesses();
const showRootName = this.debugService.getConfigurationManager().getLaunches().length > 1;
const names = processes.map(p => p.getName(showRootName));
this.setOptions(names, process ? processes.indexOf(process) : undefined);
}
}

View File

@@ -0,0 +1,840 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { Action } from 'vs/base/common/actions';
import * as lifecycle from 'vs/base/common/lifecycle';
import severity from 'vs/base/common/severity';
import { TPromise } from 'vs/base/common/winjs.base';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IFileService } from 'vs/platform/files/common/files';
import { IMessageService } from 'vs/platform/message/common/message';
import { IDebugService, State, IProcess, IThread, IEnablement, IBreakpoint, IStackFrame, IFunctionBreakpoint, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, IExpression, REPL_ID, ProcessState }
from 'vs/workbench/parts/debug/common/debug';
import { Variable, Expression, Thread, Breakpoint, Process } from 'vs/workbench/parts/debug/common/debugModel';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { TogglePanelAction } from 'vs/workbench/browser/panel';
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
export abstract class AbstractDebugAction extends Action {
protected toDispose: lifecycle.IDisposable[];
constructor(
id: string, label: string, cssClass: string,
@IDebugService protected debugService: IDebugService,
@IKeybindingService private keybindingService: IKeybindingService,
public weight?: number
) {
super(id, label, cssClass, false);
this.toDispose = [];
this.toDispose.push(this.debugService.onDidChangeState(state => this.updateEnablement(state)));
this.updateLabel(label);
this.updateEnablement();
}
public run(e?: any): TPromise<any> {
throw new Error('implement me');
}
public get tooltip(): string {
const keybinding = this.keybindingService.lookupKeybinding(this.id);
const keybindingLabel = keybinding && keybinding.getLabel();
return keybindingLabel ? `${this.label} (${keybindingLabel})` : this.label;
}
protected updateLabel(newLabel: string): void {
this.label = newLabel;
}
protected updateEnablement(state = this.debugService.state): void {
this.enabled = this.isEnabled(state);
}
protected isEnabled(state: State): boolean {
return true;
}
public dispose(): void {
super.dispose();
this.toDispose = lifecycle.dispose(this.toDispose);
}
}
export class ConfigureAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.configure';
static LABEL = nls.localize('openLaunchJson', "Open {0}", 'launch.json');
constructor(id: string, label: string,
@IDebugService debugService: IDebugService,
@IKeybindingService keybindingService: IKeybindingService,
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IMessageService private messageService: IMessageService
) {
super(id, label, 'debug-action configure', debugService, keybindingService);
this.toDispose.push(debugService.getConfigurationManager().onDidSelectConfiguration(() => this.updateClass()));
this.updateClass();
}
public get tooltip(): string {
if (this.debugService.getConfigurationManager().selectedName) {
return ConfigureAction.LABEL;
}
return nls.localize('launchJsonNeedsConfigurtion', "Configure or Fix 'launch.json'");
}
private updateClass(): void {
this.class = this.debugService.getConfigurationManager().selectedName ? 'debug-action configure' : 'debug-action configure notification';
}
public run(event?: any): TPromise<any> {
if (!this.contextService.hasWorkspace()) {
this.messageService.show(severity.Info, nls.localize('noFolderDebugConfig', "Please first open a folder in order to do advanced debug configuration."));
return TPromise.as(null);
}
const sideBySide = !!(event && (event.ctrlKey || event.metaKey));
return this.debugService.getConfigurationManager().selectedLaunch.openConfigFile(sideBySide);
}
}
export class StartAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.start';
static LABEL = nls.localize('startDebug', "Start Debugging");
constructor(id: string, label: string,
@IDebugService debugService: IDebugService,
@IKeybindingService keybindingService: IKeybindingService,
@IWorkspaceContextService private contextService: IWorkspaceContextService
) {
super(id, label, 'debug-action start', debugService, keybindingService);
this.debugService.getConfigurationManager().onDidSelectConfiguration(() => this.updateEnablement());
this.debugService.getModel().onDidChangeCallStack(() => this.updateEnablement());
}
public run(): TPromise<any> {
const launch = this.debugService.getConfigurationManager().selectedLaunch;
return this.debugService.startDebugging(launch ? launch.workspaceUri : undefined, undefined, this.isNoDebug());
}
protected isNoDebug(): boolean {
return false;
}
// Disabled if the launch drop down shows the launch config that is already running.
protected isEnabled(state: State): boolean {
const processes = this.debugService.getModel().getProcesses();
const selectedName = this.debugService.getConfigurationManager().selectedName;
const launch = this.debugService.getConfigurationManager().selectedLaunch;
if (state === State.Initializing) {
return false;
}
if (this.contextService && !this.contextService.hasWorkspace() && processes.length > 0) {
return false;
}
if (processes.some(p => p.getName(false) === selectedName && (!launch || p.session.root.toString() === launch.workspaceUri.toString()))) {
return false;
}
const compound = launch && launch.getCompound(selectedName);
if (compound && compound.configurations && processes.some(p => compound.configurations.indexOf(p.getName(false)) !== -1)) {
return false;
}
return true;
}
}
export class RunAction extends StartAction {
static ID = 'workbench.action.debug.run';
static LABEL = nls.localize('startWithoutDebugging', "Start Without Debugging");
protected isNoDebug(): boolean {
return true;
}
}
export class SelectAndStartAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.selectandstart';
static LABEL = nls.localize('selectAndStartDebugging', "Select and Start Debugging");
constructor(id: string, label: string,
@IDebugService debugService: IDebugService,
@IKeybindingService keybindingService: IKeybindingService,
@ICommandService commandService: ICommandService,
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IFileService fileService: IFileService,
@IQuickOpenService private quickOpenService: IQuickOpenService
) {
super(id, label, undefined, debugService, keybindingService);
this.quickOpenService = quickOpenService;
}
public run(): TPromise<any> {
return this.quickOpenService.show('debug ');
}
}
export class RestartAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.restart';
static LABEL = nls.localize('restartDebug', "Restart");
static RECONNECT_LABEL = nls.localize('reconnectDebug', "Reconnect");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action restart', debugService, keybindingService, 70);
this.setLabel(this.debugService.getViewModel().focusedProcess);
this.toDispose.push(this.debugService.getViewModel().onDidFocusStackFrame(() => this.setLabel(this.debugService.getViewModel().focusedProcess)));
}
private setLabel(process: IProcess): void {
this.updateLabel(process && process.state === ProcessState.ATTACH ? RestartAction.RECONNECT_LABEL : RestartAction.LABEL);
}
public run(process: IProcess): TPromise<any> {
if (!(process instanceof Process)) {
process = this.debugService.getViewModel().focusedProcess;
}
if (!process) {
return TPromise.as(null);
}
if (this.debugService.getModel().getProcesses().length <= 1) {
this.debugService.removeReplExpressions();
}
return this.debugService.restartProcess(process);
}
protected isEnabled(state: State): boolean {
return super.isEnabled(state) && state !== State.Inactive;
}
}
export class StepOverAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stepOver';
static LABEL = nls.localize('stepOverDebug', "Step Over");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action step-over', debugService, keybindingService, 20);
}
public run(thread: IThread): TPromise<any> {
if (!(thread instanceof Thread)) {
thread = this.debugService.getViewModel().focusedThread;
}
return thread ? thread.next() : TPromise.as(null);
}
protected isEnabled(state: State): boolean {
return super.isEnabled(state) && state === State.Stopped;
}
}
export class StepIntoAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stepInto';
static LABEL = nls.localize('stepIntoDebug', "Step Into");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action step-into', debugService, keybindingService, 30);
}
public run(thread: IThread): TPromise<any> {
if (!(thread instanceof Thread)) {
thread = this.debugService.getViewModel().focusedThread;
}
return thread ? thread.stepIn() : TPromise.as(null);
}
protected isEnabled(state: State): boolean {
return super.isEnabled(state) && state === State.Stopped;
}
}
export class StepOutAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stepOut';
static LABEL = nls.localize('stepOutDebug', "Step Out");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action step-out', debugService, keybindingService, 40);
}
public run(thread: IThread): TPromise<any> {
if (!(thread instanceof Thread)) {
thread = this.debugService.getViewModel().focusedThread;
}
return thread ? thread.stepOut() : TPromise.as(null);
}
protected isEnabled(state: State): boolean {
return super.isEnabled(state) && state === State.Stopped;
}
}
export class StopAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stop';
static LABEL = nls.localize('stopDebug', "Stop");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action stop', debugService, keybindingService, 80);
}
public run(process: IProcess): TPromise<any> {
if (!(process instanceof Process)) {
process = this.debugService.getViewModel().focusedProcess;
}
return this.debugService.stopProcess(process);
}
protected isEnabled(state: State): boolean {
return super.isEnabled(state) && state !== State.Inactive;
}
}
export class DisconnectAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.disconnect';
static LABEL = nls.localize('disconnectDebug', "Disconnect");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action disconnect', debugService, keybindingService, 80);
}
public run(): TPromise<any> {
const process = this.debugService.getViewModel().focusedProcess;
return this.debugService.stopProcess(process);
}
protected isEnabled(state: State): boolean {
return super.isEnabled(state) && state !== State.Inactive;
}
}
export class ContinueAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.continue';
static LABEL = nls.localize('continueDebug', "Continue");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action continue', debugService, keybindingService, 10);
}
public run(thread: IThread): TPromise<any> {
if (!(thread instanceof Thread)) {
thread = this.debugService.getViewModel().focusedThread;
}
return thread ? thread.continue() : TPromise.as(null);
}
protected isEnabled(state: State): boolean {
return super.isEnabled(state) && state === State.Stopped;
}
}
export class PauseAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.pause';
static LABEL = nls.localize('pauseDebug', "Pause");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action pause', debugService, keybindingService, 10);
}
public run(thread: IThread): TPromise<any> {
if (!(thread instanceof Thread)) {
thread = this.debugService.getViewModel().focusedThread;
}
return thread ? thread.pause() : TPromise.as(null);
}
protected isEnabled(state: State): boolean {
return super.isEnabled(state) && state === State.Running;
}
}
export class RestartFrameAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.restartFrame';
static LABEL = nls.localize('restartFrame', "Restart Frame");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, undefined, debugService, keybindingService);
}
public run(frame: IStackFrame): TPromise<any> {
if (!frame) {
frame = this.debugService.getViewModel().focusedStackFrame;
}
return frame.restart();
}
}
export class RemoveBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.removeBreakpoint';
static LABEL = nls.localize('removeBreakpoint', "Remove Breakpoint");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action remove', debugService, keybindingService);
}
public run(breakpoint: IBreakpoint): TPromise<any> {
return breakpoint instanceof Breakpoint ? this.debugService.removeBreakpoints(breakpoint.getId())
: this.debugService.removeFunctionBreakpoints(breakpoint.getId());
}
}
export class RemoveAllBreakpointsAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.removeAllBreakpoints';
static LABEL = nls.localize('removeAllBreakpoints', "Remove All Breakpoints");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action remove-all', debugService, keybindingService);
this.toDispose.push(this.debugService.getModel().onDidChangeBreakpoints(() => this.updateEnablement()));
}
public run(): TPromise<any> {
return TPromise.join([this.debugService.removeBreakpoints(), this.debugService.removeFunctionBreakpoints()]);
}
protected isEnabled(state: State): boolean {
const model = this.debugService.getModel();
return super.isEnabled(state) && (model.getBreakpoints().length > 0 || model.getFunctionBreakpoints().length > 0);
}
}
export class EnableBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.enableBreakpoint';
static LABEL = nls.localize('enableBreakpoint', "Enable Breakpoint");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, undefined, debugService, keybindingService);
}
public run(element: IEnablement): TPromise<any> {
return this.debugService.enableOrDisableBreakpoints(true, element);
}
}
export class DisableBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.disableBreakpoint';
static LABEL = nls.localize('disableBreakpoint', "Disable Breakpoint");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, undefined, debugService, keybindingService);
}
public run(element: IEnablement): TPromise<any> {
return this.debugService.enableOrDisableBreakpoints(false, element);
}
}
export class EnableAllBreakpointsAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.enableAllBreakpoints';
static LABEL = nls.localize('enableAllBreakpoints', "Enable All Breakpoints");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action enable-all-breakpoints', debugService, keybindingService);
this.toDispose.push(this.debugService.getModel().onDidChangeBreakpoints(() => this.updateEnablement()));
}
public run(): TPromise<any> {
return this.debugService.enableOrDisableBreakpoints(true);
}
protected isEnabled(state: State): boolean {
const model = this.debugService.getModel();
return super.isEnabled(state) && (<IEnablement[]>model.getBreakpoints()).concat(model.getFunctionBreakpoints()).concat(model.getExceptionBreakpoints()).some(bp => !bp.enabled);
}
}
export class DisableAllBreakpointsAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.disableAllBreakpoints';
static LABEL = nls.localize('disableAllBreakpoints', "Disable All Breakpoints");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action disable-all-breakpoints', debugService, keybindingService);
this.toDispose.push(this.debugService.getModel().onDidChangeBreakpoints(() => this.updateEnablement()));
}
public run(): TPromise<any> {
return this.debugService.enableOrDisableBreakpoints(false);
}
protected isEnabled(state: State): boolean {
const model = this.debugService.getModel();
return super.isEnabled(state) && (<IEnablement[]>model.getBreakpoints()).concat(model.getFunctionBreakpoints()).concat(model.getExceptionBreakpoints()).some(bp => bp.enabled);
}
}
export class ToggleBreakpointsActivatedAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.toggleBreakpointsActivatedAction';
static ACTIVATE_LABEL = nls.localize('activateBreakpoints', "Activate Breakpoints");
static DEACTIVATE_LABEL = nls.localize('deactivateBreakpoints', "Deactivate Breakpoints");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action breakpoints-activate', debugService, keybindingService);
this.updateLabel(this.debugService.getModel().areBreakpointsActivated() ? ToggleBreakpointsActivatedAction.DEACTIVATE_LABEL : ToggleBreakpointsActivatedAction.ACTIVATE_LABEL);
this.toDispose.push(this.debugService.getModel().onDidChangeBreakpoints(() => {
this.updateLabel(this.debugService.getModel().areBreakpointsActivated() ? ToggleBreakpointsActivatedAction.DEACTIVATE_LABEL : ToggleBreakpointsActivatedAction.ACTIVATE_LABEL);
this.updateEnablement();
}));
}
public run(): TPromise<any> {
return this.debugService.setBreakpointsActivated(!this.debugService.getModel().areBreakpointsActivated());
}
protected isEnabled(state: State): boolean {
return (this.debugService.getModel().getFunctionBreakpoints().length + this.debugService.getModel().getBreakpoints().length) > 0;
}
}
export class ReapplyBreakpointsAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.reapplyBreakpointsAction';
static LABEL = nls.localize('reapplyAllBreakpoints', "Reapply All Breakpoints");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, null, debugService, keybindingService);
this.toDispose.push(this.debugService.getModel().onDidChangeBreakpoints(() => this.updateEnablement()));
}
public run(): TPromise<any> {
return this.debugService.setBreakpointsActivated(true);
}
protected isEnabled(state: State): boolean {
const model = this.debugService.getModel();
return super.isEnabled(state) && state !== State.Inactive &&
(model.getFunctionBreakpoints().length + model.getBreakpoints().length + model.getExceptionBreakpoints().length > 0);
}
}
export class AddFunctionBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.addFunctionBreakpointAction';
static LABEL = nls.localize('addFunctionBreakpoint', "Add Function Breakpoint");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action add-function-breakpoint', debugService, keybindingService);
}
public run(): TPromise<any> {
this.debugService.addFunctionBreakpoint();
return TPromise.as(null);
}
}
export class RenameFunctionBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.renameFunctionBreakpointAction';
static LABEL = nls.localize('renameFunctionBreakpoint', "Rename Function Breakpoint");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, null, debugService, keybindingService);
}
public run(fbp: IFunctionBreakpoint): TPromise<any> {
this.debugService.getViewModel().setSelectedFunctionBreakpoint(fbp);
return TPromise.as(null);
}
}
export class AddConditionalBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.addConditionalBreakpointAction';
static LABEL = nls.localize('addConditionalBreakpoint', "Add Conditional Breakpoint...");
constructor(id: string, label: string,
private editor: ICodeEditor,
private lineNumber: number,
@IDebugService debugService: IDebugService,
@IKeybindingService keybindingService: IKeybindingService,
) {
super(id, label, null, debugService, keybindingService);
}
public run(): TPromise<any> {
this.editor.getContribution<IDebugEditorContribution>(EDITOR_CONTRIBUTION_ID).showBreakpointWidget(this.lineNumber, undefined);
return TPromise.as(null);
}
}
export class EditConditionalBreakpointAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.editConditionalBreakpointAction';
static LABEL = nls.localize('editConditionalBreakpoint', "Edit Breakpoint...");
constructor(id: string, label: string,
private editor: ICodeEditor,
@IDebugService debugService: IDebugService,
@IKeybindingService keybindingService: IKeybindingService,
) {
super(id, label, null, debugService, keybindingService);
}
public run(breakpoint: IBreakpoint): TPromise<any> {
this.editor.getContribution<IDebugEditorContribution>(EDITOR_CONTRIBUTION_ID).showBreakpointWidget(breakpoint.lineNumber, breakpoint.column);
return TPromise.as(null);
}
}
export class SetValueAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.setValue';
static LABEL = nls.localize('setValue', "Set Value");
constructor(id: string, label: string, private variable: Variable, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, null, debugService, keybindingService);
}
public run(): TPromise<any> {
if (this.variable instanceof Variable) {
this.debugService.getViewModel().setSelectedExpression(this.variable);
}
return TPromise.as(null);
}
protected isEnabled(state: State): boolean {
const process = this.debugService.getViewModel().focusedProcess;
return super.isEnabled(state) && state === State.Stopped && process && process.session.capabilities.supportsSetVariable;
}
}
export class AddWatchExpressionAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.addWatchExpression';
static LABEL = nls.localize('addWatchExpression', "Add Expression");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action add-watch-expression', debugService, keybindingService);
this.toDispose.push(this.debugService.getModel().onDidChangeWatchExpressions(() => this.updateEnablement()));
}
public run(): TPromise<any> {
return this.debugService.addWatchExpression();
}
protected isEnabled(state: State): boolean {
return super.isEnabled(state) && this.debugService.getModel().getWatchExpressions().every(we => !!we.name);
}
}
export class EditWatchExpressionAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.editWatchExpression';
static LABEL = nls.localize('editWatchExpression', "Edit Expression");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, undefined, debugService, keybindingService);
}
public run(expression: Expression): TPromise<any> {
this.debugService.getViewModel().setSelectedExpression(expression);
return TPromise.as(null);
}
}
export class AddToWatchExpressionsAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.addToWatchExpressions';
static LABEL = nls.localize('addToWatchExpressions', "Add to Watch");
constructor(id: string, label: string, private expression: IExpression, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action add-to-watch', debugService, keybindingService);
}
public run(): TPromise<any> {
const name = this.expression instanceof Variable ? this.expression.evaluateName : this.expression.name;
return this.debugService.addWatchExpression(name);
}
}
export class RemoveWatchExpressionAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.removeWatchExpression';
static LABEL = nls.localize('removeWatchExpression', "Remove Expression");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, undefined, debugService, keybindingService);
}
public run(expression: Expression): TPromise<any> {
this.debugService.removeWatchExpressions(expression.getId());
return TPromise.as(null);
}
}
export class RemoveAllWatchExpressionsAction extends AbstractDebugAction {
static ID = 'workbench.debug.viewlet.action.removeAllWatchExpressions';
static LABEL = nls.localize('removeAllWatchExpressions', "Remove All Expressions");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action remove-all', debugService, keybindingService);
this.toDispose.push(this.debugService.getModel().onDidChangeWatchExpressions(() => this.updateEnablement()));
}
public run(): TPromise<any> {
this.debugService.removeWatchExpressions();
return TPromise.as(null);
}
protected isEnabled(state: State): boolean {
return super.isEnabled(state) && this.debugService.getModel().getWatchExpressions().length > 0;
}
}
export class ClearReplAction extends AbstractDebugAction {
static ID = 'workbench.debug.panel.action.clearReplAction';
static LABEL = nls.localize('clearRepl', "Clear Console");
constructor(id: string, label: string,
@IDebugService debugService: IDebugService,
@IKeybindingService keybindingService: IKeybindingService,
@IPanelService private panelService: IPanelService
) {
super(id, label, 'debug-action clear-repl', debugService, keybindingService);
}
public run(): TPromise<any> {
this.debugService.removeReplExpressions();
// focus back to repl
return this.panelService.openPanel(REPL_ID, true);
}
}
export class ToggleReplAction extends TogglePanelAction {
static ID = 'workbench.debug.action.toggleRepl';
static LABEL = nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugConsoleAction' }, 'Debug Console');
private toDispose: lifecycle.IDisposable[];
constructor(id: string, label: string,
@IDebugService private debugService: IDebugService,
@IPartService partService: IPartService,
@IPanelService panelService: IPanelService
) {
super(id, label, REPL_ID, panelService, partService, 'debug-action toggle-repl');
this.toDispose = [];
this.registerListeners();
}
private registerListeners(): void {
this.toDispose.push(this.debugService.getModel().onDidChangeReplElements(() => {
if (!this.isReplVisible()) {
this.class = 'debug-action toggle-repl notification';
this.tooltip = nls.localize('unreadOutput', "New Output in Debug Console");
}
}));
this.toDispose.push(this.panelService.onDidPanelOpen(panel => {
if (panel.getId() === REPL_ID) {
this.class = 'debug-action toggle-repl';
this.tooltip = ToggleReplAction.LABEL;
}
}));
}
private isReplVisible(): boolean {
const panel = this.panelService.getActivePanel();
return panel && panel.getId() === REPL_ID;
}
public dispose(): void {
super.dispose();
this.toDispose = lifecycle.dispose(this.toDispose);
}
}
export class FocusReplAction extends Action {
static ID = 'workbench.debug.action.focusRepl';
static LABEL = nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugFocusConsole' }, 'Focus Debug Console');
constructor(id: string, label: string,
@IPanelService private panelService: IPanelService
) {
super(id, label);
}
public run(): TPromise<any> {
return this.panelService.openPanel(REPL_ID, true);
}
}
export class FocusProcessAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.focusProcess';
static LABEL = nls.localize('focusProcess', "Focus Process");
constructor(id: string, label: string,
@IDebugService debugService: IDebugService,
@IKeybindingService keybindingService: IKeybindingService,
@IWorkbenchEditorService private editorService: IWorkbenchEditorService
) {
super(id, label, null, debugService, keybindingService, 100);
}
public run(processName: string): TPromise<any> {
const isMultiRoot = this.debugService.getConfigurationManager().getLaunches().length > 1;
const process = this.debugService.getModel().getProcesses().filter(p => p.getName(isMultiRoot) === processName).pop();
return this.debugService.focusStackFrameAndEvaluate(null, process, true).then(() => {
const stackFrame = this.debugService.getViewModel().focusedStackFrame;
if (stackFrame) {
return stackFrame.openInEditor(this.editorService, true);
}
return undefined;
});
}
}
// Actions used by the chakra debugger
export class StepBackAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.stepBack';
static LABEL = nls.localize('stepBackDebug', "Step Back");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action step-back', debugService, keybindingService, 50);
}
public run(thread: IThread): TPromise<any> {
if (!(thread instanceof Thread)) {
thread = this.debugService.getViewModel().focusedThread;
}
return thread ? thread.stepBack() : TPromise.as(null);
}
protected isEnabled(state: State): boolean {
const process = this.debugService.getViewModel().focusedProcess;
return super.isEnabled(state) && state === State.Stopped &&
process && process.session.capabilities.supportsStepBack;
}
}
export class ReverseContinueAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.reverseContinue';
static LABEL = nls.localize('reverseContinue', "Reverse");
constructor(id: string, label: string, @IDebugService debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService) {
super(id, label, 'debug-action reverse-continue', debugService, keybindingService, 60);
}
public run(thread: IThread): TPromise<any> {
if (!(thread instanceof Thread)) {
thread = this.debugService.getViewModel().focusedThread;
}
return thread ? thread.reverseContinue() : TPromise.as(null);
}
protected isEnabled(state: State): boolean {
const process = this.debugService.getViewModel().focusedProcess;
return super.isEnabled(state) && state === State.Stopped &&
process && process.session.capabilities.supportsStepBack;
}
}

View File

@@ -0,0 +1,278 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!vs/workbench/parts/debug/browser/media/debugActionsWidget';
import * as errors from 'vs/base/common/errors';
import * as strings from 'vs/base/common/strings';
import * as browser from 'vs/base/browser/browser';
import severity from 'vs/base/common/severity';
import * as builder from 'vs/base/browser/builder';
import * as dom from 'vs/base/browser/dom';
import * as arrays from 'vs/base/common/arrays';
import { StandardMouseEvent } from 'vs/base/browser/mouseEvent';
import { IAction } from 'vs/base/common/actions';
import { EventType } from 'vs/base/common/events';
import { ActionBar, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { IDebugConfiguration, IDebugService, State } from 'vs/workbench/parts/debug/common/debug';
import { AbstractDebugAction, PauseAction, ContinueAction, StepBackAction, ReverseContinueAction, StopAction, DisconnectAction, StepOverAction, StepIntoAction, StepOutAction, RestartAction, FocusProcessAction } from 'vs/workbench/parts/debug/browser/debugActions';
import { FocusProcessActionItem } from 'vs/workbench/parts/debug/browser/debugActionItems';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IMessageService } from 'vs/platform/message/common/message';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { Themable } from 'vs/workbench/common/theme';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { registerColor, contrastBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
import { localize } from 'vs/nls';
const $ = builder.$;
const DEBUG_ACTIONS_WIDGET_POSITION_KEY = 'debug.actionswidgetposition';
export const debugToolBarBackground = registerColor('debugToolBar.background', {
dark: '#333333',
light: '#F3F3F3',
hc: '#000000'
}, localize('debugToolBarBackground', "Debug toolbar background color."));
export class DebugActionsWidget extends Themable implements IWorkbenchContribution {
private static ID = 'debug.actionsWidget';
private $el: builder.Builder;
private dragArea: builder.Builder;
private actionBar: ActionBar;
private allActions: AbstractDebugAction[];
private activeActions: AbstractDebugAction[];
private isVisible: boolean;
private isBuilt: boolean;
constructor(
@IMessageService private messageService: IMessageService,
@ITelemetryService private telemetryService: ITelemetryService,
@IDebugService private debugService: IDebugService,
@IInstantiationService private instantiationService: IInstantiationService,
@IPartService private partService: IPartService,
@IStorageService private storageService: IStorageService,
@IConfigurationService private configurationService: IConfigurationService,
@IThemeService themeService: IThemeService
) {
super(themeService);
this.$el = $().div().addClass('debug-actions-widget').style('top', `${partService.getTitleBarOffset()}px`);
this.dragArea = $().div().addClass('drag-area');
this.$el.append(this.dragArea);
const actionBarContainter = $().div().addClass('.action-bar-container');
this.$el.append(actionBarContainter);
this.activeActions = [];
this.actionBar = new ActionBar(actionBarContainter, {
orientation: ActionsOrientation.HORIZONTAL,
actionItemProvider: (action: IAction) => {
if (action.id === FocusProcessAction.ID) {
return this.instantiationService.createInstance(FocusProcessActionItem, action);
}
return null;
}
});
this.updateStyles();
this.toUnbind.push(this.actionBar);
this.registerListeners();
this.hide();
this.isBuilt = false;
}
private registerListeners(): void {
this.toUnbind.push(this.debugService.onDidChangeState(state => this.update(state)));
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(() => this.update(this.debugService.state)));
this.toUnbind.push(this.actionBar.actionRunner.addListener(EventType.RUN, (e: any) => {
// check for error
if (e.error && !errors.isPromiseCanceledError(e.error)) {
this.messageService.show(severity.Error, e.error);
}
// log in telemetry
if (this.telemetryService) {
this.telemetryService.publicLog('workbenchActionExecuted', { id: e.action.id, from: 'debugActionsWidget' });
}
}));
$(window).on(dom.EventType.RESIZE, () => this.setXCoordinate(), this.toUnbind);
this.dragArea.on(dom.EventType.MOUSE_UP, (event: MouseEvent) => {
const mouseClickEvent = new StandardMouseEvent(event);
if (mouseClickEvent.detail === 2) {
// double click on debug bar centers it again #8250
const widgetWidth = this.$el.getHTMLElement().clientWidth;
this.setXCoordinate(0.5 * window.innerWidth - 0.5 * widgetWidth);
this.storePosition();
}
});
this.dragArea.on(dom.EventType.MOUSE_DOWN, (event: MouseEvent) => {
const $window = $(window);
this.dragArea.addClass('dragged');
$window.on('mousemove', (e: MouseEvent) => {
const mouseMoveEvent = new StandardMouseEvent(e);
// Prevent default to stop editor selecting text #8524
mouseMoveEvent.preventDefault();
// Reduce x by width of drag handle to reduce jarring #16604
this.setXCoordinate(mouseMoveEvent.posx - 14);
}).once('mouseup', (e: MouseEvent) => {
this.storePosition();
this.dragArea.removeClass('dragged');
$window.off('mousemove');
});
});
this.toUnbind.push(this.partService.onTitleBarVisibilityChange(() => this.positionDebugWidget()));
this.toUnbind.push(browser.onDidChangeZoomLevel(() => this.positionDebugWidget()));
}
private storePosition(): void {
const position = parseFloat(this.$el.getComputedStyle().left) / window.innerWidth;
this.storageService.store(DEBUG_ACTIONS_WIDGET_POSITION_KEY, position, StorageScope.WORKSPACE);
this.telemetryService.publicLog(DEBUG_ACTIONS_WIDGET_POSITION_KEY, { position });
}
protected updateStyles(): void {
super.updateStyles();
if (this.$el) {
this.$el.style('background-color', this.getColor(debugToolBarBackground));
const widgetShadowColor = this.getColor(widgetShadow);
this.$el.style('box-shadow', widgetShadowColor ? `0 5px 8px ${widgetShadowColor}` : null);
const contrastBorderColor = this.getColor(contrastBorder);
this.$el.style('border-style', contrastBorderColor ? 'solid' : null);
this.$el.style('border-width', contrastBorderColor ? '1px' : null);
this.$el.style('border-color', contrastBorderColor);
}
}
private positionDebugWidget(): void {
const titlebarOffset = this.partService.getTitleBarOffset();
$(this.$el).style('top', `${titlebarOffset}px`);
}
private setXCoordinate(x?: number): void {
if (!this.isVisible) {
return;
}
const widgetWidth = this.$el.getHTMLElement().clientWidth;
if (x === undefined) {
const positionPercentage = this.storageService.get(DEBUG_ACTIONS_WIDGET_POSITION_KEY, StorageScope.WORKSPACE);
x = positionPercentage !== undefined ? parseFloat(positionPercentage) * window.innerWidth : (0.5 * window.innerWidth - 0.5 * widgetWidth);
}
x = Math.max(0, Math.min(x, window.innerWidth - widgetWidth)); // do not allow the widget to overflow on the right
this.$el.style('left', `${x}px`);
}
public getId(): string {
return DebugActionsWidget.ID;
}
private update(state: State): void {
if (state === State.Inactive || this.configurationService.getConfiguration<IDebugConfiguration>('debug').hideActionBar) {
return this.hide();
}
const actions = this.getActions();
if (!arrays.equals(actions, this.activeActions, (first, second) => first.id === second.id)) {
this.actionBar.clear();
this.actionBar.push(actions, { icon: true, label: false });
this.activeActions = actions;
}
this.show();
}
private show(): void {
if (this.isVisible) {
return;
}
if (!this.isBuilt) {
this.isBuilt = true;
this.$el.build(builder.withElementById(this.partService.getWorkbenchElementId()).getHTMLElement());
}
this.isVisible = true;
this.$el.show();
this.setXCoordinate();
}
private hide(): void {
this.isVisible = false;
this.$el.hide();
}
private getActions(): AbstractDebugAction[] {
if (!this.allActions) {
this.allActions = [];
this.allActions.push(this.instantiationService.createInstance(ContinueAction, ContinueAction.ID, ContinueAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(PauseAction, PauseAction.ID, PauseAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(StopAction, StopAction.ID, StopAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(DisconnectAction, DisconnectAction.ID, DisconnectAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(StepOverAction, StepOverAction.ID, StepOverAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(StepIntoAction, StepIntoAction.ID, StepIntoAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(StepOutAction, StepOutAction.ID, StepOutAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(RestartAction, RestartAction.ID, RestartAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(StepBackAction, StepBackAction.ID, StepBackAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(ReverseContinueAction, ReverseContinueAction.ID, ReverseContinueAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(FocusProcessAction, FocusProcessAction.ID, FocusProcessAction.LABEL));
this.allActions.forEach(a => {
this.toUnbind.push(a);
});
}
const state = this.debugService.state;
const process = this.debugService.getViewModel().focusedProcess;
const attached = process && process.configuration.request === 'attach' && process.configuration.type && !strings.equalsIgnoreCase(process.configuration.type, 'extensionHost');
return this.allActions.filter(a => {
if (a.id === ContinueAction.ID) {
return state !== State.Running;
}
if (a.id === PauseAction.ID) {
return state === State.Running;
}
if (a.id === StepBackAction.ID) {
return process && process.session.capabilities.supportsStepBack;
}
if (a.id === ReverseContinueAction.ID) {
return process && process.session.capabilities.supportsStepBack;
}
if (a.id === DisconnectAction.ID) {
return attached;
}
if (a.id === StopAction.ID) {
return !attached;
}
if (a.id === FocusProcessAction.ID) {
return this.debugService.getViewModel().isMultiProcessView();
}
return true;
}).sort((first, second) => first.weight - second.weight);
}
public dispose(): void {
super.dispose();
if (this.$el) {
this.$el.destroy();
delete this.$el;
}
}
}

View File

@@ -0,0 +1,77 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import uri from 'vs/base/common/uri';
import { localize } from 'vs/nls';
import { TPromise } from 'vs/base/common/winjs.base';
import { guessMimeTypes, MIME_TEXT } from 'vs/base/common/mime';
import { IModel } from 'vs/editor/common/editorCommon';
import { IModelService } from 'vs/editor/common/services/modelService';
import { IModeService } from 'vs/editor/common/services/modeService';
import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { DEBUG_SCHEME, IDebugService, IProcess } from 'vs/workbench/parts/debug/common/debug';
export class DebugContentProvider implements IWorkbenchContribution, ITextModelContentProvider {
constructor(
@ITextModelService textModelResolverService: ITextModelService,
@IDebugService private debugService: IDebugService,
@IModelService private modelService: IModelService,
@IModeService private modeService: IModeService
) {
textModelResolverService.registerTextModelContentProvider(DEBUG_SCHEME, this);
}
public getId(): string {
return 'debug.contentprovider';
}
public provideTextContent(resource: uri): TPromise<IModel> {
let process: IProcess;
if (resource.query) {
const keyvalues = resource.query.split('&');
for (let keyvalue of keyvalues) {
const pair = keyvalue.split('=');
if (pair.length === 2 && pair[0] === 'session') {
process = this.debugService.findProcessByUUID(decodeURIComponent(pair[1]));
break;
}
}
}
if (!process) {
// fallback: use focused process
process = this.debugService.getViewModel().focusedProcess;
}
if (!process) {
return TPromise.wrapError<IModel>(new Error(localize('unable', "Unable to resolve the resource without a debug session")));
}
const source = process.sources.get(resource.toString());
let rawSource: DebugProtocol.Source;
if (source) {
rawSource = source.raw;
} else {
// Remove debug: scheme
rawSource = { path: resource.with({ scheme: '', query: '' }).toString(true) };
}
return process.session.source({ sourceReference: source ? source.reference : undefined, source: rawSource }).then(response => {
const mime = response.body.mimeType || guessMimeTypes(resource.toString())[0];
const modePromise = this.modeService.getOrCreateMode(mime);
const model = this.modelService.createModel(response.body.content, modePromise, resource);
return model;
}, (err: DebugProtocol.ErrorResponse) => {
this.debugService.sourceIsNotAvailable(resource);
const modePromise = this.modeService.getOrCreateMode(MIME_TEXT);
const model = this.modelService.createModel(err.message, modePromise, resource);
return model;
});
}
}

View File

@@ -0,0 +1,277 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { TPromise } from 'vs/base/common/winjs.base';
import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes';
import { Range } from 'vs/editor/common/core/range';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ServicesAccessor, editorAction, EditorAction, CommonEditorRegistry, EditorCommand } from 'vs/editor/common/editorCommonExtensions';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IDebugService, CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL, CONTEXT_DEBUG_STATE, State, REPL_ID, VIEWLET_ID, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, CONTEXT_BREAKPOINT_WIDGET_VISIBLE } from 'vs/workbench/parts/debug/common/debug';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
@editorAction
class ToggleBreakpointAction extends EditorAction {
constructor() {
super({
id: 'editor.debug.action.toggleBreakpoint',
label: nls.localize('toggleBreakpointAction', "Debug: Toggle Breakpoint"),
alias: 'Debug: Toggle Breakpoint',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.F9
}
});
}
public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): TPromise<any> {
const debugService = accessor.get(IDebugService);
const position = editor.getPosition();
const modelUri = editor.getModel().uri;
const bps = debugService.getModel().getBreakpoints()
.filter(bp => bp.lineNumber === position.lineNumber && bp.uri.toString() === modelUri.toString());
if (bps.length) {
return TPromise.join(bps.map(bp => debugService.removeBreakpoints(bp.getId())));
}
if (debugService.getConfigurationManager().canSetBreakpointsIn(editor.getModel())) {
return debugService.addBreakpoints(modelUri, [{ lineNumber: position.lineNumber }]);
}
return TPromise.as(null);
}
}
function addColumnBreakpoint(accessor: ServicesAccessor, editor: ICommonCodeEditor, remove: boolean): TPromise<any> {
const debugService = accessor.get(IDebugService);
const position = editor.getPosition();
const modelUri = editor.getModel().uri;
const bp = debugService.getModel().getBreakpoints()
.filter(bp => bp.lineNumber === position.lineNumber && bp.column === position.column && bp.uri.toString() === modelUri.toString()).pop();
if (bp) {
return remove ? debugService.removeBreakpoints(bp.getId()) : TPromise.as(null);
}
if (debugService.getConfigurationManager().canSetBreakpointsIn(editor.getModel())) {
return debugService.addBreakpoints(modelUri, [{ lineNumber: position.lineNumber, column: position.column }]);
}
return TPromise.as(null);
}
@editorAction
class ToggleColumnBreakpointAction extends EditorAction {
constructor() {
super({
id: 'editor.debug.action.toggleColumnBreakpoint',
label: nls.localize('columnBreakpointAction', "Debug: Column Breakpoint"),
alias: 'Debug: Column Breakpoint',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.F9
}
});
}
public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): TPromise<any> {
return addColumnBreakpoint(accessor, editor, true);
}
}
// TODO@Isidor merge two column breakpoints actions together
@editorAction
class ToggleColumnBreakpointContextMenuAction extends EditorAction {
constructor() {
super({
id: 'editor.debug.action.toggleColumnBreakpointContextMenu',
label: nls.localize('columnBreakpoint', "Add Column Breakpoint"),
alias: 'Toggle Column Breakpoint',
precondition: ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL, EditorContextKeys.writable),
menuOpts: {
group: 'debug',
order: 1
}
});
}
public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): TPromise<any> {
return addColumnBreakpoint(accessor, editor, false);
}
}
@editorAction
class ConditionalBreakpointAction extends EditorAction {
constructor() {
super({
id: 'editor.debug.action.conditionalBreakpoint',
label: nls.localize('conditionalBreakpointEditorAction', "Debug: Add Conditional Breakpoint..."),
alias: 'Debug: Add Conditional Breakpoint...',
precondition: null
});
}
public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void {
const debugService = accessor.get(IDebugService);
const { lineNumber, column } = editor.getPosition();
if (debugService.getConfigurationManager().canSetBreakpointsIn(editor.getModel())) {
editor.getContribution<IDebugEditorContribution>(EDITOR_CONTRIBUTION_ID).showBreakpointWidget(lineNumber, column);
}
}
}
@editorAction
class RunToCursorAction extends EditorAction {
constructor() {
super({
id: 'editor.debug.action.runToCursor',
label: nls.localize('runToCursor', "Run to Cursor"),
alias: 'Debug: Run to Cursor',
precondition: ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL, EditorContextKeys.writable, CONTEXT_DEBUG_STATE.isEqualTo('stopped')),
menuOpts: {
group: 'debug',
order: 2
}
});
}
public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): TPromise<void> {
const debugService = accessor.get(IDebugService);
if (debugService.state !== State.Stopped) {
return TPromise.as(null);
}
const position = editor.getPosition();
const uri = editor.getModel().uri;
const oneTimeListener = debugService.getViewModel().focusedProcess.session.onDidEvent(event => {
if (event.event === 'stopped' || event.event === 'exit') {
const toRemove = debugService.getModel().getBreakpoints()
.filter(bp => bp.lineNumber === position.lineNumber && bp.uri.toString() === uri.toString()).pop();
if (toRemove) {
debugService.removeBreakpoints(toRemove.getId());
}
oneTimeListener.dispose();
}
});
const bpExists = !!(debugService.getModel().getBreakpoints().filter(bp => bp.column === position.column && bp.lineNumber === position.lineNumber && bp.uri.toString() === uri.toString()).pop());
return (bpExists ? TPromise.as(null) : debugService.addBreakpoints(uri, [{ lineNumber: position.lineNumber, column: position.column }])).then(() => {
debugService.getViewModel().focusedThread.continue();
});
}
}
@editorAction
class SelectionToReplAction extends EditorAction {
constructor() {
super({
id: 'editor.debug.action.selectionToRepl',
label: nls.localize('debugEvaluate', "Debug: Evaluate"),
alias: 'Debug: Evaluate',
precondition: ContextKeyExpr.and(EditorContextKeys.hasNonEmptySelection, CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL),
menuOpts: {
group: 'debug',
order: 0
}
});
}
public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): TPromise<void> {
const debugService = accessor.get(IDebugService);
const panelService = accessor.get(IPanelService);
const text = editor.getModel().getValueInRange(editor.getSelection());
return debugService.addReplExpression(text)
.then(() => panelService.openPanel(REPL_ID, true))
.then(_ => void 0);
}
}
@editorAction
class SelectionToWatchExpressionsAction extends EditorAction {
constructor() {
super({
id: 'editor.debug.action.selectionToWatch',
label: nls.localize('debugAddToWatch', "Debug: Add to Watch"),
alias: 'Debug: Add to Watch',
precondition: ContextKeyExpr.and(EditorContextKeys.hasNonEmptySelection, CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL),
menuOpts: {
group: 'debug',
order: 1
}
});
}
public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): TPromise<void> {
const debugService = accessor.get(IDebugService);
const viewletService = accessor.get(IViewletService);
const text = editor.getModel().getValueInRange(editor.getSelection());
return viewletService.openViewlet(VIEWLET_ID).then(() => debugService.addWatchExpression(text));
}
}
@editorAction
class ShowDebugHoverAction extends EditorAction {
constructor() {
super({
id: 'editor.debug.action.showDebugHover',
label: nls.localize('showDebugHover', "Debug: Show Hover"),
alias: 'Debug: Show Hover',
precondition: CONTEXT_IN_DEBUG_MODE,
kbOpts: {
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I)
}
});
}
public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): TPromise<void> {
const position = editor.getPosition();
const word = editor.getModel().getWordAtPosition(position);
if (!word) {
return TPromise.as(null);
}
const range = new Range(position.lineNumber, position.column, position.lineNumber, word.endColumn);
return editor.getContribution<IDebugEditorContribution>(EDITOR_CONTRIBUTION_ID).showHover(range, true);
}
}
class CloseBreakpointWidgetCommand extends EditorCommand {
constructor() {
super({
id: 'closeBreakpointWidget',
precondition: CONTEXT_BREAKPOINT_WIDGET_VISIBLE,
kbOpts: {
weight: CommonEditorRegistry.commandWeight(8),
kbExpr: EditorContextKeys.focus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
}
});
}
public runEditorCommand(accessor: ServicesAccessor, editor: ICommonCodeEditor, args: any): void {
return editor.getContribution<IDebugEditorContribution>(EDITOR_CONTRIBUTION_ID).closeBreakpointWidget();
}
}
CommonEditorRegistry.registerEditorCommand(new CloseBreakpointWidgetCommand());

View File

@@ -0,0 +1,387 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { TPromise } from 'vs/base/common/winjs.base';
import * as objects from 'vs/base/common/objects';
import * as lifecycle from 'vs/base/common/lifecycle';
import { Constants } from 'vs/editor/common/core/uint';
import { Range } from 'vs/editor/common/core/range';
import { IModel, TrackedRangeStickiness, IModelDeltaDecoration, IModelDecorationOptions } from 'vs/editor/common/editorCommon';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { IDebugService, IBreakpoint, IRawBreakpoint, State } from 'vs/workbench/parts/debug/common/debug';
import { IModelService } from 'vs/editor/common/services/modelService';
import { IModelDecorationsChangedEvent } from 'vs/editor/common/model/textModelEvents';
import { MarkdownString } from 'vs/base/common/htmlContent';
interface IDebugEditorModelData {
model: IModel;
toDispose: lifecycle.IDisposable[];
breakpointDecorationIds: string[];
breakpointLines: number[];
breakpointDecorationsAsMap: Map<string, boolean>;
currentStackDecorations: string[];
dirty: boolean;
topStackFrameRange: Range;
}
const stickiness = TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges;
export class DebugEditorModelManager implements IWorkbenchContribution {
static ID = 'breakpointManager';
private modelDataMap: Map<string, IDebugEditorModelData>;
private toDispose: lifecycle.IDisposable[];
constructor(
@IModelService private modelService: IModelService,
@IDebugService private debugService: IDebugService
) {
this.modelDataMap = new Map<string, IDebugEditorModelData>();
this.toDispose = [];
this.registerListeners();
}
public getId(): string {
return DebugEditorModelManager.ID;
}
public dispose(): void {
this.modelDataMap.forEach(modelData => {
lifecycle.dispose(modelData.toDispose);
modelData.model.deltaDecorations(modelData.breakpointDecorationIds, []);
modelData.model.deltaDecorations(modelData.currentStackDecorations, []);
});
this.toDispose = lifecycle.dispose(this.toDispose);
this.modelDataMap.clear();
}
private registerListeners(): void {
this.toDispose.push(this.modelService.onModelAdded(this.onModelAdded, this));
this.modelService.getModels().forEach(model => this.onModelAdded(model));
this.toDispose.push(this.modelService.onModelRemoved(this.onModelRemoved, this));
this.toDispose.push(this.debugService.getModel().onDidChangeBreakpoints(() => this.onBreakpointsChange()));
this.toDispose.push(this.debugService.getViewModel().onDidFocusStackFrame(() => this.onFocusStackFrame()));
this.toDispose.push(this.debugService.onDidChangeState(state => {
if (state === State.Inactive) {
this.modelDataMap.forEach(modelData => {
modelData.dirty = false;
modelData.topStackFrameRange = undefined;
});
}
}));
}
private onModelAdded(model: IModel): void {
const modelUrlStr = model.uri.toString();
const breakpoints = this.debugService.getModel().getBreakpoints().filter(bp => bp.uri.toString() === modelUrlStr);
const currentStackDecorations = model.deltaDecorations([], this.createCallStackDecorations(modelUrlStr));
const breakPointDecorations = model.deltaDecorations([], this.createBreakpointDecorations(breakpoints));
const toDispose: lifecycle.IDisposable[] = [model.onDidChangeDecorations((e) => this.onModelDecorationsChanged(modelUrlStr, e))];
const breakpointDecorationsAsMap = new Map<string, boolean>();
breakPointDecorations.forEach(bpd => breakpointDecorationsAsMap.set(bpd, true));
this.modelDataMap.set(modelUrlStr, {
model: model,
toDispose: toDispose,
breakpointDecorationIds: breakPointDecorations,
breakpointLines: breakpoints.map(bp => bp.lineNumber),
breakpointDecorationsAsMap,
currentStackDecorations: currentStackDecorations,
dirty: false,
topStackFrameRange: undefined
});
}
private onModelRemoved(model: IModel): void {
const modelUriStr = model.uri.toString();
if (this.modelDataMap.has(modelUriStr)) {
lifecycle.dispose(this.modelDataMap.get(modelUriStr).toDispose);
this.modelDataMap.delete(modelUriStr);
}
}
// call stack management. Represent data coming from the debug service.
private onFocusStackFrame(): void {
this.modelDataMap.forEach((modelData, uri) => {
modelData.currentStackDecorations = modelData.model.deltaDecorations(modelData.currentStackDecorations, this.createCallStackDecorations(uri));
});
}
private createCallStackDecorations(modelUriStr: string): IModelDeltaDecoration[] {
const result: IModelDeltaDecoration[] = [];
const stackFrame = this.debugService.getViewModel().focusedStackFrame;
if (!stackFrame || stackFrame.source.uri.toString() !== modelUriStr) {
return result;
}
// only show decorations for the currently focused thread.
const columnUntilEOLRange = new Range(stackFrame.range.startLineNumber, stackFrame.range.startColumn, stackFrame.range.startLineNumber, Constants.MAX_SAFE_SMALL_INTEGER);
const range = new Range(stackFrame.range.startLineNumber, stackFrame.range.startColumn, stackFrame.range.startLineNumber, stackFrame.range.startColumn + 1);
// compute how to decorate the editor. Different decorations are used if this is a top stack frame, focused stack frame,
// an exception or a stack frame that did not change the line number (we only decorate the columns, not the whole line).
const callStack = stackFrame.thread.getCallStack();
if (callStack && callStack.length && stackFrame === callStack[0]) {
result.push({
options: DebugEditorModelManager.TOP_STACK_FRAME_MARGIN,
range
});
if (stackFrame.thread.stoppedDetails && stackFrame.thread.stoppedDetails.reason === 'exception') {
result.push({
options: DebugEditorModelManager.TOP_STACK_FRAME_EXCEPTION_DECORATION,
range: columnUntilEOLRange
});
} else {
result.push({
options: DebugEditorModelManager.TOP_STACK_FRAME_DECORATION,
range: columnUntilEOLRange
});
if (stackFrame.range.endLineNumber && stackFrame.range.endColumn) {
result.push({
options: { className: 'debug-top-stack-frame-range' },
range: stackFrame.range
});
}
if (this.modelDataMap.has(modelUriStr)) {
const modelData = this.modelDataMap.get(modelUriStr);
if (modelData.topStackFrameRange && modelData.topStackFrameRange.startLineNumber === stackFrame.range.startLineNumber && modelData.topStackFrameRange.startColumn !== stackFrame.range.startColumn) {
result.push({
options: DebugEditorModelManager.TOP_STACK_FRAME_INLINE_DECORATION,
range: columnUntilEOLRange
});
}
modelData.topStackFrameRange = columnUntilEOLRange;
}
}
} else {
result.push({
options: DebugEditorModelManager.FOCUSED_STACK_FRAME_MARGIN,
range
});
if (stackFrame.range.endLineNumber && stackFrame.range.endColumn) {
result.push({
options: { className: 'debug-focused-stack-frame-range' },
range: stackFrame.range
});
}
result.push({
options: DebugEditorModelManager.FOCUSED_STACK_FRAME_DECORATION,
range: columnUntilEOLRange
});
}
return result;
}
// breakpoints management. Represent data coming from the debug service and also send data back.
private onModelDecorationsChanged(modelUrlStr: string, e: IModelDecorationsChangedEvent): void {
const modelData = this.modelDataMap.get(modelUrlStr);
if (modelData.breakpointDecorationsAsMap.size === 0) {
// I have no decorations
return;
}
if (!e.changedDecorations.some(decorationId => modelData.breakpointDecorationsAsMap.has(decorationId))) {
// nothing to do, my decorations did not change.
return;
}
const data: IRawBreakpoint[] = [];
const lineToBreakpointDataMap = new Map<number, IBreakpoint>();
this.debugService.getModel().getBreakpoints().filter(bp => bp.uri.toString() === modelUrlStr).forEach(bp => {
lineToBreakpointDataMap.set(bp.lineNumber, bp);
});
const modelUri = modelData.model.uri;
for (let i = 0, len = modelData.breakpointDecorationIds.length; i < len; i++) {
const decorationRange = modelData.model.getDecorationRange(modelData.breakpointDecorationIds[i]);
const lineNumber = modelData.breakpointLines[i];
// check if the line got deleted.
if (decorationRange.endColumn - decorationRange.startColumn > 0) {
const breakpoint = lineToBreakpointDataMap.get(lineNumber);
// since we know it is collapsed, it cannot grow to multiple lines
data.push({
lineNumber: decorationRange.startLineNumber,
enabled: breakpoint.enabled,
condition: breakpoint.condition,
hitCondition: breakpoint.hitCondition,
column: breakpoint.column ? decorationRange.startColumn : undefined
});
}
}
modelData.dirty = this.debugService.state !== State.Inactive;
const toRemove = this.debugService.getModel().getBreakpoints()
.filter(bp => bp.uri.toString() === modelUri.toString());
TPromise.join(toRemove.map(bp => this.debugService.removeBreakpoints(bp.getId()))).then(() => {
this.debugService.addBreakpoints(modelUri, data);
});
}
private onBreakpointsChange(): void {
const breakpointsMap = new Map<string, IBreakpoint[]>();
this.debugService.getModel().getBreakpoints().forEach(bp => {
const uriStr = bp.uri.toString();
if (breakpointsMap.has(uriStr)) {
breakpointsMap.get(uriStr).push(bp);
} else {
breakpointsMap.set(uriStr, [bp]);
}
});
breakpointsMap.forEach((bps, uri) => {
if (this.modelDataMap.has(uri)) {
this.updateBreakpoints(this.modelDataMap.get(uri), breakpointsMap.get(uri));
}
});
this.modelDataMap.forEach((modelData, uri) => {
if (!breakpointsMap.has(uri)) {
this.updateBreakpoints(modelData, []);
}
});
}
private updateBreakpoints(modelData: IDebugEditorModelData, newBreakpoints: IBreakpoint[]): void {
modelData.breakpointDecorationIds = modelData.model.deltaDecorations(modelData.breakpointDecorationIds, this.createBreakpointDecorations(newBreakpoints));
modelData.breakpointDecorationsAsMap.clear();
modelData.breakpointDecorationIds.forEach(id => modelData.breakpointDecorationsAsMap.set(id, true));
modelData.breakpointLines = newBreakpoints.map(bp => bp.lineNumber);
}
private createBreakpointDecorations(breakpoints: IBreakpoint[]): IModelDeltaDecoration[] {
return breakpoints.map((breakpoint) => {
const range = breakpoint.column ? new Range(breakpoint.lineNumber, breakpoint.column, breakpoint.lineNumber, breakpoint.column + 1)
: new Range(breakpoint.lineNumber, 1, breakpoint.lineNumber, Constants.MAX_SAFE_SMALL_INTEGER); // Decoration has to have a width #20688
return {
options: this.getBreakpointDecorationOptions(breakpoint),
range
};
});
}
private getBreakpointDecorationOptions(breakpoint: IBreakpoint): IModelDecorationOptions {
const activated = this.debugService.getModel().areBreakpointsActivated();
const state = this.debugService.state;
const debugActive = state === State.Running || state === State.Stopped || state === State.Initializing;
const modelData = this.modelDataMap.get(breakpoint.uri.toString());
let result = (!breakpoint.enabled || !activated) ? DebugEditorModelManager.BREAKPOINT_DISABLED_DECORATION :
debugActive && modelData && modelData.dirty && !breakpoint.verified ? DebugEditorModelManager.BREAKPOINT_DIRTY_DECORATION :
debugActive && !breakpoint.verified ? DebugEditorModelManager.BREAKPOINT_UNVERIFIED_DECORATION :
!breakpoint.condition && !breakpoint.hitCondition ? DebugEditorModelManager.BREAKPOINT_DECORATION : null;
if (result) {
result = objects.clone(result);
if (breakpoint.message) {
result.glyphMarginHoverMessage = new MarkdownString().appendText(breakpoint.message);
}
if (breakpoint.column) {
result.beforeContentClassName = `debug-breakpoint-column ${result.glyphMarginClassName}-column`;
}
return result;
}
const process = this.debugService.getViewModel().focusedProcess;
if (process && !process.session.capabilities.supportsConditionalBreakpoints) {
return DebugEditorModelManager.BREAKPOINT_UNSUPPORTED_DECORATION;
}
const modeId = modelData ? modelData.model.getLanguageIdentifier().language : '';
let condition: string;
if (breakpoint.condition && breakpoint.hitCondition) {
condition = `Expression: ${breakpoint.condition}\nHitCount: ${breakpoint.hitCondition}`;
} else {
condition = breakpoint.condition ? breakpoint.condition : breakpoint.hitCondition;
}
const glyphMarginHoverMessage = new MarkdownString().appendCodeblock(modeId, condition);
const glyphMarginClassName = 'debug-breakpoint-conditional-glyph';
const beforeContentClassName = breakpoint.column ? `debug-breakpoint-column ${glyphMarginClassName}-column` : undefined;
return {
glyphMarginClassName,
glyphMarginHoverMessage,
stickiness,
beforeContentClassName
};
}
// editor decorations
private static BREAKPOINT_DECORATION: IModelDecorationOptions = {
glyphMarginClassName: 'debug-breakpoint-glyph',
stickiness
};
private static BREAKPOINT_DISABLED_DECORATION: IModelDecorationOptions = {
glyphMarginClassName: 'debug-breakpoint-disabled-glyph',
glyphMarginHoverMessage: new MarkdownString().appendText(nls.localize('breakpointDisabledHover', "Disabled Breakpoint")),
stickiness
};
private static BREAKPOINT_UNVERIFIED_DECORATION: IModelDecorationOptions = {
glyphMarginClassName: 'debug-breakpoint-unverified-glyph',
glyphMarginHoverMessage: new MarkdownString().appendText(nls.localize('breakpointUnverifieddHover', "Unverified Breakpoint")),
stickiness
};
private static BREAKPOINT_DIRTY_DECORATION: IModelDecorationOptions = {
glyphMarginClassName: 'debug-breakpoint-unverified-glyph',
glyphMarginHoverMessage: new MarkdownString().appendText(nls.localize('breakpointDirtydHover', "Unverified breakpoint. File is modified, please restart debug session.")),
stickiness
};
private static BREAKPOINT_UNSUPPORTED_DECORATION: IModelDecorationOptions = {
glyphMarginClassName: 'debug-breakpoint-unsupported-glyph',
glyphMarginHoverMessage: new MarkdownString().appendText(nls.localize('breakpointUnsupported', "Conditional breakpoints not supported by this debug type")),
stickiness
};
// we need a separate decoration for glyph margin, since we do not want it on each line of a multi line statement.
private static TOP_STACK_FRAME_MARGIN: IModelDecorationOptions = {
glyphMarginClassName: 'debug-top-stack-frame-glyph',
stickiness
};
private static FOCUSED_STACK_FRAME_MARGIN: IModelDecorationOptions = {
glyphMarginClassName: 'debug-focused-stack-frame-glyph',
stickiness
};
private static TOP_STACK_FRAME_DECORATION: IModelDecorationOptions = {
isWholeLine: true,
inlineClassName: 'debug-remove-token-colors',
className: 'debug-top-stack-frame-line',
stickiness
};
private static TOP_STACK_FRAME_EXCEPTION_DECORATION: IModelDecorationOptions = {
isWholeLine: true,
inlineClassName: 'debug-remove-token-colors',
className: 'debug-top-stack-frame-exception-line',
stickiness
};
private static TOP_STACK_FRAME_INLINE_DECORATION: IModelDecorationOptions = {
beforeContentClassName: 'debug-top-stack-frame-column'
};
private static FOCUSED_STACK_FRAME_DECORATION: IModelDecorationOptions = {
isWholeLine: true,
inlineClassName: 'debug-remove-token-colors',
className: 'debug-focused-stack-frame-line',
stickiness
};
}

View File

@@ -0,0 +1,80 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import nls = require('vs/nls');
import Filters = require('vs/base/common/filters');
import { TPromise } from 'vs/base/common/winjs.base';
import Quickopen = require('vs/workbench/browser/quickopen');
import QuickOpen = require('vs/base/parts/quickopen/common/quickOpen');
import Model = require('vs/base/parts/quickopen/browser/quickOpenModel');
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
import { IDebugService, ILaunch } from 'vs/workbench/parts/debug/common/debug';
import * as errors from 'vs/base/common/errors';
class DebugEntry extends Model.QuickOpenEntry {
constructor(private debugService: IDebugService, private launch: ILaunch, private configurationName: string, highlights: Model.IHighlight[] = []) {
super(highlights);
}
public getLabel(): string {
return this.debugService.getConfigurationManager().getLaunches().length <= 1 ? this.configurationName : `${this.configurationName} (${this.launch.name})`;
}
public getAriaLabel(): string {
return nls.localize('entryAriaLabel', "{0}, debug", this.getLabel());
}
public run(mode: QuickOpen.Mode, context: Model.IContext): boolean {
if (mode === QuickOpen.Mode.PREVIEW) {
return false;
}
// Run selected debug configuration
this.debugService.getConfigurationManager().selectConfiguration(this.launch, this.configurationName);
this.debugService.startDebugging(this.launch.workspaceUri).done(undefined, errors.onUnexpectedError);
return true;
}
}
export class DebugQuickOpenHandler extends Quickopen.QuickOpenHandler {
constructor(
@IQuickOpenService private quickOpenService: IQuickOpenService,
@IDebugService private debugService: IDebugService
) {
super();
}
public getAriaLabel(): string {
return nls.localize('debugAriaLabel', "Type a name of a launch configuration to run.");
}
public getResults(input: string): TPromise<Model.QuickOpenModel> {
const configurations: DebugEntry[] = [];
for (let launch of this.debugService.getConfigurationManager().getLaunches()) {
launch.getConfigurationNames().map(config => ({ config: config, highlights: Filters.matchesContiguousSubString(input, config) }))
.filter(({ highlights }) => !!highlights)
.forEach(({ config, highlights }) => configurations.push(new DebugEntry(this.debugService, launch, config, highlights)));
}
return TPromise.as(new Model.QuickOpenModel(configurations));
}
public getAutoFocus(input: string): QuickOpen.IAutoFocus {
return {
autoFocusFirstEntry: !!input
};
}
public getEmptyLabel(searchString: string): string {
if (searchString.length > 0) {
return nls.localize('noConfigurationsMatching', "No debug configurations matching");
}
return nls.localize('noConfigurationsFound', "No debug configurations found. Please create a 'launch.json' file.");
}
}

View File

@@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./media/debugViewlet';
import { Builder } from 'vs/base/browser/builder';
import * as DOM from 'vs/base/browser/dom';
import { TPromise } from 'vs/base/common/winjs.base';
import { IAction } from 'vs/base/common/actions';
import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { PersistentViewsViewlet } from 'vs/workbench/parts/views/browser/views';
import { IDebugService, VIEWLET_ID, State } from 'vs/workbench/parts/debug/common/debug';
import { StartAction, ToggleReplAction, ConfigureAction } from 'vs/workbench/parts/debug/browser/debugActions';
import { StartDebugActionItem } from 'vs/workbench/parts/debug/browser/debugActionItems';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IExtensionService } from 'vs/platform/extensions/common/extensions';
import { IProgressService, IProgressRunner } from 'vs/platform/progress/common/progress';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { ViewLocation } from 'vs/workbench/parts/views/browser/viewsRegistry';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
export class DebugViewlet extends PersistentViewsViewlet {
private actions: IAction[];
private startDebugActionItem: StartDebugActionItem;
private progressRunner: IProgressRunner;
constructor(
@ITelemetryService telemetryService: ITelemetryService,
@IProgressService private progressService: IProgressService,
@IDebugService private debugService: IDebugService,
@IInstantiationService instantiationService: IInstantiationService,
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IStorageService storageService: IStorageService,
@IThemeService themeService: IThemeService,
@IContextKeyService contextKeyService: IContextKeyService,
@IContextMenuService contextMenuService: IContextMenuService,
@IExtensionService extensionService: IExtensionService
) {
super(VIEWLET_ID, ViewLocation.Debug, `${VIEWLET_ID}.state`, false, telemetryService, storageService, instantiationService, themeService, contextService, contextKeyService, contextMenuService, extensionService);
this.progressRunner = null;
this._register(this.debugService.onDidChangeState(state => this.onDebugServiceStateChange(state)));
}
public create(parent: Builder): TPromise<void> {
return super.create(parent).then(() => DOM.addClass(this.viewletContainer, 'debug-viewlet'));
}
public focus(): void {
super.focus();
if (!this.contextService.hasWorkspace()) {
this.views[0].focusBody();
}
if (this.startDebugActionItem) {
this.startDebugActionItem.focus();
}
}
public getActions(): IAction[] {
if (!this.actions) {
this.actions = [];
this.actions.push(this.instantiationService.createInstance(StartAction, StartAction.ID, StartAction.LABEL));
if (this.contextService.hasWorkspace()) {
this.actions.push(this.instantiationService.createInstance(ConfigureAction, ConfigureAction.ID, ConfigureAction.LABEL));
}
this.actions.push(this._register(this.instantiationService.createInstance(ToggleReplAction, ToggleReplAction.ID, ToggleReplAction.LABEL)));
}
return this.actions;
}
public getSecondaryActions(): IAction[] {
return [];
}
public getActionItem(action: IAction): IActionItem {
if (action.id === StartAction.ID && this.contextService.hasWorkspace()) {
this.startDebugActionItem = this.instantiationService.createInstance(StartDebugActionItem, null, action);
return this.startDebugActionItem;
}
return null;
}
private onDebugServiceStateChange(state: State): void {
if (this.progressRunner) {
this.progressRunner.done();
}
if (state === State.Initializing) {
this.progressRunner = this.progressService.show(true);
} else {
this.progressRunner = null;
}
}
}

View File

@@ -0,0 +1,102 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!../browser/media/exceptionWidget';
import * as nls from 'vs/nls';
import * as dom from 'vs/base/browser/dom';
import { ZoneWidget } from 'vs/editor/contrib/zoneWidget/browser/zoneWidget';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IDebugService, IExceptionInfo } from 'vs/workbench/parts/debug/common/debug';
import { RunOnceScheduler } from 'vs/base/common/async';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import { Color } from 'vs/base/common/color';
import { registerColor } from 'vs/platform/theme/common/colorRegistry';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { LinkDetector } from 'vs/workbench/parts/debug/browser/linkDetector';
const $ = dom.$;
// theming
export const debugExceptionWidgetBorder = registerColor('debugExceptionWidget.border', { dark: '#a31515', light: '#a31515', hc: '#a31515' }, nls.localize('debugExceptionWidgetBorder', 'Exception widget border color.'));
export const debugExceptionWidgetBackground = registerColor('debugExceptionWidget.background', { dark: '#a3151540', light: '#a315150d', hc: '#a3151573' }, nls.localize('debugExceptionWidgetBackground', 'Exception widget background color.'));
export class ExceptionWidget extends ZoneWidget {
private _backgroundColor: Color;
constructor(editor: ICodeEditor, private exceptionInfo: IExceptionInfo, private lineNumber: number,
@IContextViewService private contextViewService: IContextViewService,
@IDebugService private debugService: IDebugService,
@IThemeService themeService: IThemeService,
@IInstantiationService private instantiationService: IInstantiationService
) {
super(editor, { showFrame: true, showArrow: true, frameWidth: 1, className: 'exception-widget-container' });
this._backgroundColor = Color.white;
this._applyTheme(themeService.getTheme());
this._disposables.push(themeService.onThemeChange(this._applyTheme.bind(this)));
this.create();
const onDidLayoutChangeScheduler = new RunOnceScheduler(() => this._doLayout(undefined, undefined), 50);
this._disposables.push(this.editor.onDidLayoutChange(() => onDidLayoutChangeScheduler.schedule()));
this._disposables.push(onDidLayoutChangeScheduler);
}
private _applyTheme(theme: ITheme): void {
this._backgroundColor = theme.getColor(debugExceptionWidgetBackground);
let frameColor = theme.getColor(debugExceptionWidgetBorder);
this.style({
arrowColor: frameColor,
frameColor: frameColor
}); // style() will trigger _applyStyles
}
protected _applyStyles(): void {
if (this.container) {
this.container.style.backgroundColor = this._backgroundColor.toString();
}
super._applyStyles();
}
protected _fillContainer(container: HTMLElement): void {
this.setCssClass('exception-widget');
// Set the font size and line height to the one from the editor configuration.
const fontInfo = this.editor.getConfiguration().fontInfo;
this.container.style.fontSize = `${fontInfo.fontSize}px`;
this.container.style.lineHeight = `${fontInfo.lineHeight}px`;
let title = $('.title');
title.textContent = this.exceptionInfo.id ? nls.localize('exceptionThrownWithId', 'Exception has occurred: {0}', this.exceptionInfo.id) : nls.localize('exceptionThrown', 'Exception has occurred.');
dom.append(container, title);
if (this.exceptionInfo.description) {
let description = $('.description');
description.textContent = this.exceptionInfo.description;
dom.append(container, description);
}
if (this.exceptionInfo.details && this.exceptionInfo.details.stackTrace) {
let stackTrace = $('.stack-trace');
const linkDetector = this.instantiationService.createInstance(LinkDetector);
const linkedStackTrace = linkDetector.handleLinks(this.exceptionInfo.details.stackTrace);
typeof linkedStackTrace === 'string' ? stackTrace.textContent = linkedStackTrace : stackTrace.appendChild(linkedStackTrace);
dom.append(container, stackTrace);
}
}
protected _doLayout(heightInPixel: number, widthInPixel: number): void {
// Reload the height with respect to the exception text content and relayout it to match the line count.
this.container.style.height = 'initial';
const lineHeight = this.editor.getConfiguration().lineHeight;
const arrowHeight = Math.round(lineHeight / 3);
const computedLinesNumber = Math.ceil((this.container.offsetHeight + arrowHeight) / lineHeight);
this._relayout(computedLinesNumber);
}
}

View File

@@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import strings = require('vs/base/common/strings');
import uri from 'vs/base/common/uri';
import { isMacintosh } from 'vs/base/common/platform';
import * as errors from 'vs/base/common/errors';
import { IMouseEvent, StandardMouseEvent } from 'vs/base/browser/mouseEvent';
import * as nls from 'vs/nls';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
export class LinkDetector {
private static FILE_LOCATION_PATTERNS: RegExp[] = [
// group 0: full path with line and column
// group 1: full path without line and column, matched by `*.*` in the end to work only on paths with extensions in the end (s.t. node:10352 would not match)
// group 2: drive letter on windows with trailing backslash or leading slash on mac/linux
// group 3: line number, matched by (:(\d+))
// group 4: column number, matched by ((?::(\d+))?)
// eg: at Context.<anonymous> (c:\Users\someone\Desktop\mocha-runner\test\test.js:26:11)
/(?![\(])(?:file:\/\/)?((?:([a-zA-Z]+:)|[^\(\)<>\'\"\[\]:\s]+)(?:[\\/][^\(\)<>\'\"\[\]:]*)?\.[a-zA-Z]+[0-9]*):(\d+)(?::(\d+))?/g
];
constructor(
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@IWorkspaceContextService private contextService: IWorkspaceContextService
) {
// noop
}
/**
* Matches and handles relative and absolute file links in the string provided.
* Returns <span/> element that wraps the processed string, where matched links are replaced by <a/> and unmatched parts are surrounded by <span/> elements.
* 'onclick' event is attached to all anchored links that opens them in the editor.
* If no links were detected, returns the original string.
*/
public handleLinks(text: string): HTMLElement | string {
let linkContainer: HTMLElement;
for (let pattern of LinkDetector.FILE_LOCATION_PATTERNS) {
pattern.lastIndex = 0; // the holy grail of software development
let lastMatchIndex = 0;
let match = pattern.exec(text);
while (match !== null) {
let resource: uri = null;
try {
resource = (match && !strings.startsWith(match[0], 'http'))
&& (match[2] || strings.startsWith(match[1], '/') ? uri.file(match[1]) : this.contextService.toResource(match[1])); // TODO@Michel TODO@Isidor (https://github.com/Microsoft/vscode/issues/29190)
} catch (e) { }
if (!resource) {
match = pattern.exec(text);
continue;
}
if (!linkContainer) {
linkContainer = document.createElement('span');
}
let textBeforeLink = text.substring(lastMatchIndex, match.index);
if (textBeforeLink) {
let span = document.createElement('span');
span.textContent = textBeforeLink;
linkContainer.appendChild(span);
}
const link = document.createElement('a');
link.textContent = text.substr(match.index, match[0].length);
link.title = isMacintosh ? nls.localize('fileLinkMac', "Click to follow (Cmd + click opens to the side)") : nls.localize('fileLink', "Click to follow (Ctrl + click opens to the side)");
linkContainer.appendChild(link);
const line = Number(match[3]);
const column = match[4] ? Number(match[4]) : undefined;
link.onclick = (e) => this.onLinkClick(new StandardMouseEvent(e), resource, line, column);
lastMatchIndex = pattern.lastIndex;
const currentMatch = match;
match = pattern.exec(text);
// Append last string part if no more link matches
if (!match) {
let textAfterLink = text.substr(currentMatch.index + currentMatch[0].length);
if (textAfterLink) {
let span = document.createElement('span');
span.textContent = textAfterLink;
linkContainer.appendChild(span);
}
}
}
}
return linkContainer || text;
}
private onLinkClick(event: IMouseEvent, resource: uri, line: number, column: number = 0): void {
const selection = window.getSelection();
if (selection.type === 'Range') {
return; // do not navigate when user is selecting
}
event.preventDefault();
this.editorService.openEditor({
resource,
options: {
selection: {
startLineNumber: line,
startColumn: column
}
}
}, event.ctrlKey || event.metaKey).done(null, errors.onUnexpectedError);
}
}

View File

@@ -0,0 +1 @@
<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><title>Layer 1</title><rect height="11" width="3" y="3" x="7" fill="#fff"/><rect height="3" width="11" y="7" x="3" fill="#fff"/></svg>

After

Width:  |  Height:  |  Size: 197 B

View File

@@ -0,0 +1 @@
<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><title>Layer 1</title><rect height="11" width="3" y="3" x="7" fill="#C5C5C5"/><rect height="3" width="11" y="7" x="3" fill="#C5C5C5"/></svg>

After

Width:  |  Height:  |  Size: 203 B

View File

@@ -0,0 +1 @@
<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><title>Layer 1</title><rect height="11" width="3" y="3" x="7" fill="#424242"/><rect height="3" width="11" y="7" x="3" fill="#424242"/></svg>

After

Width:  |  Height:  |  Size: 203 B

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:#CC1100;}
</style>
<path class="st0" d="M8,3C5.2,3,3,5.2,3,8s2.2,5,5,5s5-2.2,5-5S10.8,3,8,3z M10.8,9.9H5.2V8.7h5.7V9.9z M10.8,7.3H5.2V6.1h5.7V7.3z"
/>
</svg>

After

Width:  |  Height:  |  Size: 539 B

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:#E51400;}
</style>
<path class="st0" d="M8,3C5.2,3,3,5.2,3,8s2.2,5,5,5s5-2.2,5-5S10.8,3,8,3z M10.8,9.9H5.2V8.7h5.7V9.9z M10.8,7.3H5.2V6.1h5.7V7.3z"
/>
</svg>

After

Width:  |  Height:  |  Size: 539 B

View File

@@ -0,0 +1 @@
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="#c10"><circle cx="8" cy="8" r="5"/></g></g></svg>

After

Width:  |  Height:  |  Size: 176 B

View File

@@ -0,0 +1 @@
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" fill-opacity="0.8"><g fill="#5A5A5A"><circle cx="8" cy="8" r="5"/></g></g></svg>

After

Width:  |  Height:  |  Size: 198 B

View File

@@ -0,0 +1 @@
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" fill-opacity="0.6"><g fill="#6C6C6C"><circle cx="8" cy="8" r="5"/></g></g></svg>

After

Width:  |  Height:  |  Size: 198 B

View File

@@ -0,0 +1 @@
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" fill-opacity="0.4"><g fill="#E51400"><circle cx="8" cy="8" r="5"/></g></g></svg>

After

Width:  |  Height:  |  Size: 198 B

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:#CC1100;}
.st1{fill:#FFFFFF;}
</style>
<g>
<g>
<circle class="st0" cx="8" cy="8" r="5"/>
</g>
</g>
<g>
<rect x="7.3" y="10.2" class="st1" width="1.5" height="1.5"/>
<rect x="7.3" y="4.4" class="st1" width="1.5" height="4.4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 530 B

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:#E51400;}
.st1{fill:#FFFFFF;}
</style>
<g>
<g>
<circle class="st0" cx="8" cy="8" r="5"/>
</g>
</g>
<g>
<rect x="7.3" y="10.2" class="st1" width="1.5" height="1.5"/>
<rect x="7.3" y="4.4" class="st1" width="1.5" height="4.4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 530 B

View File

@@ -0,0 +1 @@
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g stroke="#5A5A5A" stroke-width="3" stroke-opacity="0.8"><circle cx="8" cy="8" r="4"/></g></g></svg>

After

Width:  |  Height:  |  Size: 219 B

View File

@@ -0,0 +1 @@
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g stroke="#6C6C6C" stroke-width="3" stroke-opacity="0.6"><circle cx="8" cy="8" r="4"/></g></g></svg>

After

Width:  |  Height:  |  Size: 219 B

View File

@@ -0,0 +1 @@
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="#E51400"><circle cx="8" cy="8" r="5"/></g></g></svg>

After

Width:  |  Height:  |  Size: 179 B

View File

@@ -0,0 +1,41 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .zone-widget .zone-widget-container.breakpoint-widget {
height: 30px !important;
display: flex;
border-color: #007ACC;
}
.monaco-editor .zone-widget .zone-widget-container.breakpoint-widget .breakpoint-select-container {
display: flex;
justify-content: center;
flex-direction: column;
padding: 0 10px;
}
.monaco-editor .zone-widget .zone-widget-container.breakpoint-widget .inputBoxContainer {
flex: 1;
}
.monaco-editor .zone-widget .zone-widget-container.breakpoint-widget .monaco-inputbox {
border: none;
}
.monaco-editor .breakpoint-widget .input {
font-family: Monaco, Menlo, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";
line-height: 22px;
background-color: transparent;
padding: 8px;
}
.monaco-workbench.mac .monaco-editor .breakpoint-widget .input {
font-size: 11px;
}
.monaco-workbench.windows .monaco-editor .breakpoint-widget .input,
.monaco-workbench.linux .monaco-editor .breakpoint-widget .input {
font-size: 13px;
}

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path fill="#1E1E1E" d="M16 5.5c0-3-2.5-5.5-5.5-5.5C7.6 0 5.3 2.2 5 5c-2.8.2-5 2.6-5 5.5 0 3 2.5 5.5 5.5 5.5 2.9 0 5.2-2.2 5.5-5 2.8-.3 5-2.6 5-5.5z"/><g fill="#C5C5C5"><path d="M10.5 1C8.2 1 6.3 2.8 6 5c.3 0 .7.1 1 .2C7.2 3.4 8.7 2 10.5 2 12.4 2 14 3.6 14 5.5c0 1.8-1.4 3.3-3.2 3.5.1.3.2.6.2 1 2.3-.2 4-2.1 4-4.5C15 3 13 1 10.5 1z"/><circle cx="5.5" cy="10.5" r="4.5"/></g></svg>

After

Width:  |  Height:  |  Size: 497 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path fill="#F6F6F6" d="M16 5.5c0-3-2.5-5.5-5.5-5.5C7.6 0 5.3 2.2 5 5c-2.8.2-5 2.6-5 5.5 0 3 2.5 5.5 5.5 5.5 2.9 0 5.2-2.2 5.5-5 2.8-.3 5-2.6 5-5.5z"/><g fill="#424242"><path d="M10.5 1C8.2 1 6.3 2.8 6 5c.3 0 .7.1 1 .2C7.2 3.4 8.7 2 10.5 2 12.4 2 14 3.6 14 5.5c0 1.8-1.4 3.3-3.2 3.5.1.3.2.6.2 1 2.3-.2 4-2.1 4-4.5C15 3 13 1 10.5 1z"/><circle cx="5.5" cy="10.5" r="4.5"/></g></svg>

After

Width:  |  Height:  |  Size: 497 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#1E1E1E" d="M4.222 0h-2.222v.479c-.526.648-.557 1.57-.043 2.269l.043.059v3.203l-.4.296-.053.053c-.353.352-.547.822-.547 1.321s.194.967.549 1.32c.134.134.288.236.451.322v6.678h14v-16h-11.778z"/><path fill="#E8E8E8" d="M10.798 7l-1.83-2h6.032v2h-4.202zm-2.292-6h-3.207l1.337 1.52 1.87-1.52zm-5.506 8.531v1.469h12v-2h-10.813l-.024.021c-.3.299-.716.479-1.163.51zm0 5.469h12v-2h-12v2zm3.323-8h.631l-.347-.266-.284.266zm8.677-4v-2h-3.289l-1.743 2h5.032z"/><path fill="#F48771" d="M7.246 4.6l2.856-3.277-.405-.002-3.176 2.581-2.607-2.962c-.336-.221-.786-.2-1.082.096-.308.306-.319.779-.069 1.12l2.83 2.444-3.339 2.466c-.339.338-.339.887 0 1.225.339.337.888.337 1.226 0l3.063-2.867 3.33 2.555h.466l-3.093-3.379z"/></svg>

After

Width:  |  Height:  |  Size: 787 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#fff" d="M4.222 0h-2.222v.479c-.526.648-.557 1.57-.043 2.269l.043.059v3.203l-.4.296-.053.053c-.353.352-.547.822-.547 1.321s.194.967.549 1.32c.134.134.288.236.451.322v6.678h14v-16h-11.778z"/><path fill="#424242" d="M10.798 7l-1.83-2h6.032v2h-4.202zm-2.292-6h-3.207l1.337 1.52 1.87-1.52zm-5.506 8.531v1.469h12v-2h-10.813l-.024.021c-.3.299-.716.479-1.163.51zm0 5.469h12v-2h-12v2zm3.323-8h.631l-.347-.266-.284.266zm8.677-4v-2h-3.289l-1.743 2h5.032z"/><path fill="#A1260D" d="M7.246 4.6l2.856-3.277-.405-.002-3.176 2.581-2.607-2.962c-.336-.221-.786-.2-1.082.096-.308.306-.319.779-.069 1.12l2.83 2.444-3.339 2.466c-.339.338-.339.887 0 1.225.339.337.888.337 1.226 0l3.063-2.867 3.33 2.555h.466l-3.093-3.379z"/></svg>

After

Width:  |  Height:  |  Size: 784 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><g fill="#C5C5C5"><path d="M12.714 9.603c-.07.207-.15.407-.246.601l1.017 2.139c-.335.424-.718.807-1.142 1.143l-2.14-1.018c-.193.097-.394.176-.601.247l-.795 2.235c-.265.03-.534.05-.807.05-.272 0-.541-.02-.806-.05l-.795-2.235c-.207-.071-.408-.15-.602-.247l-2.14 1.017c-.424-.336-.807-.719-1.143-1.143l1.017-2.139c-.094-.193-.175-.393-.245-.6l-2.236-.796c-.03-.265-.05-.534-.05-.807s.02-.542.05-.807l2.236-.795c.07-.207.15-.407.246-.601l-1.016-2.139c.336-.423.719-.807 1.143-1.142l2.14 1.017c.193-.096.394-.176.602-.247l.793-2.236c.265-.03.534-.05.806-.05.273 0 .542.02.808.05l.795 2.236c.207.07.407.15.601.246l2.14-1.017c.424.335.807.719 1.142 1.142l-1.017 2.139c.096.194.176.394.246.601l2.236.795c.029.266.049.535.049.808s-.02.542-.05.807l-2.236.796zm-4.714-4.603c-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3-1.343-3-3-3z"/><circle cx="8" cy="8" r="1.5"/></g></svg>

After

Width:  |  Height:  |  Size: 927 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><g fill="#424242"><path d="M12.714 9.603c-.07.207-.15.407-.246.601l1.017 2.139c-.335.424-.718.807-1.142 1.143l-2.14-1.018c-.193.097-.394.176-.601.247l-.795 2.235c-.265.03-.534.05-.807.05-.272 0-.541-.02-.806-.05l-.795-2.235c-.207-.071-.408-.15-.602-.247l-2.14 1.017c-.424-.336-.807-.719-1.143-1.143l1.017-2.139c-.094-.193-.175-.393-.245-.6l-2.236-.796c-.03-.265-.05-.534-.05-.807s.02-.542.05-.807l2.236-.795c.07-.207.15-.407.246-.601l-1.016-2.139c.336-.423.719-.807 1.143-1.142l2.14 1.017c.193-.096.394-.176.602-.247l.793-2.236c.265-.03.534-.05.806-.05.273 0 .542.02.808.05l.795 2.236c.207.07.407.15.601.246l2.14-1.017c.424.335.807.719 1.142 1.142l-1.017 2.139c.096.194.176.394.246.601l2.236.795c.029.266.049.535.049.808s-.02.542-.05.807l-2.236.796zm-4.714-4.603c-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3-1.343-3-3-3z"/><circle cx="8" cy="8" r="1.5"/></g></svg>

After

Width:  |  Height:  |  Size: 927 B

View File

@@ -0,0 +1,3 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="-3 0 16 16" enable-background="new -3 0 16 16"><path fill="#89D185" d="M1 2v12l8-6-8-6z"/></svg>

After

Width:  |  Height:  |  Size: 323 B

View File

@@ -0,0 +1,3 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="-3 0 16 16" enable-background="new -3 0 16 16"><path fill="#388A34" d="M1 2v12l8-6-8-6z"/></svg>

After

Width:  |  Height:  |  Size: 323 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-red{fill:#e51400}.icon-vs-yellow{fill:#fc0}.icon-vs-bg{fill:#424242}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-bg" d="M14.414 8l-5 6H3V2h6.414l5 6z" id="outline" style="display: none;"/><path class="icon-vs-yellow" d="M13 8l-4 5H4V3h5l4 5z" id="iconBg"/><g id="iconFg"><path class="icon-vs-red" d="M10.5 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/></g></svg>

After

Width:  |  Height:  |  Size: 530 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-bg{fill:#424242}.icon-vs-yellow{fill:#fc0}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-bg" d="M14.414 8l-5 6H3V2h6.414l5 6z" id="outline" style="display: none;"/><g id="iconBg"><path class="icon-vs-yellow" d="M13 8l-4 5H4V3h5l4 5z"/></g></svg>

After

Width:  |  Height:  |  Size: 424 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path d="M17 19.488v4.248c0 .462.09 1.264-.373 1.264H15v-1h1v-3.19l-.173-.18c-1.453 1.205-3.528 1.248-4.67.108C10 19.578 10.118 18 11.376 16H8v1H7v-1.627C7 14.91 7.802 15 8.264 15h4.105L17 19.488zM14 9h-1V8h1.955c.46 0 1.045.22 1.045.682v3.345l.736.875c.18-.973.89-1.71 1.914-1.71.143 0 .35.014.35.04V9h1v2.618c0 .117.265.382.382.382H23v1h-2.233c.027 0 .042.154.042.298 0 1.025-.74 1.753-1.712 1.932l.875.77H23.318c.462 0 .682.583.682 1.045V19h-1v-1h-2.52L14 11.698V9zM16 4C9.373 4 4 9.373 4 16s5.373 12 12 12 12-5.373 12-12S22.627 4 16 4zm10 12c0 2.397-.85 4.6-2.262 6.324L9.676 8.262C11.4 6.85 13.602 6 16 6c5.514 0 10 4.486 10 10zM6 16c0-2.398.85-4.6 2.262-6.324L22.324 23.74C20.6 25.15 18.397 26 16 26c-5.514 0-10-4.486-10-10z" fill="#fff"/></svg>

After

Width:  |  Height:  |  Size: 834 B

View File

@@ -0,0 +1,263 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/* Activity Bar */
.monaco-workbench > .activitybar .monaco-action-bar .action-label.debug {
-webkit-mask: url('debug-dark.svg') no-repeat 50% 50%;
}
.monaco-editor .debug-top-stack-frame-line,
.monaco-editor .debug-top-stack-frame-exception-line {
background: rgba(255, 255, 102, 0.45);
}
.monaco-editor .debug-top-stack-frame-range {
background: #ffeca0;
}
.monaco-editor .debug-top-stack-frame-column::before {
background: url('current-arrow.svg') center center no-repeat;
}
.monaco-editor .debug-focused-stack-frame-line {
background: rgba(206, 231, 206, 0.45);
}
.monaco-editor .debug-focused-stack-frame-range {
background: rgba(206, 231, 206, 1);
}
.monaco-editor .debug-breakpoint-hint-glyph {
background: url('breakpoint-hint.svg') center center no-repeat;
}
.monaco-editor .debug-breakpoint-disabled-glyph,
.monaco-editor .debug-breakpoint-column.debug-breakpoint-disabled-glyph-column::before {
background: url('breakpoint-disabled.svg') center center no-repeat;
}
.monaco-editor .debug-breakpoint-unverified-glyph,
.monaco-editor .debug-breakpoint-column.debug-breakpoint-unverified-glyph-column::before {
background: url('breakpoint-unverified.svg') center center no-repeat;
}
.monaco-editor .debug-top-stack-frame-glyph {
background: url('current-arrow.svg') center center no-repeat;
}
.monaco-editor .debug-focused-stack-frame-glyph {
background: url('stackframe-arrow.svg') center center no-repeat;
}
.monaco-editor .debug-breakpoint-glyph,
.monaco-editor .debug-breakpoint-column.debug-breakpoint-glyph-column::before {
background: url('breakpoint.svg') center center no-repeat;
}
.monaco-editor .debug-breakpoint-column::before,
.monaco-editor .debug-top-stack-frame-column::before {
content: " ";
width: 0.9em;
height: 0.8em;
display: inline-block;
margin-right: 2px;
margin-left: 2px;
background-size: 110% !important;
background-position: initial !important;
}
.monaco-editor .debug-breakpoint-conditional-glyph,
.monaco-editor .debug-breakpoint-column.debug-breakpoint-conditional-glyph-column::before {
background: url('breakpoint-conditional.svg') center center no-repeat;
}
.monaco-editor .debug-breakpoint-unsupported-glyph,
.monaco-editor .debug-breakpoint-column.debug-breakpoint-unsupported-glyph-column::before {
background: url('breakpoint-unsupported.svg') center center no-repeat;
}
.monaco-editor .debug-top-stack-frame-glyph.debug-breakpoint-glyph,
.monaco-editor .debug-top-stack-frame-glyph.debug-breakpoint-conditional-glyph,
.monaco-editor .debug-breakpoint-column.debug-breakpoint-glyph-column.debug-top-stack-frame-column::before,
.monaco-editor.vs-dark .debug-top-stack-frame-glyph.debug-breakpoint-glyph,
.monaco-editor.vs-dark .debug-top-stack-frame-glyph.debug-breakpoint-conditional-glyph,
.monaco-editor.vs-dark .debug-breakpoint-column.debug-breakpoint-glyph-column.debug-top-stack-frame-column::before {
background: url('current-and-breakpoint.svg') center center no-repeat;
}
.monaco-editor .debug-focused-stack-frame-glyph.debug-breakpoint-glyph,
.monaco-editor .debug-focused-stack-frame-glyph.debug-breakpoint-conditional-glyph {
background: url('stackframe-and-breakpoint.svg') center center no-repeat;
}
/* Error editor */
.debug-error-editor:focus {
outline: none !important;
}
.debug-error-editor {
padding: 5px 0 0 10px;
box-sizing: border-box;
}
/* Expressions */
.monaco-workbench .monaco-tree-row .expression {
overflow: hidden;
text-overflow: ellipsis;
font-family: Monaco, Menlo, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";
}
.monaco-workbench.mac .monaco-tree-row .expression {
font-size: 11px;
}
.monaco-workbench.windows .monaco-tree-row .expression,
.monaco-workbench.linux .monaco-tree-row .expression {
font-size: 13px;
}
.monaco-workbench .monaco-tree-row .expression .value {
margin-left: 6px;
}
.monaco-workbench .monaco-tree-row:not(.selected) .expression .name {
color: #9B46B0;
}
.monaco-workbench > .monaco-tree-row:not(.selected) .expression .value {
color: rgba(108, 108, 108, 0.8);
}
.monaco-workbench .monaco-tree-row .expression .unavailable {
font-style: italic;
}
.monaco-workbench .monaco-tree-row:not(.selected) .expression .error {
color: #E51400;
}
.monaco-workbench .monaco-tree-row:not(.selected) .expression .value.number {
color: #09885A;
}
.monaco-workbench .monaco-tree-row:not(.selected) .expression .value.boolean {
color: #0000FF;
}
.monaco-workbench .monaco-tree-row:not(.selected) .expression .value.string {
color: #A31515;
}
.vs-dark .monaco-workbench > .monaco-tree-row:not(.selected) .expression .value {
color: rgba(204, 204, 204, 0.6);
}
.vs-dark .monaco-workbench .monaco-tree-row:not(.selected) .expression .error {
color: #F48771;
}
.vs-dark .monaco-workbench .monaco-tree-row:not(.selected) .expression .value.number {
color: #B5CEA8;
}
.hc-black .monaco-workbench .monaco-tree-row:not(.selected) .expression .value.number {
color: #89d185;
}
.hc-black .monaco-workbench .monaco-tree-row:not(.selected) .expression .value.boolean {
color: #75bdfe;
}
.hc-black .monaco-workbench .monaco-tree-row:not(.selected) .expression .value.string {
color: #f48771;
}
.vs-dark .monaco-workbench .monaco-tree-row:not(.selected) .expression .value.boolean {
color: #4E94CE;
}
.vs-dark .monaco-workbench .monaco-tree-row:not(.selected) .expression .value.string {
color: #CE9178;
}
.hc-black .monaco-workbench .monaco-tree-row:not(.selected) .expression .error {
color: #F48771;
}
/* Dark theme */
.vs-dark .monaco-workbench .monaco-tree-row:not(.selected) .expression .name {
color: #C586C0;
}
.monaco-editor.vs-dark .debug-focused-stack-frame-line {
background: rgba(122, 189, 122, 0.3);
}
.monaco-editor.vs-dark .debug-focused-stack-frame-range {
background: rgba(122, 189, 122, 0.5);
}
.monaco-editor.vs-dark .debug-top-stack-frame-line,
.monaco-editor.vs-dark .debug-top-stack-frame-exception-line {
background-color: rgba(255, 255, 0, 0.2)
}
.monaco-editor.vs-dark .debug-top-stack-frame-range {
background-color: rgba(255, 255, 0, 0.3)
}
.monaco-editor.vs-dark .debug-breakpoint-glyph,
.monaco-editor.vs-dark .debug-breakpoint-column.debug-breakpoint-glyph-column::before {
background: url('breakpoint-dark.svg') center center no-repeat;
}
.monaco-editor.vs-dark .debug-breakpoint-conditional-glyph,
.monaco-editor.vs-dark .debug-breakpoint-column.debug-breakpoint-conditional-glyph-column::before {
background: url('breakpoint-conditional-dark.svg') center center no-repeat;
}
.monaco-editor.vs-dark .debug-breakpoint-unsupported-glyph,
.monaco-editor.vs-dark .debug-breakpoint-column.debug-breakpoint-unsupported-glyph-column::before {
background: url('breakpoint-unsupported-dark.svg') center center no-repeat;
}
.monaco-editor.vs-dark .debug-breakpoint-disabled-glyph,
.monaco-editor.vs-dark .debug-breakpoint-column.debug-breakpoint-disabled-glyph-column::before {
background: url('breakpoint-disabled-dark.svg') center center no-repeat;
}
.monaco-editor.vs-dark .debug-breakpoint-unverified-glyph,
.monaco-editor.vs-dark .debug-breakpoint-column.debug-breakpoint-unverified-glyph-column::before {
background: url('breakpoint-unverified-dark.svg') center center no-repeat;
}
.monaco-editor.vs-dark .debug-focused-stack-frame-glyph {
background: url('stackframe-arrow-dark.svg') center center no-repeat;
}
.monaco-editor.vs-dark .debug-focused-stack-frame-glyph.debug-breakpoint-glyph,
.monaco-editor.vs-dark .debug-focused-stack-frame-glyph.debug-breakpoint-conditional-glyph {
background: url('stackframe-and-breakpoint-dark.svg') center center no-repeat;
}
/* High Contrast Theming */
.monaco-editor.hc-black .debug-focused-stack-frame-line {
background: rgba(206, 231, 206, 1);
}
.hc-black .monaco-workbench .monaco-tree-row:not(.selected) .expression .name {
color: inherit;
}
.hc-black .monaco-editor .debug-top-stack-frame-line {
background: rgba(255, 246, 0, 1);
}
.hc-black .monaco-editor .debug-remove-token-colors {
color:black;
}

View File

@@ -0,0 +1,129 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/* Debug actions widget */
.monaco-workbench .debug-actions-widget {
position: absolute;
z-index: 200;
height: 32px;
display: flex;
padding-left: 7px;
}
.monaco-workbench .debug-actions-widget .monaco-action-bar .action-item.select-container {
margin-right: 7px;
}
.monaco-workbench .debug-actions-widget .monaco-action-bar .action-item .select-box {
margin-top: 6px;
}
.monaco-workbench .debug-actions-widget .drag-area {
cursor: -webkit-grab;
height: 32px;
width: 10px;
background: url('drag.svg') center center no-repeat;
}
.monaco-workbench .debug-actions-widget .drag-area.dragged {
cursor: -webkit-grabbing;
}
.monaco-workbench .debug-actions-widget .monaco-action-bar .action-item > .action-label {
width: 32px;
height: 32px;
margin-right: 0;
background-size: 16px;
background-position: center center;
background-repeat: no-repeat;
}
/* Debug actionbar actions */
.monaco-workbench .debug-actions-widget .debug-action.step-over,
.monaco-workbench .debug-actions-widget .debug-action.step-back {
background-image: url('step-over.svg');
}
.monaco-workbench .debug-actions-widget .debug-action.step-into {
background-image: url('step-into.svg');
}
.monaco-workbench .debug-actions-widget .debug-action.step-out {
background-image: url('step-out.svg');
}
.monaco-workbench .debug-actions-widget .debug-action.step-back,
.monaco-workbench .debug-actions-widget .debug-action.reverse-continue {
transform: scaleX(-1);
}
.monaco-workbench .debug-actions-widget .debug-action.continue,
.monaco-workbench .debug-actions-widget .debug-action.reverse-continue {
background-image: url('continue.svg');
}
.monaco-workbench .debug-actions-widget .debug-action.restart {
background-image: url('restart.svg');
}
.monaco-workbench .debug-actions-widget .debug-action.pause {
background-image: url('pause.svg');
}
.monaco-workbench .debug-actions-widget .debug-action.stop {
background-image: url('stop.svg');
}
.monaco-workbench .debug-actions-widget .debug-action.disconnect {
background-image: url('disconnect.svg');
}
/* Dark and hc theme actions */
.vs-dark .monaco-workbench .debug-actions-widget .debug-action.step-over,
.vs-dark .monaco-workbench .debug-actions-widget .debug-action.step-back,
.hc-black .monaco-workbench .debug-actions-widget .debug-action.step-over,
.hc-black .monaco-workbench .debug-actions-widget .debug-action.step-back {
background-image: url('step-over-inverse.svg');
}
.vs-dark .monaco-workbench .debug-actions-widget .debug-action.step-into,
.hc-black .monaco-workbench .debug-actions-widget .debug-action.step-into {
background-image: url('step-into-inverse.svg');
}
.vs-dark .monaco-workbench .debug-actions-widget .debug-action.step-out,
.hc-black .monaco-workbench .debug-actions-widget .debug-action.step-out {
background-image: url('step-out-inverse.svg');
}
.vs-dark .monaco-workbench .debug-actions-widget .debug-action.continue,
.vs-dark .monaco-workbench .debug-actions-widget .debug-action.reverse-continue,
.hc-black .monaco-workbench .debug-actions-widget .debug-action.continue,
.hc-black .monaco-workbench .debug-actions-widget .debug-action.reverse-continue {
background-image: url('continue-inverse.svg');
}
.vs-dark .monaco-workbench .debug-actions-widget .debug-action.restart,
.hc-black .monaco-workbench .debug-actions-widget .debug-action.restart {
background-image: url('restart-inverse.svg');
}
.vs-dark .monaco-workbench .debug-actions-widget .debug-action.pause,
.hc-black .monaco-workbench .debug-actions-widget .debug-action.pause {
background-image: url('pause-inverse.svg');
}
.vs-dark .monaco-workbench .debug-actions-widget .debug-action.stop,
.hc-black .monaco-workbench .debug-actions-widget .debug-action.stop {
background-image: url('stop-inverse.svg');
}
.vs-dark .monaco-workbench .debug-actions-widget .debug-action.disconnect,
.hc-black .monaco-workbench .debug-actions-widget .debug-action.disconnect {
background-image: url('disconnect-inverse.svg');
}

View File

@@ -0,0 +1,117 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .debug-hover-widget {
position: absolute;
margin-top: -1px;
cursor: default;
z-index: 50;
animation-duration: 0.15s;
animation-name: fadeIn;
-webkit-user-select: text;
word-break: break-all;
padding: 4px 5px;
}
.monaco-editor .debug-hover-widget .complex-value {
width: 324px;
}
.monaco-editor .debug-hover-widget .complex-value .title {
padding-left: 15px;
padding-right: 2px;
font-size: 11px;
word-break: normal;
text-overflow: ellipsis;
height: 18px;
overflow: hidden;
border-bottom: 1px solid rgba(128, 128, 128, 0.35);
}
.monaco-editor .debug-hover-widget .debug-hover-tree {
line-height: 18px;
}
.monaco-editor .debug-hover-widget .debug-hover-tree .monaco-tree .monaco-tree-row > .content {
-webkit-user-select: text;
white-space: pre;
}
/* Disable tree highlight in debug hover tree. */
.monaco-editor .debug-hover-widget .debug-hover-tree .monaco-tree .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) {
background-color: inherit;
}
.monaco-editor .debug-hover-widget .debug-hover-tree .monaco-tree .monaco-tree-rows > .monaco-tree-row {
cursor: default;
}
.monaco-editor .debug-hover-widget .debug-hover-tree .monaco-tree .monaco-tree-rows > .monaco-tree-row.has-children {
cursor: pointer;
}
.monaco-editor .debug-hover-widget pre {
margin-top: 0;
margin-bottom: 0;
}
.monaco-editor .debugHoverHighlight {
background-color: rgba(173, 214, 255, 0.15);
}
.monaco-editor .debug-hover-widget .value {
white-space: pre-wrap;
color: rgba(108, 108, 108, 0.8);
overflow: auto;
max-height: 500px;
}
.monaco-editor .debug-hover-widget .error {
color: #E51400;
}
.monaco-editor .debug-hover-widget .value.number {
color: #09885A;
}
.monaco-editor .debug-hover-widget .value.boolean {
color: #0000FF;
}
.monaco-editor .debug-hover-widget .value.string {
color: #A31515;
}
/* Dark theme */
.monaco-editor.vs-dark .debug-hover-widget .value,
.monaco-editor.hc-black .debug-hover-widget .value {
color: rgba(204, 204, 204, 0.6);
}
.monaco-editor.vs-dark .debug-hover-widget .error,
.monaco-editor.hc-black .debug-hover-widget .error {
color: #F48771;
}
.monaco-editor.vs-dark .debug-hover-widget .value.number,
.monaco-editor.hc-black .debug-hover-widget .value.number {
color: #B5CEA8;
}
.monaco-editor.vs-dark .debug-hover-widget .value.boolean,
.monaco-editor.hc-black .debug-hover-widget .value.boolean {
color: #4E94CE;
}
.monaco-editor.vs-dark .debug-hover-widget .value.string,
.monaco-editor.hc-black .debug-hover-widget .value.string {
color: #CE9178;
}
.monaco-editor.vs-dark .debugHoverHighlight,
.monaco-editor.hc-theme .debugHoverHighlight {
background-color: rgba(38, 79, 120, 0.25);
}

View File

@@ -0,0 +1,396 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/* Debug viewlet */
.debug-viewlet {
height: 100%;
}
/* Actionbar actions */
.monaco-workbench .debug-action.configure {
background: url('configure.svg') center center no-repeat;
}
.monaco-workbench .debug-action.start {
background: url('continue.svg') center center no-repeat;
}
.monaco-workbench .debug-action.toggle-repl {
background: url('repl.svg') center center no-repeat;
}
.monaco-workbench .debug-action.notification:before {
content: '';
width: 6px;
height: 6px;
background-color: #CC6633;
position: absolute;
top: 11px;
right: 5px;
border-radius: 10px;
border: 1px solid white;
}
.vs-dark .monaco-workbench .debug-action.start,
.hc-black .monaco-workbench .debug-action.start {
background: url('continue-inverse.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .debug-action.configure,
.hc-black .monaco-workbench .debug-action.configure {
background: url('configure-inverse.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .debug-action.toggle-repl,
.hc-black .monaco-workbench .debug-action.toggle-repl {
background: url('repl-inverse.svg') center center no-repeat;
}
.monaco-workbench > .part > .title > .title-actions .start-debug-action-item {
display: flex;
align-items: center;
font-size: 11px;
margin-right: 0.3em;
height: 20px;
flex-shrink: 1;
margin-top: 7px;
}
.monaco-workbench.mac > .part > .title > .title-actions .start-debug-action-item {
border-radius: 4px;
}
.monaco-workbench > .part > .title > .title-actions .start-debug-action-item .icon {
height: 20px;
width: 20px;
background: url('continue.svg') center center no-repeat;
flex-shrink: 0;
transition: transform 50ms ease;
-webkit-transition: -webkit-transform 50ms ease;
}
.vs-dark .monaco-workbench > .part > .title > .title-actions .start-debug-action-item .icon,
.hc-black .monaco-workbench > .part > .title > .title-actions .start-debug-action-item .icon {
background: url('continue-inverse.svg') center center no-repeat;
}
.monaco-workbench .monaco-action-bar .start-debug-action-item .configuration .select-box {
border: none;
margin-top: 0px;
cursor: pointer;
}
.monaco-workbench .monaco-action-bar .start-debug-action-item .configuration.disabled .select-box {
opacity: 0.7;
font-style: italic;
cursor: initial;
}
.monaco-workbench > .part > .title > .title-actions .start-debug-action-item .icon.active {
-webkit-transform: scale(1.272019649, 1.272019649);
transform: scale(1.272019649, 1.272019649);
}
/* Debug viewlet trees */
.debug-viewlet .monaco-tree .monaco-tree-row > .content {
line-height: 22px;
}
.debug-viewlet .line-number {
background: rgba(136, 136, 136, 0.3);
border-radius: 2px;
font-size: 0.9em;
padding: 0 3px;
margin-left: 0.8em;
}
.debug-viewlet .monaco-tree .monaco-tree-row.selected .line-number,
.debug-viewlet .monaco-tree .monaco-tree-row.selected .thread > .state > .label,
.debug-viewlet .monaco-tree .monaco-tree-row.selected .process > .state > .label {
background-color: #ffffff;
color: #666;
}
.debug-viewlet .monaco-tree .monaco-tree-row .content .monaco-action-bar {
visibility: hidden;
flex-shrink: 0;
}
.debug-viewlet .monaco-tree .monaco-tree-row .content .monaco-action-bar .action-label {
width: 16px;
height: 16px;
vertical-align: text-bottom;
}
.debug-viewlet .monaco-tree .monaco-tree-row:hover .content .monaco-action-bar,
.debug-viewlet .monaco-tree.focused .monaco-tree-row.focused .content .monaco-action-bar {
visibility: visible;
}
.debug-viewlet .disabled {
opacity: 0.35;
}
/* Call stack */
.debug-viewlet .debug-call-stack-title {
display: flex;
width: 100%;
}
.debug-viewlet .debug-call-stack-title > .pause-message {
flex: 1;
text-align: right;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
margin: 0px 10px;
}
.debug-viewlet .debug-call-stack-title > .pause-message > .label {
border-radius: 3px;
padding: 1px 2px;
font-size: 9px;
}
.debug-viewlet .debug-call-stack-title > .pause-message > .label.exception {
background-color: #A31515;
color: rgb(255, 255, 255);
}
.vs-dark .debug-viewlet .debug-call-stack-title > .pause-message > .label.exception {
background-color: #6C2022;
color: inherit;
}
.hc-black .debug-viewlet .debug-call-stack-title > .pause-message > .label.exception {
background-color: #6C2022;
color: inherit;
}
.debug-viewlet .debug-call-stack .thread,
.debug-viewlet .debug-call-stack .process {
display: flex;
}
.debug-viewlet .debug-call-stack .thread > .state,
.debug-viewlet .debug-call-stack .process > .state {
flex: 1;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
padding: 0 10px;
text-transform: uppercase;
}
.debug-viewlet .debug-call-stack .thread > .state > .label,
.debug-viewlet .debug-call-stack .process > .state > .label {
background: rgba(136, 136, 136, 0.3);
border-radius: 2px;
font-size: 0.8em;
padding: 0 3px;
}
.debug-viewlet .debug-call-stack .stack-frame {
overflow: hidden;
text-overflow: ellipsis;
padding-right: 0.8em;
}
.debug-viewlet .debug-call-stack .stack-frame.label {
text-align: center;
font-style: italic;
}
.debug-viewlet .debug-call-stack .stack-frame.subtle {
font-style: italic;
}
.debug-viewlet .debug-call-stack .stack-frame.label > .file {
display: none;
}
.debug-viewlet .debug-call-stack .stack-frame > .file {
float: right;
}
.debug-viewlet .debug-call-stack .stack-frame > .file > .line-number.unavailable {
display: none;
}
.debug-viewlet .debug-call-stack > .monaco-tree-row:not(.selected) .stack-frame > .file {
color: rgba(108, 108, 108, 0.8);
}
.vs-dark .debug-viewlet .debug-call-stack > .monaco-tree-row:not(.selected) .stack-frame > .file {
color: rgba(204, 204, 204, 0.6);
}
.debug-viewlet .debug-call-stack .stack-frame > .file:not(:first-child) {
margin-left: 0.8em;
}
.debug-viewlet .debug-call-stack .load-more {
font-style: italic;
text-align: center;
}
.monaco-workbench .debug-viewlet .monaco-tree-row .expression {
white-space: pre;
}
.debug-viewlet .debug-call-stack .error {
font-style: italic;
text-overflow: ellipsis;
overflow: hidden;
}
/* Variables & Expression view */
.debug-viewlet .scope {
font-weight: bold;
font-size: 11px;
}
/* Animation of changed values in Debug viewlet */
@keyframes debugViewletValueChanged {
0% { background-color: rgba(86, 156, 214, 0) }
5% { background-color: rgba(86, 156, 214, .75) }
100% { background-color: rgba(86, 156, 214, .3) }
}
@keyframes debugViewletValueChangedDark {
0% { background-color: rgba(86, 156, 214, 0) }
5% { background-color: rgba(86, 156, 214, .5) }
100% { background-color: rgba(86, 156, 214, .2) }
}
.debug-viewlet .monaco-tree-row .expression .value.changed {
padding: 2px;
margin: 4px;
border-radius: 4px;
background-color: rgba(86, 156, 214, .5);
animation-name: debugViewletValueChanged;
animation-duration: .75s;
animation-fill-mode: forwards;
}
.debug-viewlet .monaco-inputbox {
width: 100%;
line-height: normal;
}
.debug-viewlet .inputBoxContainer {
box-sizing: border-box;
flex-grow: 1;
}
.debug-viewlet .debug-watch .monaco-inputbox {
font-family: Monaco, Menlo, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";
}
.debug-viewlet .monaco-inputbox > .wrapper {
height: 19px;
}
.debug-viewlet .monaco-inputbox > .wrapper > .input {
padding: 0px;
color: initial;
}
.debug-viewlet .watch-expression {
display: flex;
}
.debug-viewlet .watch-expression .expression {
flex : 1;
}
.debug-viewlet .debug-action.add-watch-expression,
.debug-viewlet .debug-action.add-function-breakpoint {
background: url('add.svg') center center no-repeat;
}
.debug-viewlet .focused .monaco-tree-row.selected:not(.highlighted) > .content.actions .debug-action.add-watch-expression {
background: url("add-focus.svg") center center no-repeat;
}
.vs-dark .debug-viewlet .debug-action.add-watch-expression,
.vs-dark .debug-viewlet .debug-action.add-function-breakpoint,
.hc-black .debug-viewlet .debug-action.add-watch-expression {
background: url('add-inverse.svg') center center no-repeat;
}
.vs-dark .debug-viewlet .monaco-tree-row .expression .value.changed {
animation-name: debugViewletValueChanged;
}
/* Breakpoints */
.debug-viewlet .debug-breakpoints .breakpoint {
display: flex;
padding-right: 0.8em;
flex: 1;
align-items: center;
}
.debug-viewlet .debug-breakpoints .breakpoint input {
flex-shrink: 0;
}
.debug-viewlet .debug-breakpoints .breakpoint > .file-path {
opacity: 0.7;
font-size: 0.9em;
margin-left: 0.8em;
flex: 1;
text-overflow: ellipsis;
overflow: hidden;
}
.debug-viewlet .debug-action.remove {
background: url('remove.svg') center center no-repeat;
}
.debug-viewlet .debug-action.remove-all {
background: url('remove-all.svg') center center no-repeat;
}
.debug-viewlet .debug-action.breakpoints-activate {
background: url('breakpoints-activate.svg') center center no-repeat;
}
.debug-viewlet .focused .monaco-tree-row.selected:not(.highlighted) > .content.actions .debug-action.remove,
.vs-dark .debug-viewlet .focused .monaco-tree-row.selected:not(.highlighted) > .content.actions .debug-action.remove {
background: url("remove-focus.svg") center center no-repeat;
}
.vs-dark .debug-viewlet .debug-action.remove,
.hc-black .debug-viewlet .debug-action.remove {
background: url('remove-inverse.svg') center center no-repeat;
}
.vs-dark .debug-viewlet .debug-action.remove-all,
.hc-black .debug-viewlet .debug-action.remove-all {
background: url('remove-all-inverse.svg') center center no-repeat;
}
.vs-dark .debug-viewlet .debug-action.breakpoints-activate,
.hc-black .debug-viewlet .debug-action.breakpoints-activate {
background: url('breakpoints-activate-inverse.svg') center center no-repeat;
}
/* No workspace view */
.debug-viewlet > .noworkspace-view {
padding: 0 20px 0 20px;
}
.debug-viewlet > .noworkspace-view > p {
line-height: 1.5em;
}

View File

@@ -0,0 +1 @@
<svg id="Calque_1" data-name="Calque 1" xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#f48771;}</style></defs><title>Plan de travail 1</title><path class="cls-1" d="M61.8,64H2.2A2.2,2.2,0,0,1,0,61.8V2.2A2.2,2.2,0,0,1,2.2,0H61.8A2.2,2.2,0,0,1,64,2.2V61.8A2.2,2.2,0,0,1,61.8,64ZM46,21.1H42V9.1h-5v12H26.9V9.1H22v12H18v4.1h1V42.4l9,7.3v7.7h8V49.7l9-7.3V25.2h1Z"/></svg>

After

Width:  |  Height:  |  Size: 423 B

View File

@@ -0,0 +1 @@
<svg id="Calque_1" data-name="Calque 1" xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#ac4747;}</style></defs><title>Plan de travail 1</title><path class="cls-1" d="M61.8,64H2.2A2.2,2.2,0,0,1,0,61.8V2.2A2.2,2.2,0,0,1,2.2,0H61.8A2.2,2.2,0,0,1,64,2.2V61.8A2.2,2.2,0,0,1,61.8,64ZM46,21.1H42V9.1h-5v12H26.9V9.1H22v12H18v4.1h1V42.4l9,7.3v7.7h8V49.7l9-7.3V25.2h1Z"/></svg>

After

Width:  |  Height:  |  Size: 423 B

View File

@@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="16px" height="32px" fill="#999">
<circle cx="5px" cy="11px" r="1.2"/>
<circle cx="10px" cy="11px" r="1.2"/>
<circle cx="5px" cy="16px" r="1.2"/>
<circle cx="10px" cy="16px" r="1.2"/>
<circle cx="5px" cy="21px" r="1.2"/>
<circle cx="10px" cy="21px" r="1.2"/>
</svg>

After

Width:  |  Height:  |  Size: 337 B

View File

@@ -0,0 +1,48 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .zone-widget.exception-widget-container {
overflow: hidden;
}
.monaco-editor .zone-widget .zone-widget-container.exception-widget {
padding: 6px 10px;
white-space: pre-wrap;
-webkit-user-select: text;
-ms-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-o-user-select: text;
user-select: text;
}
.monaco-editor .zone-widget .zone-widget-container.exception-widget .title {
font-weight: bold;
}
.monaco-editor .zone-widget .zone-widget-container.exception-widget .description,
.monaco-editor .zone-widget .zone-widget-container.exception-widget .stack-trace {
font-family: Monaco, Menlo, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";
}
.monaco-editor .zone-widget .zone-widget-container.exception-widget .stack-trace {
margin-top: 0.5em;
}
.monaco-editor .zone-widget .zone-widget-container.exception-widget a {
text-decoration: underline;
cursor: pointer;
}
/* High Contrast Theming */
.monaco-workbench.mac .zone-widget .zone-widget-container.exception-widget {
font-size: 11px;
}
.monaco-workbench.windows .zone-widget .zone-widget-container.exception-widget,
.monaco-workbench.linux .zone-widget .zone-widget-container.exception-widget {
font-size: 13px;
}

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path d="M13 13H3V2h10v11z" fill="#1E1E1E"/><path d="M7 12H4V3h3v9zm5-9H9v9h3V3z" fill="#75BEFF"/></svg>

After

Width:  |  Height:  |  Size: 221 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path d="M13 13H3V2h10v11z" fill="#F6F6F6"/><path d="M7 12H4V3h3v9zm5-9H9v9h3V3z" fill="#00539C"/></svg>

After

Width:  |  Height:  |  Size: 221 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path fill="#1E1E1E" d="M16 12h-2v2h-2v2H0V5h2V3h2V1h12v11z"/><g fill="#C5C5C5"><path d="M3 5h9v8h1V4H3zM5 2v1h9v8h1V2zM1 6v9h10V6H1zm8 7H7.5L6 11.5 4.5 13H3l2.3-2.3L3 8.5h1.5L6 10l1.5-1.5H9l-2.3 2.3L9 13z"/></g></svg>

After

Width:  |  Height:  |  Size: 335 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path fill="#F6F6F6" d="M16 12h-2v2h-2v2H0V5h2V3h2V1h12v11z"/><g fill="#424242"><path d="M3 5h9v8h1V4H3zM5 2v1h9v8h1V2zM1 6v9h10V6H1zm8 7H7.5L6 11.5 4.5 13H3l2.3-2.3L3 8.5h1.5L6 10l1.5-1.5H9l-2.3 2.3L9 13z"/></g></svg>

After

Width:  |  Height:  |  Size: 335 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="3 3 16 16" enable-background="new 3 3 16 16"><polygon fill="#FFF" points="12.597,11.042 15.4,13.845 13.844,15.4 11.042,12.598 8.239,15.4 6.683,13.845 9.485,11.042 6.683,8.239 8.238,6.683 11.042,9.486 13.845,6.683 15.4,8.239"/></svg>

After

Width:  |  Height:  |  Size: 304 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="3 3 16 16" enable-background="new 3 3 16 16"><polygon fill="#e8e8e8" points="12.597,11.042 15.4,13.845 13.844,15.4 11.042,12.598 8.239,15.4 6.683,13.845 9.485,11.042 6.683,8.239 8.238,6.683 11.042,9.486 13.845,6.683 15.4,8.239"/></svg>

After

Width:  |  Height:  |  Size: 307 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="3 3 16 16" enable-background="new 3 3 16 16"><polygon fill="#424242" points="12.597,11.042 15.4,13.845 13.844,15.4 11.042,12.598 8.239,15.4 6.683,13.845 9.485,11.042 6.683,8.239 8.238,6.683 11.042,9.486 13.845,6.683 15.4,8.239"/></svg>

After

Width:  |  Height:  |  Size: 307 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{fill:#252526;} .icon-vs-bg{fill:#c5c5c5;} .icon-vs-fg{fill:#2a292c;}</style><path class="icon-canvas-transparent" d="M32 32h-32v-32h32v32z" id="canvas"/><path class="icon-vs-out" d="M32 28h-32v-24h32v24z" id="outline"/><path class="icon-vs-bg" d="M2 6v20h28v-20h-28zm26 18h-24v-16h24v16zm-13-8l-5.25 5.5-1.75-1.833 3.5-3.667-3.5-3.667 1.75-1.833 5.25 5.5z" id="iconBg"/><g id="iconFg"><path class="icon-vs-fg" d="M4 8v16h24v-16h-24zm5.75 13.5l-1.75-1.833 3.5-3.667-3.5-3.667 1.75-1.833 5.25 5.5-5.25 5.5z"/></g></svg>

After

Width:  |  Height:  |  Size: 686 B

View File

@@ -0,0 +1,182 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/* Debug repl */
.monaco-workbench .repl {
height: 100%;
box-sizing: border-box;
overflow: hidden;
}
.monaco-workbench .repl .surveyor {
font-family: Monaco, Menlo, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";
position: absolute;
display: inline-block;
width : auto;
top: 0;
left: 0;
visibility: hidden;
}
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content {
line-height: 18px;
-webkit-user-select: text;
/* Wrap words but also do not trim whitespace #6275 */
word-wrap: break-word;
white-space: pre-wrap;
/* Break on all #7533 */
word-break: break-all;
}
.monaco-workbench.mac .repl .repl-tree .monaco-tree-row .input.expression,
.monaco-workbench.mac .repl .repl-tree .monaco-tree-row .output.expression {
font-size: 12px;
}
.monaco-workbench.windows .repl .repl-tree .monaco-tree-row .input.expression,
.monaco-workbench.windows .repl .repl-tree .monaco-tree-row .output.expression,
.monaco-workbench.linux .repl .repl-tree .monaco-tree-row .input.expression,
.monaco-workbench.linux .repl .repl-tree .monaco-tree-row .output.expression {
font-size: 14px;
}
.monaco-workbench .repl .repl-tree .monaco-tree-row .output.expression > .value {
margin-left: 0px;
}
.monaco-workbench .repl .repl-tree .monaco-tree-row .output.expression > .annotation {
font-size: inherit;
padding-left: 6px;
}
.monaco-workbench .repl .repl-tree .monaco-tree-row .output.expression .name:not(:empty) {
margin-right: 6px;
}
/* Allign twistie since repl tree is smaller and sometimes has paired elements */
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row.has-children > .content.input-output-pair:before {
top: 8px;
cursor: pointer;
}
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row.has-children > .content.input-output-pair:after {
top: 10px;
}
.monaco-workbench .repl .repl-input-wrapper {
padding-left: 20px;
border-top: 1px solid rgba(128, 128, 128, 0.35);
}
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-rows > .monaco-tree-row {
cursor: default;
}
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-rows > .monaco-tree-row.has-children .content .expression {
cursor: pointer;
}
/* Disable repl hover highlight in tree. */
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) {
background-color: inherit;
}
/* Only show 'stale expansion' info when the element gets expanded. */
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-rows > .monaco-tree-row:not(.expanded) > .content.input-output-pair > .output > .annotation::before {
content: '';
}
.hc-black .monaco-workbench .repl .repl-input-wrapper {
border-top-color: #6FC3DF;
}
.monaco-workbench .repl .repl-input-wrapper:before {
left: 8px;
position: absolute;
}
.monaco-workbench .repl .repl-input-wrapper:before {
content: '\276f';
line-height: 18px;
}
.monaco-workbench.linux .repl .repl-input-wrapper:before {
font-size: 9px;
}
/* Actions */
.monaco-workbench .debug-action.clear-repl {
background: url('clear-repl.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .debug-action.clear-repl,
.hc-black .monaco-workbench .debug-action.clear-repl {
background: url('clear-repl-inverse.svg') center center no-repeat;
}
/* Output coloring */
.vs .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression > .warn {
color: #cd9731;
}
.vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression > .warn {
color: #cd9731;
}
.hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression > .warn {
color: #008000;
}
.vs .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression > .annotation {
color: #007ACC;
}
.vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression > .annotation {
color: #1B80B2;
}
.hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression > .annotation {
color: #0000FF;
}
/* ANSI Codes */
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code-bold { font-weight: bold; }
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code30, .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code90 { color: gray; }
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code31, .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code91 { color: #BE1717; }
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code32, .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code92 { color: #338A2F; }
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code33, .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code93 { color: #BEB817; }
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code34, .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code94 { color: darkblue; }
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code35, .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code95 { color: darkmagenta; }
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code36, .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code96 { color: darkcyan; }
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code37, .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code97 { color: #BDBDBD; }
.vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code30, .vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code90 { color: #A0A0A0; }
.vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code31, .vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code91 { color: #A74747; }
.vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code32, .vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code92 { color: #348F34; }
.vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code33, .vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code93 { color: #5F4C29; }
.vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code34, .vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code94 { color: #6286BB; }
.vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code35, .vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code95 { color: #914191; }
.vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code36, .vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code96 { color: #218D8D; }
.vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code37, .vs-dark .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code97 { color: #707070; }
.hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code30, .hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code90 { color: gray; }
.hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code31, .hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code91 { color: #A74747; }
.hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code32, .hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code92 { color: #348F34; }
.hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code33, .hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code93 { color: #5F4C29; }
.hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code34, .hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code94 { color: #6286BB; }
.hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code35, .hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code95 { color: #914191; }
.hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code36, .hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code96 { color: #218D8D; }
.hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code37, .hc-black .monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression .code97 { color: #707070; }
/* Links */
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content > .output.expression a {
text-decoration: underline;
cursor: pointer;
}

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{fill:#F6F6F6;} .icon-vs-bg{fill:#424242;} .icon-vs-fg{fill:#F0EFF1;}</style><path class="icon-canvas-transparent" d="M32 32h-32v-32h32v32z" id="canvas"/><path class="icon-vs-out" d="M32 28h-32v-24h32v24z" id="outline"/><path class="icon-vs-bg" d="M2 6v20h28v-20h-28zm26 18h-24v-16h24v16zm-13-8l-5.25 5.5-1.75-1.833 3.5-3.667-3.5-3.667 1.75-1.833 5.25 5.5z" id="iconBg"/><g id="iconFg"><path class="icon-vs-fg" d="M4 8v16h24v-16h-24zm5.75 13.5l-1.75-1.833 3.5-3.667-3.5-3.667 1.75-1.833 5.25 5.5-5.25 5.5z"/></g></svg>

After

Width:  |  Height:  |  Size: 686 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="#1E1E1E" d="M9.3 2.1L11.4 0H5.6l-4 4 .8.8-.4.6C1.4 6.5 1 7.7 1 9c0 3.9 3.1 7 7 7s7-3.1 7-7c0-3.4-2.5-6.3-5.7-6.9zM8 12c-1.7 0-3-1.3-3-3 0-.4.1-.8.3-1.2v-.1l.3.3h5.2c.1.3.2.6.2 1 0 1.7-1.3 3-3 3z"/><path fill="#89D185" d="M8 3H7l2-2H6L3 4l3 3h3L7 5h1c2.2 0 4 1.8 4 4s-1.8 4-4 4-4-1.8-4-4c0-.6.1-1.1.4-1.6L2.9 5.9c-.6.9-.9 2-.9 3.1 0 3.3 2.7 6 6 6s6-2.7 6-6-2.7-6-6-6z"/></svg>

After

Width:  |  Height:  |  Size: 470 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="#F6F6F6" d="M9.3 2.1L11.4 0H5.6l-4 4 .8.8-.4.6C1.4 6.5 1 7.7 1 9c0 3.9 3.1 7 7 7s7-3.1 7-7c0-3.4-2.5-6.3-5.7-6.9zM8 12c-1.7 0-3-1.3-3-3 0-.4.1-.8.3-1.2v-.1l.3.3h5.2c.1.3.2.6.2 1 0 1.7-1.3 3-3 3z"/><path fill="#388A34" d="M8 3H7l2-2H6L3 4l3 3h3L7 5h1c2.2 0 4 1.8 4 4s-1.8 4-4 4-4-1.8-4-4c0-.6.1-1.1.4-1.6L2.9 5.9c-.6.9-.9 2-.9 3.1 0 3.3 2.7 6 6 6s6-2.7 6-6-2.7-6-6-6z"/></svg>

After

Width:  |  Height:  |  Size: 470 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-red{fill:#e51400}.icon-vs-yellow{fill:#9CCE9C}.icon-vs-bg{fill:#424242}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-bg" d="M14.414 8l-5 6H3V2h6.414l5 6z" id="outline" style="display: none;"/><path class="icon-vs-yellow" d="M13 8l-4 5H4V3h5l4 5z" id="iconBg"/><g id="iconFg"><path class="icon-vs-red" d="M10.5 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/></g></svg>

After

Width:  |  Height:  |  Size: 533 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-red{fill:#e51400}.icon-vs-yellow{fill:#CEE7CE}.icon-vs-bg{fill:#424242}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-bg" d="M14.414 8l-5 6H3V2h6.414l5 6z" id="outline" style="display: none;"/><path class="icon-vs-yellow" d="M13 8l-4 5H4V3h5l4 5z" id="iconBg"/><g id="iconFg"><path class="icon-vs-red" d="M10.5 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/></g></svg>

After

Width:  |  Height:  |  Size: 533 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-bg{fill:#424242}.icon-vs-yellow{fill:#9CCE9C}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-bg" d="M14.414 8l-5 6H3V2h6.414l5 6z" id="outline" style="display: none;"/><g id="iconBg"><path class="icon-vs-yellow" d="M13 8l-4 5H4V3h5l4 5z"/></g></svg>

After

Width:  |  Height:  |  Size: 427 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-bg{fill:#424242}.icon-vs-yellow{fill:#CEE7CE}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-bg" d="M14.414 8l-5 6H3V2h6.414l5 6z" id="outline" style="display: none;"/><g id="iconBg"><path class="icon-vs-yellow" d="M13 8l-4 5H4V3h5l4 5z"/></g></svg>

After

Width:  |  Height:  |  Size: 427 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#2D2D30;} .icon-vs-out{fill:#2D2D30;} .icon-vs-bg{fill:#C5C5C5;} .icon-vs-action-blue{fill:#75BEFF;}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-out" d="M11 13c0-1.526-1.15-2.775-2.624-2.962L12 6.414V1.586l-2 2V1H6v2.586l-2-2v4.828l3.624 3.624C6.15 10.225 5 11.474 5 13c0 1.654 1.346 3 3 3s3-1.346 3-3z" id="outline"/><path class="icon-vs-bg" d="M8 11c1.104 0 2 .896 2 2s-.896 2-2 2-2-.896-2-2 .896-2 2-2z" id="iconBg"/><path class="icon-vs-action-blue" d="M8 9L5 6V4l2 2V2h2v4l2-2v2L8 9z" id="colorAction"/></svg>

After

Width:  |  Height:  |  Size: 717 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{fill:#F6F6F6;} .icon-vs-bg{fill:#424242;} .icon-vs-action-blue{fill:#00539C;}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-out" d="M11 13c0-1.526-1.15-2.775-2.624-2.962L12 6.414V1.586l-2 2V1H6v2.586l-2-2v4.828l3.624 3.624C6.15 10.225 5 11.474 5 13c0 1.654 1.346 3 3 3s3-1.346 3-3z" id="outline"/><path class="icon-vs-bg" d="M8 11c1.104 0 2 .896 2 2s-.896 2-2 2-2-.896-2-2 .896-2 2-2z" id="iconBg"/><path class="icon-vs-action-blue" d="M8 9L5 6V4l2 2V2h2v4l2-2v2L8 9z" id="colorAction"/></svg>

After

Width:  |  Height:  |  Size: 717 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#2D2D30;} .icon-vs-out{fill:#2D2D30;} .icon-vs-bg{fill:#C5C5C5;} .icon-vs-action-blue{fill:#75BEFF;}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><g id="outline"><path class="icon-vs-out" d="M10 7.414l2 2V4.586l-4-4-4 4v4.828l2-2V10h4z"/><circle class="icon-vs-out" cx="8" cy="13" r="3"/></g><path class="icon-vs-bg" d="M8 11c1.104 0 2 .896 2 2s-.896 2-2 2-2-.896-2-2 .896-2 2-2z" id="iconBg"/><path class="icon-vs-action-blue" d="M11 5v2L9 5v4H7V5L5 7V5l3-3 3 3z" id="colorAction"/></svg>

After

Width:  |  Height:  |  Size: 670 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{fill:#F6F6F6;} .icon-vs-bg{fill:#424242;} .icon-vs-action-blue{fill:#00539C;}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><g id="outline"><path class="icon-vs-out" d="M10 7.414l2 2V4.586l-4-4-4 4v4.828l2-2V10h4z"/><circle class="icon-vs-out" cx="8" cy="13" r="3"/></g><path class="icon-vs-bg" d="M8 11c1.104 0 2 .896 2 2s-.896 2-2 2-2-.896-2-2 .896-2 2-2z" id="iconBg"/><path class="icon-vs-action-blue" d="M11 5v2L9 5v4H7V5L5 7V5l3-3 3 3z" id="colorAction"/></svg>

After

Width:  |  Height:  |  Size: 670 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#2D2D30;} .icon-vs-out{fill:#2D2D30;} .icon-vs-bg{fill:#C5C5C5;} .icon-vs-action-blue{fill:#75BEFF;}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-out" d="M8 16c-1.654 0-3-1.346-3-3s1.346-3 3-3 3 1.346 3 3-1.346 3-3 3zm7-6V4.586l-4-4V3.03C9.967 2.367 8.755 2 7.5 2 4.158 2 1.305 4.596 1.004 7.91L.904 9H4.55l.113-.872c.104-.79.528-1.474 1.13-1.923L9.587 10H15zM6.106 6c.415-.232.892-.363 1.394-.363.51 0 1.02.133 1.466.363h-2.86z" id="outline"/><path class="icon-vs-bg" d="M8 11c1.104 0 2 .896 2 2s-.896 2-2 2-2-.896-2-2 .896-2 2-2z" id="iconBg"/><path class="icon-vs-action-blue" d="M3.67 8H2c.254-2.8 2.637-5 5.5-5 1.86 0 3.504.93 4.5 2.348V3l2 2v4h-4L8 7h3v-.002l.238.002C10.652 5.61 9.102 4.637 7.5 4.637 5.535 4.637 3.915 6.102 3.67 8z" id="colorAction"/></svg>

After

Width:  |  Height:  |  Size: 967 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{fill:#F6F6F6;} .icon-vs-bg{fill:#424242;} .icon-vs-action-blue{fill:#00539C;}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-out" d="M8 16c-1.654 0-3-1.346-3-3s1.346-3 3-3 3 1.346 3 3-1.346 3-3 3zm7-6V4.586l-4-4V3.03C9.967 2.367 8.755 2 7.5 2 4.158 2 1.305 4.596 1.004 7.91L.904 9H4.55l.113-.872c.104-.79.528-1.474 1.13-1.923L9.587 10H15zM6.106 6c.415-.232.892-.363 1.394-.363.51 0 1.02.133 1.466.363h-2.86z" id="outline"/><path class="icon-vs-bg" d="M8 11c1.104 0 2 .896 2 2s-.896 2-2 2-2-.896-2-2 .896-2 2-2z" id="iconBg"/><path class="icon-vs-action-blue" d="M3.67 8H2c.254-2.8 2.637-5 5.5-5 1.86 0 3.504.93 4.5 2.348V3l2 2v4h-4L8 7h3v-.002l.238.002C10.652 5.61 9.102 4.637 7.5 4.637 5.535 4.637 3.915 6.102 3.67 8z" id="colorAction"/></svg>

After

Width:  |  Height:  |  Size: 967 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path fill="#2D2D30" d="M13 13h-10v-10h10v10z"/><path fill="#F48771" d="M12 12h-8v-8h8v8z"/></svg>

After

Width:  |  Height:  |  Size: 215 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path fill="#F6F6F6" d="M13 13h-10v-10h10v10z"/><path fill="#A1260D" d="M12 12h-8v-8h8v8z"/></svg>

After

Width:  |  Height:  |  Size: 215 B