提交 d6b3a85b 编写于 作者: I isidor

fixes #75359

上级 b759cc6a
......@@ -62,7 +62,7 @@ import { RunOnceScheduler } from 'vs/base/common/async';
import { FuzzyScore, createMatches } from 'vs/base/common/filters';
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { VariablesRenderer } from 'vs/workbench/contrib/debug/browser/variablesView';
import { VariablesRenderer, variableSetEmitter } from 'vs/workbench/contrib/debug/browser/variablesView';
const $ = dom.$;
......@@ -274,6 +274,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
revealLastElement(this.tree);
this.history.add(this.replInput.getValue());
this.replInput.setValue('');
variableSetEmitter.fire();
const shouldRelayout = this.replInputHeight > Repl.REPL_INPUT_INITIAL_HEIGHT;
this.replInputHeight = Repl.REPL_INPUT_INITIAL_HEIGHT;
if (shouldRelayout) {
......
......@@ -30,6 +30,7 @@ import { HighlightedLabel, IHighlight } from 'vs/base/browser/ui/highlightedlabe
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
const $ = dom.$;
let forgetScopes = true;
export const variableSetEmitter = new Emitter<void>();
......@@ -99,7 +100,14 @@ export class VariablesView extends ViewletPanel {
const timeout = sf.explicit ? 0 : undefined;
this.onFocusStackFrameScheduler.schedule(timeout);
}));
this._register(variableSetEmitter.event(() => this.tree.updateChildren()));
this._register(variableSetEmitter.event(() => {
const stackFrame = this.debugService.getViewModel().focusedStackFrame;
if (stackFrame && forgetScopes) {
stackFrame.forgetScopes();
}
forgetScopes = true;
this.tree.updateChildren();
}));
this._register(this.tree.onMouseDblClick(e => this.onMouseDblClick(e)));
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
......@@ -256,7 +264,11 @@ export class VariablesRenderer extends AbstractExpressionsRenderer {
if (success && variable.value !== value) {
variable.setVariable(value)
// Need to force watch expressions and variables to update since a variable change can have an effect on both
.then(() => variableSetEmitter.fire());
.then(() => {
// Do not refresh scopes due to a node limitation #15520
forgetScopes = false;
variableSetEmitter.fire();
});
}
}
};
......
......@@ -247,6 +247,7 @@ export class WatchExpressionsRenderer extends AbstractExpressionsRenderer {
onFinish: (value: string, success: boolean) => {
if (success && value) {
this.debugService.renameWatchExpression(expression.getId(), value);
variableSetEmitter.fire();
} else if (!expression.name) {
this.debugService.removeWatchExpressions(expression.getId());
}
......
......@@ -301,6 +301,7 @@ export interface IStackFrame extends ITreeElement {
getScopes(): Promise<IScope[]>;
getMostSpecificScopes(range: IRange): Promise<ReadonlyArray<IScope>>;
getSpecificSourceName(): string;
forgetScopes(): void;
restart(): Promise<any>;
toString(): string;
openInEditor(editorService: IEditorService, preserveFocus?: boolean, sideBySide?: boolean): Promise<ITextEditor | null>;
......
......@@ -314,7 +314,7 @@ export class Scope extends ExpressionContainer implements IScope {
export class StackFrame implements IStackFrame {
private scopes: Promise<Scope[]> | null;
private scopes: Promise<Scope[]> | undefined;
constructor(
public thread: IThread,
......@@ -324,9 +324,7 @@ export class StackFrame implements IStackFrame {
public presentationHint: string | undefined,
public range: IRange,
private index: number
) {
this.scopes = null;
}
) { }
getId(): string {
return `stackframe:${this.thread.getId()}:${this.frameId}:${this.index}`;
......@@ -382,6 +380,10 @@ export class StackFrame implements IStackFrame {
return this.thread.session.restartFrame(this.frameId, this.thread.threadId);
}
forgetScopes(): void {
this.scopes = undefined;
}
toString(): string {
const lineNumberToString = typeof this.range.startLineNumber === 'number' ? `:${this.range.startLineNumber}` : '';
const sourceToString = `${this.source.inMemory ? this.source.name : this.source.uri.fsPath}${lineNumberToString}`;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册