mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-13 09:14:37 +01:00
IRange used
This commit is contained in:
@@ -18,7 +18,7 @@ import { Event } from 'vs/base/common/event';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IDiffEditor } from 'vs/editor/common/editorCommon';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { IRange } from 'vs/editor/common/core/range';
|
||||
|
||||
export class MultiDiffEditorWidget extends Disposable {
|
||||
private readonly _dimension = observableValue<Dimension | undefined>(this, undefined);
|
||||
@@ -45,7 +45,7 @@ export class MultiDiffEditorWidget extends Disposable {
|
||||
this._register(recomputeInitiallyAndOnChange(this._widgetImpl));
|
||||
}
|
||||
|
||||
public reveal(resource: IMultiDiffResource, range: Range): void {
|
||||
public reveal(resource: IMultiDiffResource, range: IRange): void {
|
||||
this._widgetImpl.get().reveal(resource, range);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { IDiffEditor } from 'vs/editor/common/editorCommon';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { IRange } from 'vs/editor/common/core/range';
|
||||
|
||||
export class MultiDiffEditorWidgetImpl extends Disposable {
|
||||
private readonly _elements = h('div.monaco-component.multiDiffEditor', [
|
||||
@@ -190,7 +190,7 @@ export class MultiDiffEditorWidgetImpl extends Disposable {
|
||||
}
|
||||
|
||||
// todo@aiday-mar need to reveal the range instead of just the start line number
|
||||
public reveal(resource: IMultiDiffResource, range: Range): void {
|
||||
public reveal(resource: IMultiDiffResource, range: IRange): void {
|
||||
const viewItems = this._viewItems.get();
|
||||
let searchCallback: (item: VirtualizedViewItem) => boolean;
|
||||
if ('original' in resource) {
|
||||
|
||||
@@ -38,6 +38,7 @@ import { ButtonBar } from 'vs/base/browser/ui/button/button';
|
||||
import { defaultButtonStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
import { Mutable } from 'vs/base/common/types';
|
||||
import { IResourceDiffEditorInput } from 'vs/workbench/common/editor';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
|
||||
const enum State {
|
||||
Data = 'data',
|
||||
@@ -339,7 +340,7 @@ export class BulkEditPane extends ViewPane {
|
||||
viewState: {
|
||||
revealData: {
|
||||
resource: { original: fileElement.edit.uri },
|
||||
lineNumber: 1
|
||||
range: new Range(1, 1, 1, 1)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ import { MultiDiffEditorViewModel } from 'vs/editor/browser/widget/multiDiffEdit
|
||||
import { IMultiDiffEditorViewState, IMultiDiffResource, isIMultiDiffResource } from 'vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidgetImpl';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { IDiffEditor } from 'vs/editor/common/editorCommon';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { IRange, Range } from 'vs/editor/common/core/range';
|
||||
|
||||
export class MultiDiffEditor extends AbstractEditorWithViewState<IMultiDiffEditorViewState> {
|
||||
static readonly ID = 'multiDiffEditor';
|
||||
@@ -73,7 +73,7 @@ export class MultiDiffEditor extends AbstractEditorWithViewState<IMultiDiffEdito
|
||||
}));
|
||||
}
|
||||
|
||||
public reveal(resource: IMultiDiffResource, range: Range): void {
|
||||
public reveal(resource: IMultiDiffResource, range: IRange): void {
|
||||
this._multiDiffEditorWidget?.reveal(resource, range);
|
||||
}
|
||||
|
||||
@@ -99,9 +99,9 @@ export class MultiDiffEditor extends AbstractEditorWithViewState<IMultiDiffEdito
|
||||
return;
|
||||
}
|
||||
const revealData: any = viewState.revealData;
|
||||
if ('lineNumber' in revealData && typeof revealData.lineNumber === 'number'
|
||||
if ('range' in revealData && Range.isIRange(revealData.range)
|
||||
&& 'resource' in revealData && isIMultiDiffResource(revealData.resource)) {
|
||||
this.reveal(revealData.resource, revealData.lineNumber);
|
||||
this.reveal(revealData.resource, revealData.range);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user