mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 14:31:31 +01:00
Reduce usages of ICommonCodeEditor (#37834)
This commit is contained in:
@@ -16,6 +16,7 @@ import { EndOfLine, TextEditorLineNumbersStyle } from 'vs/workbench/api/node/ext
|
||||
import { TextEditorCursorStyle, cursorStyleToString } from 'vs/editor/common/config/editorOptions';
|
||||
import { ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents';
|
||||
import { IResolvedTextEditorConfiguration, ISelectionChangeEvent, ITextEditorConfigurationUpdate, TextEditorRevealType, IApplyEditsOptions, IUndoStopOptions } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
|
||||
function configurationsEqual(a: IResolvedTextEditorConfiguration, b: IResolvedTextEditorConfiguration) {
|
||||
if (a && !b || !a && b) {
|
||||
@@ -45,7 +46,7 @@ export class MainThreadTextEditor {
|
||||
private _model: EditorCommon.IModel;
|
||||
private _modelService: IModelService;
|
||||
private _modelListeners: IDisposable[];
|
||||
private _codeEditor: EditorCommon.ICommonCodeEditor;
|
||||
private _codeEditor: ICodeEditor;
|
||||
private _focusTracker: IFocusTracker;
|
||||
private _codeEditorListeners: IDisposable[];
|
||||
|
||||
@@ -58,7 +59,7 @@ export class MainThreadTextEditor {
|
||||
constructor(
|
||||
id: string,
|
||||
model: EditorCommon.IModel,
|
||||
codeEditor: EditorCommon.ICommonCodeEditor,
|
||||
codeEditor: ICodeEditor,
|
||||
focusTracker: IFocusTracker,
|
||||
modelService: IModelService
|
||||
) {
|
||||
@@ -97,15 +98,15 @@ export class MainThreadTextEditor {
|
||||
return this._model;
|
||||
}
|
||||
|
||||
public getCodeEditor(): EditorCommon.ICommonCodeEditor {
|
||||
public getCodeEditor(): ICodeEditor {
|
||||
return this._codeEditor;
|
||||
}
|
||||
|
||||
public hasCodeEditor(codeEditor: EditorCommon.ICommonCodeEditor): boolean {
|
||||
public hasCodeEditor(codeEditor: ICodeEditor): boolean {
|
||||
return (this._codeEditor === codeEditor);
|
||||
}
|
||||
|
||||
public setCodeEditor(codeEditor: EditorCommon.ICommonCodeEditor): void {
|
||||
public setCodeEditor(codeEditor: ICodeEditor): void {
|
||||
if (this.hasCodeEditor(codeEditor)) {
|
||||
// Nothing to do...
|
||||
return;
|
||||
@@ -278,7 +279,7 @@ export class MainThreadTextEditor {
|
||||
}
|
||||
}
|
||||
|
||||
private _readConfiguration(model: EditorCommon.IModel, codeEditor: EditorCommon.ICommonCodeEditor): IResolvedTextEditorConfiguration {
|
||||
private _readConfiguration(model: EditorCommon.IModel, codeEditor: ICodeEditor): IResolvedTextEditorConfiguration {
|
||||
if (model.isDisposed()) {
|
||||
// shutdown time
|
||||
return this._configuration;
|
||||
|
||||
Reference in New Issue
Block a user