@@ -188,16 +188,13 @@ export function activate(context: vscode.ExtensionContext) {
188188 }
189189 } ;
190190
191- const setCallHierarchyDirectionCommand = async ( direction : CallsDirection ) => {
191+ const setCallHierarchyDirectionCommand = async ( direction : CallsDirection , arg : any ) => {
192192 callsDirection . value = direction ;
193- if ( model instanceof CallsModel ) {
194- updateCallHierachyModel ( model . uri , model . position , direction ) ;
195- }
196- } ;
193+ if ( arg instanceof CallItem ) {
194+ return updateCallHierachyModel ( arg . item . uri , arg . item . selectionRange . start , direction ) ;
197195
198- const makeRootCommand = ( call : any ) => {
199- if ( call instanceof CallItem ) {
200- return updateCallHierachyModel ( call . item . uri , call . item . selectionRange . start ) ;
196+ } else if ( model instanceof CallsModel ) {
197+ return updateCallHierachyModel ( model . uri , model . position , direction ) ;
201198 }
202199 } ;
203200
@@ -341,9 +338,8 @@ export function activate(context: vscode.ExtensionContext) {
341338 vscode . commands . registerCommand ( 'references-view.findImplementations' , ( ) => findReferencesCommand ( ItemSource . Implementations ) ) ,
342339 vscode . commands . registerCommand ( 'references-view.refindReference' , findReferencesCommand ) ,
343340 vscode . commands . registerCommand ( 'references-view.showCallHierarchy' , updateCallHierachyModel ) ,
344- vscode . commands . registerCommand ( 'references-view.showOutgoingCalls' , ( ) => setCallHierarchyDirectionCommand ( CallsDirection . Outgoing ) ) ,
345- vscode . commands . registerCommand ( 'references-view.showIncomingCalls' , ( ) => setCallHierarchyDirectionCommand ( CallsDirection . Incoming ) ) ,
346- vscode . commands . registerCommand ( 'references-view.rerunCallHierarchy' , makeRootCommand ) ,
341+ vscode . commands . registerCommand ( 'references-view.showOutgoingCalls' , ( arg ) => setCallHierarchyDirectionCommand ( CallsDirection . Outgoing , arg ) ) ,
342+ vscode . commands . registerCommand ( 'references-view.showIncomingCalls' , ( arg ) => setCallHierarchyDirectionCommand ( CallsDirection . Incoming , arg ) ) ,
347343 vscode . commands . registerCommand ( 'references-view.refind' , refindCommand ) ,
348344 vscode . commands . registerCommand ( 'references-view.refresh' , refreshCommand ) ,
349345 vscode . commands . registerCommand ( 'references-view.clear' , clearCommand ) ,
0 commit comments