Reduce usages of ICommonCodeEditor (#37834)

This commit is contained in:
Alex Dima
2017-11-10 09:58:18 +01:00
parent 5ca4bab8fc
commit e499dc62b5
97 changed files with 529 additions and 488 deletions

View File

@@ -12,7 +12,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService
import { ISaveParticipant, ITextFileEditorModel, SaveReason } from 'vs/workbench/services/textfile/common/textfiles';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IModel, ICommonCodeEditor, ISingleEditOperation, IIdentifiedSingleEditOperation } from 'vs/editor/common/editorCommon';
import { IModel, ISingleEditOperation, IIdentifiedSingleEditOperation } from 'vs/editor/common/editorCommon';
import { Range } from 'vs/editor/common/core/range';
import { Selection } from 'vs/editor/common/core/selection';
import { Position } from 'vs/editor/common/core/position';
@@ -25,6 +25,7 @@ import { ExtHostContext, ExtHostDocumentSaveParticipantShape, IExtHostContext }
import { EditOperation } from 'vs/editor/common/core/editOperation';
import { extHostCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
export interface INamedSaveParticpant extends ISaveParticipant {
readonly name: string;
@@ -70,8 +71,8 @@ class TrimWhitespaceParticipant implements INamedSaveParticpant {
}
}
function findEditor(model: IModel, codeEditorService: ICodeEditorService): ICommonCodeEditor {
let candidate: ICommonCodeEditor = null;
function findEditor(model: IModel, codeEditorService: ICodeEditorService): ICodeEditor {
let candidate: ICodeEditor = null;
if (model.isAttachedToEditor()) {
for (const editor of codeEditorService.listCodeEditors()) {
@@ -216,7 +217,7 @@ class FormatOnSaveParticipant implements INamedSaveParticpant {
});
}
private _editsWithEditor(editor: ICommonCodeEditor, edits: ISingleEditOperation[]): void {
private _editsWithEditor(editor: ICodeEditor, edits: ISingleEditOperation[]): void {
EditOperationsCommand.execute(editor, edits);
}