mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
Reduce usages of ICommonCodeEditor (#37834)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user