Skip to content

Commit

Permalink
removing the interface for revealData
Browse files Browse the repository at this point in the history
  • Loading branch information
aiday-mar committed Feb 16, 2024
1 parent 746c6d8 commit ac46564
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import { derived, derivedWithStore, observableValue, recomputeInitiallyAndOnChange } from 'vs/base/common/observable';
import { readHotReloadableExport } from 'vs/editor/browser/widget/diffEditor/utils';
import { IMultiDiffEditorModel } from 'vs/editor/browser/widget/multiDiffEditorWidget/model';
import { IMultiDiffEditorOptionRevealData, IMultiDiffEditorViewState, MultiDiffEditorWidgetImpl } from 'vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidgetImpl';
import { IMultiDiffEditorViewState, IMultiDiffResource, MultiDiffEditorWidgetImpl } from 'vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidgetImpl';
import { MultiDiffEditorViewModel } from './multiDiffEditorViewModel';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import './colors';
Expand All @@ -19,6 +19,7 @@ import { URI } from 'vs/base/common/uri';
import { IDiffEditor } from 'vs/editor/common/editorCommon';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditor/diffEditorWidget';
import { Range } from 'vs/editor/common/core/range';

export class MultiDiffEditorWidget extends Disposable {
private readonly _dimension = observableValue<Dimension | undefined>(this, undefined);
Expand All @@ -45,7 +46,7 @@ export class MultiDiffEditorWidget extends Disposable {
this._register(recomputeInitiallyAndOnChange(this._widgetImpl));
}

public reveal(revealData: IMultiDiffEditorOptionRevealData): void {
public reveal(revealData: { resource: IMultiDiffResource; range: Range }): void {
this._widgetImpl.get().reveal(revealData);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class MultiDiffEditorWidgetImpl extends Disposable {
}

// todo@aiday-mar need to reveal the range instead of just the start line number
public reveal(revealData: IMultiDiffEditorOptionRevealData): void {
public reveal(revealData: { resource: IMultiDiffResource; range: Range }): void {
const resource = revealData.resource;
const viewItems = this._viewItems.get();
let searchCallback: (item: VirtualizedViewItem) => boolean;
Expand Down Expand Up @@ -306,12 +306,10 @@ export interface IMultiDiffEditorOptions extends ITextEditorOptions {
}

export interface IMultiDiffEditorOptionsViewState {
revealData?: IMultiDiffEditorOptionRevealData;
}

export interface IMultiDiffEditorOptionRevealData {
resource: IMultiDiffResource;
range: Range;
revealData?: {
resource: IMultiDiffResource;
range: Range;
};
}

export type IMultiDiffResource = { original: URI } | { modified: URI };
Expand Down

0 comments on commit ac46564

Please sign in to comment.