Skip to content

Commit a1e1ff6

Browse files
authored
editors - drop generic options parameter in editor input resolve method (microsoft#205751)
1 parent 926bf1a commit a1e1ff6

File tree

7 files changed

+12
-13
lines changed

7 files changed

+12
-13
lines changed

src/vs/workbench/browser/parts/editor/binaryEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export abstract class BaseBinaryResourceEditor extends EditorPlaceholder {
4646
}
4747

4848
protected async getContents(input: EditorInput, options: IEditorOptions): Promise<IEditorPlaceholderContents> {
49-
const model = await input.resolve(options);
49+
const model = await input.resolve();
5050

5151
// Assert Model instance
5252
if (!(model instanceof BinaryEditorModel)) {

src/vs/workbench/browser/parts/editor/textDiffEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class TextDiffEditor extends AbstractTextEditor<IDiffEditorViewState> imp
106106
await super.setInput(input, options, context, token);
107107

108108
try {
109-
const resolvedModel = await input.resolve(options);
109+
const resolvedModel = await input.resolve();
110110

111111
// Check for cancellation
112112
if (token.isCancellationRequested) {

src/vs/workbench/browser/parts/editor/textResourceEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export abstract class AbstractTextResourceEditor extends AbstractTextCodeEditor<
5353

5454
// Set input and resolve
5555
await super.setInput(input, options, context, token);
56-
const resolvedModel = await input.resolve(options);
56+
const resolvedModel = await input.resolve();
5757

5858
// Check for cancellation
5959
if (token.isCancellationRequested) {

src/vs/workbench/common/editor/diffEditorInput.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { TextDiffEditorModel } from 'vs/workbench/common/editor/textDiffEditorMo
1414
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
1515
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
1616
import { shorten } from 'vs/base/common/labels';
17-
import { IEditorOptions, isResolvedEditorModel } from 'vs/platform/editor/common/editor';
17+
import { isResolvedEditorModel } from 'vs/platform/editor/common/editor';
1818

1919
interface IDiffEditorInputLabels {
2020
name: string;
@@ -171,13 +171,13 @@ export class DiffEditorInput extends SideBySideEditorInput implements IDiffEdito
171171
}
172172
}
173173

174-
override async resolve(options?: IEditorOptions): Promise<EditorModel> {
174+
override async resolve(): Promise<EditorModel> {
175175

176176
// Create Model - we never reuse our cached model if refresh is true because we cannot
177177
// decide for the inputs within if the cached model can be reused or not. There may be
178178
// inputs that need to be loaded again and thus we always recreate the model and dispose
179179
// the previous one - if any.
180-
const resolvedModel = await this.createModel(options);
180+
const resolvedModel = await this.createModel();
181181
this.cachedModel?.dispose();
182182

183183
this.cachedModel = resolvedModel;
@@ -193,12 +193,12 @@ export class DiffEditorInput extends SideBySideEditorInput implements IDiffEdito
193193
return editorPanes.find(editorPane => editorPane.typeId === TEXT_DIFF_EDITOR_ID);
194194
}
195195

196-
private async createModel(options?: IEditorOptions): Promise<DiffEditorModel> {
196+
private async createModel(): Promise<DiffEditorModel> {
197197

198198
// Join resolve call over two inputs and build diff editor model
199199
const [originalEditorModel, modifiedEditorModel] = await Promise.all([
200-
this.original.resolve(options),
201-
this.modified.resolve(options)
200+
this.original.resolve(),
201+
this.modified.resolve()
202202
]);
203203

204204
// If both are text models, return textdiffeditor model

src/vs/workbench/common/editor/editorInput.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import { Emitter } from 'vs/base/common/event';
77
import { URI } from 'vs/base/common/uri';
8-
import { IEditorOptions } from 'vs/platform/editor/common/editor';
98
import { firstOrDefault } from 'vs/base/common/arrays';
109
import { EditorInputCapabilities, Verbosity, GroupIdentifier, ISaveOptions, IRevertOptions, IMoveResult, IEditorDescriptor, IEditorPane, IUntypedEditorInput, EditorResourceAccessor, AbstractEditorInput, isEditorInput, IEditorIdentifier } from 'vs/workbench/common/editor';
1110
import { isEqual } from 'vs/base/common/resources';
@@ -235,7 +234,7 @@ export abstract class EditorInput extends AbstractEditorInput {
235234
* The `options` parameter are passed down from the editor when the
236235
* input is resolved as part of it.
237236
*/
238-
async resolve(options?: IEditorOptions): Promise<IDisposable | null> {
237+
async resolve(): Promise<IDisposable | null> {
239238
return null;
240239
}
241240

src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ export class SettingsEditor2 extends EditorPane {
355355
return;
356356
}
357357

358-
const model = await this.input.resolve(options);
358+
const model = await this.input.resolve();
359359
if (token.isCancellationRequested || !(model instanceof Settings2EditorModel)) {
360360
return;
361361
}

src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class WebviewEditor extends EditorPane {
154154
}
155155

156156
await super.setInput(input, options, context, token);
157-
await input.resolve(options);
157+
await input.resolve();
158158

159159
if (token.isCancellationRequested || this._isDisposed) {
160160
return;

0 commit comments

Comments
 (0)