@@ -142,31 +142,24 @@ export class ResultsView extends AbstractWebview<IntoResultsViewMsg, FromResults
142142 this . handleSelectionChange . bind ( this )
143143 )
144144 ) ;
145- void logger . log ( 'Registering path-step navigation commands.' ) ;
146- this . push (
147- commandRunner (
148- 'codeQLQueryResults.nextPathStep' , // TODO: deprecate the old commands and make them forward to new commands named 'up/down'
149- this . navigateResultView . bind ( this , NavigationDirection . down )
150- )
151- ) ;
152- this . push (
153- commandRunner (
154- 'codeQLQueryResults.previousPathStep' ,
155- this . navigateResultView . bind ( this , NavigationDirection . up )
156- )
157- ) ;
158- this . push (
159- commandRunner (
160- 'codeQLQueryResults.right' ,
161- this . navigateResultView . bind ( this , NavigationDirection . right )
162- )
163- ) ;
164- this . push (
165- commandRunner (
166- 'codeQLQueryResults.left' ,
167- this . navigateResultView . bind ( this , NavigationDirection . left )
168- )
169- ) ;
145+ const navigationCommands = {
146+ 'codeQLQueryResults.up' : NavigationDirection . up ,
147+ 'codeQLQueryResults.down' : NavigationDirection . down ,
148+ 'codeQLQueryResults.left' : NavigationDirection . left ,
149+ 'codeQLQueryResults.right' : NavigationDirection . right ,
150+ // For backwards compatibility with keybindings set using an earlier version of the extension.
151+ 'codeQLQueryResults.nextPathStep' : NavigationDirection . down ,
152+ 'codeQLQueryResults.previousPathStep' : NavigationDirection . up ,
153+ } ;
154+ void logger . log ( 'Registering result view navigation commands.' ) ;
155+ for ( const [ commandId , direction ] of Object . entries ( navigationCommands ) ) {
156+ this . push (
157+ commandRunner (
158+ commandId ,
159+ this . navigateResultView . bind ( this , direction )
160+ )
161+ ) ;
162+ }
170163
171164 this . push (
172165 this . databaseManager . onDidChangeDatabaseItem ( ( { kind } ) => {
0 commit comments