mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Observable logging improvement (#215759)
This commit is contained in:
parent
35ac2d01a6
commit
937c8c0c94
|
@ -154,7 +154,7 @@ export class AutorunObserver<TChangeSummary = any> implements IObserver, IReader
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _debugNameData: DebugNameData,
|
public readonly _debugNameData: DebugNameData,
|
||||||
public readonly _runFn: (reader: IReader, changeSummary: TChangeSummary) => void,
|
public readonly _runFn: (reader: IReader, changeSummary: TChangeSummary) => void,
|
||||||
private readonly createChangeSummary: (() => TChangeSummary) | undefined,
|
private readonly createChangeSummary: (() => TChangeSummary) | undefined,
|
||||||
private readonly _handleChange: ((context: IChangeContext, summary: TChangeSummary) => boolean) | undefined,
|
private readonly _handleChange: ((context: IChangeContext, summary: TChangeSummary) => boolean) | undefined,
|
||||||
|
|
|
@ -192,7 +192,7 @@ export class Derived<T, TChangeSummary = any> extends BaseObservable<T, void> im
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _debugNameData: DebugNameData,
|
public readonly _debugNameData: DebugNameData,
|
||||||
public readonly _computeFn: (reader: IReader, changeSummary: TChangeSummary) => T,
|
public readonly _computeFn: (reader: IReader, changeSummary: TChangeSummary) => T,
|
||||||
private readonly createChangeSummary: (() => TChangeSummary) | undefined,
|
private readonly createChangeSummary: (() => TChangeSummary) | undefined,
|
||||||
private readonly _handleChange: ((context: IChangeContext, summary: TChangeSummary) => boolean) | undefined,
|
private readonly _handleChange: ((context: IChangeContext, summary: TChangeSummary) => boolean) | undefined,
|
||||||
|
|
|
@ -114,7 +114,7 @@ export class ConsoleObservableLogger implements IObservableLogger {
|
||||||
styled(derived.debugName, { color: 'BlueViolet' }),
|
styled(derived.debugName, { color: 'BlueViolet' }),
|
||||||
...this.formatInfo(info),
|
...this.formatInfo(info),
|
||||||
this.formatChanges(changedObservables),
|
this.formatChanges(changedObservables),
|
||||||
{ data: [{ fn: derived._computeFn }] }
|
{ data: [{ fn: derived._debugNameData.referenceFn ?? derived._computeFn }] }
|
||||||
]));
|
]));
|
||||||
changedObservables.clear();
|
changedObservables.clear();
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ export class ConsoleObservableLogger implements IObservableLogger {
|
||||||
formatKind('autorun'),
|
formatKind('autorun'),
|
||||||
styled(autorun.debugName, { color: 'BlueViolet' }),
|
styled(autorun.debugName, { color: 'BlueViolet' }),
|
||||||
this.formatChanges(changedObservables),
|
this.formatChanges(changedObservables),
|
||||||
{ data: [{ fn: autorun._runFn }] }
|
{ data: [{ fn: autorun._debugNameData.referenceFn ?? autorun._runFn }] }
|
||||||
]));
|
]));
|
||||||
changedObservables.clear();
|
changedObservables.clear();
|
||||||
this.indentation++;
|
this.indentation++;
|
||||||
|
|
Loading…
Reference in a new issue