66import * as vscode from 'vscode' ;
77import { EditorHighlights } from './editorHighlights' ;
88import { History , HistoryItem } from './history' ;
9- import { CallItem , CallsDirection , CallsModel , FileItem , getPreviewChunks , getRequestRange , ItemSource , ReferenceItem , ReferencesModel , RichCallsDirection } from './models' ;
9+ import { CallItem , CallsDirection , CallsModel , Context , FileItem , getPreviewChunks , getRequestRange , ItemSource , ReferenceItem , ReferencesModel , RichCallsDirection } from './models' ;
1010import { TreeDataProviderWrapper , TreeItem } from './provider' ;
1111
1212export function activate ( context : vscode . ExtensionContext ) {
@@ -19,7 +19,7 @@ export function activate(context: vscode.ExtensionContext) {
1919
2020 const revealView = async ( ) => {
2121 // upon first interaction set the reference list as active and reveal it
22- await vscode . commands . executeCommand ( 'setContext' , 'reference-list.isActive' , true ) ;
22+ await Context . IsActive . set ( true ) ;
2323 await vscode . commands . executeCommand ( `${ viewId } .focus` ) ;
2424 } ;
2525
@@ -42,8 +42,10 @@ export function activate(context: vscode.ExtensionContext) {
4242 // update state
4343 view . message = undefined ;
4444 editorHighlights . setModel ( model ) ;
45- vscode . commands . executeCommand ( 'setContext' , 'reference-list.hasResult' , Boolean ( model ) ) ;
46- vscode . commands . executeCommand ( 'setContext' , 'reference-list.source' , model ?. source ) ;
45+
46+ // update context
47+ Context . HasResult . set ( Boolean ( model ) ) ;
48+ Context . Source . set ( model ?. source ) ;
4749
4850 revealView ( ) ;
4951 provider . update ( newModel || history ) ;
0 commit comments