File tree Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -354,7 +354,9 @@ describe("slashCommands", () => {
354354 ) ;
355355
356356 expect ( result ) . toBeDefined ( ) ;
357- expect ( result ?. newInput ) . toBe ( "Please explain the following code:some code" ) ;
357+ expect ( result ?. newInput ) . toBe (
358+ "Please explain the following code:some code" ,
359+ ) ;
358360 } ) ;
359361
360362 it ( "should handle invokable rules" , async ( ) => {
@@ -376,7 +378,9 @@ describe("slashCommands", () => {
376378 ) ;
377379
378380 expect ( result ) . toBeDefined ( ) ;
379- expect ( result ?. newInput ) . toBe ( "Perform a code review on the following: some code" ) ;
381+ expect ( result ?. newInput ) . toBe (
382+ "Perform a code review on the following: some code" ,
383+ ) ;
380384 } ) ;
381385
382386 it ( "should not treat non-invokable rules as slash commands" , async ( ) => {
@@ -421,7 +425,9 @@ describe("slashCommands", () => {
421425 ) ;
422426
423427 expect ( result ) . toBeDefined ( ) ;
424- expect ( result ?. newInput ) . toBe ( "Analyze the following code for patterns: my code" ) ;
428+ expect ( result ?. newInput ) . toBe (
429+ "Analyze the following code for patterns: my code" ,
430+ ) ;
425431 } ) ;
426432 } ) ;
427433} ) ;
Original file line number Diff line number Diff line change @@ -234,16 +234,14 @@ export async function handleSlashCommands(
234234 }
235235
236236 // Check for invokable rules
237- const invokableRule = assistant . rules ?. find (
238- ( rule ) => {
239- // Handle both string rules and rule objects
240- if ( ! rule || typeof rule === "string" ) {
241- return false ;
242- }
243- const ruleObj = rule as any ;
244- return ruleObj . invokable === true && ruleObj . name === command ;
245- } ,
246- ) ;
237+ const invokableRule = assistant . rules ?. find ( ( rule ) => {
238+ // Handle both string rules and rule objects
239+ if ( ! rule || typeof rule === "string" ) {
240+ return false ;
241+ }
242+ const ruleObj = rule as any ;
243+ return ruleObj . invokable === true && ruleObj . name === command ;
244+ } ) ;
247245 if ( invokableRule ) {
248246 const ruleObj = invokableRule as any ;
249247 const newInput = ruleObj . rule + " " + args . join ( " " ) ;
You can’t perform that action at this time.
0 commit comments