Skip to content

Commit b0ba712

Browse files
author
Benjamin Pasero
committed
editors - some JSDoc 💄
1 parent 4a9931e commit b0ba712

4 files changed

Lines changed: 18 additions & 8 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class EditorControl extends Disposable {
3535
readonly onDidSizeConstraintsChange = this._onDidSizeConstraintsChange.event;
3636

3737
private _activeEditorPane: BaseEditor | null = null;
38-
private editorPanes: BaseEditor[] = [];
38+
private readonly editorPanes: BaseEditor[] = [];
3939

4040
private readonly activeEditorPaneDisposables = this._register(new DisposableStore());
4141
private dimension: Dimension | undefined;
@@ -62,7 +62,7 @@ export class EditorControl extends Disposable {
6262
// Editor pane
6363
const descriptor = Registry.as<IEditorRegistry>(EditorExtensions.Editors).getEditor(editor);
6464
if (!descriptor) {
65-
throw new Error('No editor descriptor found');
65+
throw new Error(`No editor descriptor found for input id ${editor.getTypeId()}`);
6666
}
6767
const editorPane = this.doShowEditorPane(descriptor);
6868

src/vs/workbench/services/editor/browser/editorService.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,15 @@ export class EditorService extends Disposable implements EditorServiceImpl {
451451
}
452452

453453
get visibleTextEditorControls(): Array<ICodeEditor | IDiffEditor> {
454-
return this.visibleEditorPanes.map(editorPane => editorPane.getControl() as ICodeEditor | IDiffEditor).filter(control => isCodeEditor(control) || isDiffEditor(control));
454+
const visibleTextEditorControls: Array<ICodeEditor | IDiffEditor> = [];
455+
for (const visibleEditorPane of this.visibleEditorPanes) {
456+
const control = visibleEditorPane.getControl();
457+
if (isCodeEditor(control) || isDiffEditor(control)) {
458+
visibleTextEditorControls.push(control);
459+
}
460+
}
461+
462+
return visibleTextEditorControls;
455463
}
456464

457465
get visibleEditors(): IEditorInput[] {

src/vs/workbench/services/editor/common/editorGroupsService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,13 +402,13 @@ export interface IEditorGroup {
402402
readonly ariaLabel: string;
403403

404404
/**
405-
* The active ediotr pane is the currently visible editor pane of the group.
405+
* The active editor pane is the currently visible editor pane of the group.
406406
*/
407407
readonly activeEditorPane: IVisibleEditorPane | undefined;
408408

409409
/**
410410
* The active editor is the currently visible editor of the group
411-
* within the current active control.
411+
* within the current active editor pane.
412412
*/
413413
readonly activeEditor: IEditorInput | null;
414414

src/vs/workbench/services/editor/common/editorService.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,22 @@ export interface IEditorService {
6666
/**
6767
* Emitted when the currently active editor changes.
6868
*
69-
* @see `IEditorService.activeEditor`
69+
* @see `IEditorService.activeEditorPane`
7070
*/
7171
readonly onDidActiveEditorChange: Event<void>;
7272

7373
/**
7474
* Emitted when any of the current visible editors changes.
7575
*
76-
* @see `IEditorService.visibleEditors`
76+
* @see `IEditorService.visibleEditorPanes`
7777
*/
7878
readonly onDidVisibleEditorsChange: Event<void>;
7979

8080
/**
8181
* The currently active editor pane or `undefined` if none. The editor pane is
8282
* the workbench container for editors of any kind.
8383
*
84-
* @see `IEditorService.activeEditor`
84+
* @see `IEditorService.activeEditor` for access to the active editor input
8585
*/
8686
readonly activeEditorPane: IVisibleEditorPane | undefined;
8787

@@ -109,6 +109,8 @@ export interface IEditorService {
109109

110110
/**
111111
* All editor panes that are currently visible across all editor groups.
112+
*
113+
* @see `IEditorService.visibleEditors` for access to the visible editor inputs
112114
*/
113115
readonly visibleEditorPanes: ReadonlyArray<IVisibleEditorPane>;
114116

0 commit comments

Comments
 (0)