提交 6275278a 编写于 作者: I isidor

debug: bring back toString it is used for copyAll action

fixes #45967
上级 1cec53ce
......@@ -38,6 +38,9 @@ export abstract class AbstractReplElement implements IReplElement {
public getId(): string {
return `replelement:${this.id}`;
}
// Used by the copy all action in repl
abstract toString(): string;
}
export class SimpleReplElement extends AbstractReplElement {
......@@ -49,6 +52,10 @@ export class SimpleReplElement extends AbstractReplElement {
) {
super(source);
}
public toString(): string {
return this.value;
}
}
export class RawObjectReplElement extends AbstractReplElement implements IExpression {
......@@ -89,6 +96,10 @@ export class RawObjectReplElement extends AbstractReplElement implements IExpres
return TPromise.as(result);
}
public toString(): string {
return `${this.name}\n${this.value}`;
}
}
export class ExpressionContainer implements IExpressionContainer {
......
......@@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import { ITree } from 'vs/base/parts/tree/browser/tree';
import { removeAnsiEscapeCodes } from 'vs/base/common/strings';
import { Variable } from 'vs/workbench/parts/debug/common/debugModel';
import { IDebugService, IStackFrame } from 'vs/workbench/parts/debug/common/debug';
import { IDebugService, IStackFrame, IReplElement } from 'vs/workbench/parts/debug/common/debug';
import { clipboard } from 'electron';
export class CopyValueAction extends Action {
......@@ -77,7 +77,7 @@ export class CopyAllAction extends Action {
if (text) {
text += `\n`;
}
text += navigator.current().toString();
text += (<IReplElement>navigator.current()).toString();
}
clipboard.writeText(removeAnsiEscapeCodes(text));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册