File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 [ ] {
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments