提交 9eb39cb9 编写于 作者: I isidor

debug: show breakpoint.message on hover

上级 c03f3d08
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import nls = require('vs/nls'); import nls = require('vs/nls');
import objects = require('vs/base/common/objects');
import lifecycle = require('vs/base/common/lifecycle'); import lifecycle = require('vs/base/common/lifecycle');
import editorcommon = require('vs/editor/common/editorCommon'); import editorcommon = require('vs/editor/common/editorCommon');
import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
...@@ -270,11 +271,16 @@ export class DebugEditorModelManager implements IWorkbenchContribution { ...@@ -270,11 +271,16 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
const modelData = this.modelData[breakpoint.source.uri.toString()]; const modelData = this.modelData[breakpoint.source.uri.toString()];
const session = this.debugService.getActiveSession(); const session = this.debugService.getActiveSession();
const result = (!breakpoint.enabled || !activated) ? DebugEditorModelManager.BREAKPOINT_DISABLED_DECORATION : let result = (!breakpoint.enabled || !activated) ? DebugEditorModelManager.BREAKPOINT_DISABLED_DECORATION :
debugActive && modelData && modelData.dirty ? DebugEditorModelManager.BREAKPOINT_DIRTY_DECORATION : debugActive && modelData && modelData.dirty ? DebugEditorModelManager.BREAKPOINT_DIRTY_DECORATION :
debugActive && !breakpoint.verified ? DebugEditorModelManager.BREAKPOINT_UNVERIFIED_DECORATION : debugActive && !breakpoint.verified ? DebugEditorModelManager.BREAKPOINT_UNVERIFIED_DECORATION :
!breakpoint.condition ? DebugEditorModelManager.BREAKPOINT_DECORATION : null; !breakpoint.condition ? DebugEditorModelManager.BREAKPOINT_DECORATION : null;
if (result && breakpoint.message) {
result = objects.clone(result);
result.hoverMessage = breakpoint.message;
}
return result ? result : return result ? result :
!session || session.capablities.supportsConditionalBreakpoints ? { !session || session.capablities.supportsConditionalBreakpoints ? {
glyphMarginClassName: 'debug-breakpoint-conditional-glyph', glyphMarginClassName: 'debug-breakpoint-conditional-glyph',
......
...@@ -83,6 +83,7 @@ export interface IBreakpoint extends IEnablement { ...@@ -83,6 +83,7 @@ export interface IBreakpoint extends IEnablement {
condition: string; condition: string;
verified: boolean; verified: boolean;
idFromAdapter: number; idFromAdapter: number;
message: string;
} }
export interface IFunctionBreakpoint extends IEnablement { export interface IFunctionBreakpoint extends IEnablement {
......
...@@ -283,6 +283,7 @@ export class Breakpoint implements debug.IBreakpoint { ...@@ -283,6 +283,7 @@ export class Breakpoint implements debug.IBreakpoint {
public lineNumber: number; public lineNumber: number;
public verified: boolean; public verified: boolean;
public idFromAdapter: number; public idFromAdapter: number;
public message: string;
private id: string; private id: string;
constructor(public source: Source, public desiredLineNumber: number, public enabled: boolean, public condition: string) { constructor(public source: Source, public desiredLineNumber: number, public enabled: boolean, public condition: string) {
...@@ -415,6 +416,7 @@ export class Model extends ee.EventEmitter implements debug.IModel { ...@@ -415,6 +416,7 @@ export class Model extends ee.EventEmitter implements debug.IModel {
bp.lineNumber = bpData.line ? bpData.line : bp.lineNumber; bp.lineNumber = bpData.line ? bpData.line : bp.lineNumber;
bp.verified = bpData.verified; bp.verified = bpData.verified;
bp.idFromAdapter = bpData.id; bp.idFromAdapter = bpData.id;
bp.message = bpData.message;
} }
}); });
this.emit(debug.ModelEvents.BREAKPOINTS_UPDATED); this.emit(debug.ModelEvents.BREAKPOINTS_UPDATED);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册