@@ -12,7 +12,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
1212import { IQuickAccessRegistry , Extensions as QuickaccessExtensions } from 'vs/platform/quickinput/common/quickAccess' ;
1313import { AbstractGotoSymbolQuickAccessProvider , IGotoSymbolQuickPickItem } from 'vs/editor/contrib/quickAccess/gotoSymbolQuickAccess' ;
1414import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
15- import { IWorkbenchEditorConfiguration , IEditorPane } from 'vs/workbench/common/editor' ;
15+ import { IWorkbenchEditorConfiguration , IEditorPane , IVisibleEditorPane } from 'vs/workbench/common/editor' ;
1616import { ITextModel } from 'vs/editor/common/model' ;
1717import { DisposableStore , IDisposable , toDisposable } from 'vs/base/common/lifecycle' ;
1818import { timeout } from 'vs/base/common/async' ;
@@ -108,11 +108,13 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
108108
109109 protected provideWithoutTextEditor ( picker : IQuickPick < IGotoSymbolQuickPickItem > ) : IDisposable {
110110 const pane = this . editorService . activeEditorPane ;
111- if ( ! pane || ! TableOfContentsProviderRegistry . has ( pane . getId ( ) ) ) {
112- //
113- return super . provideWithoutTextEditor ( picker ) ;
111+ if ( pane && TableOfContentsProviderRegistry . has ( pane . getId ( ) ) ) {
112+ return this . doGetTableOfContentsPicks ( picker , pane ) ;
114113 }
114+ return super . provideWithoutTextEditor ( picker ) ;
115+ }
115116
117+ private doGetTableOfContentsPicks ( picker : IQuickPick < IGotoSymbolQuickPickItem > , pane : IVisibleEditorPane ) : IDisposable {
116118 const provider = TableOfContentsProviderRegistry . get ( pane . getId ( ) ) ! ;
117119 const cts = new CancellationTokenSource ( ) ;
118120
@@ -144,7 +146,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
144146 disposables . add ( picker . onDidAccept ( ( ) => {
145147 picker . hide ( ) ;
146148 const [ entry ] = picker . selectedItems ;
147- entries [ entry . index ] ?. reveal ( ) ;
149+ entries [ entry . index ] ?. pick ( ) ;
148150 } ) ) ;
149151
150152 const updatePickerItems = ( ) => {
@@ -177,14 +179,11 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
177179 let ignoreFirstActiveEvent = true ;
178180 disposables . add ( picker . onDidChangeActive ( ( ) => {
179181 const [ entry ] = picker . activeItems ;
180-
181182 if ( entry && entries [ entry . index ] ) {
182- if ( ignoreFirstActiveEvent ) {
183- ignoreFirstActiveEvent = false ;
184- return ;
183+ if ( ! ignoreFirstActiveEvent ) {
184+ entries [ entry . index ] ?. preview ( ) ;
185185 }
186-
187- entries [ entry . index ] ?. reveal ( ) ;
186+ ignoreFirstActiveEvent = false ;
188187 }
189188 } ) ) ;
190189
@@ -238,7 +237,8 @@ export interface ITableOfContentsEntry {
238237 label : string ;
239238 detail ?: string ;
240239 description ?: string ;
241- reveal ( ) : any ;
240+ pick ( ) : any ;
241+ preview ( ) : any ;
242242}
243243
244244export interface ITableOfContentsProvider < T extends IEditorPane = IEditorPane > {
0 commit comments