@@ -18,6 +18,7 @@ import {
1818} from "solid-js" ;
1919import type * as Domain from "@effect/experimental/DevTools/Domain" ;
2020import type { Client } from "./server" ;
21+ import { getCommands , filterCommands } from "./commands" ;
2122
2223// =============================================================================
2324// Types
@@ -587,57 +588,48 @@ export function StoreProvider(props: ParentProps) {
587588 } ,
588589
589590 navigateCommandUp : ( ) => {
590- // Import commands to get the filtered list length
591- import ( "./commands" ) . then ( ( { getCommands, filterCommands } ) => {
592- const allCommands = getCommands ( actions ) ;
593- const filtered = filterCommands (
594- allCommands ,
595- store . ui . commandPaletteQuery ,
596- ) ;
597- if ( filtered . length === 0 ) return ;
591+ const allCommands = getCommands ( actions ) ;
592+ const filtered = filterCommands (
593+ allCommands ,
594+ store . ui . commandPaletteQuery ,
595+ ) ;
596+ if ( filtered . length === 0 ) return ;
598597
599- setStore ( "ui" , "selectedCommandIndex" , ( prev ) => {
600- if ( prev <= 0 ) return filtered . length - 1 ;
601- return prev - 1 ;
602- } ) ;
598+ setStore ( "ui" , "selectedCommandIndex" , ( prev ) => {
599+ if ( prev <= 0 ) return filtered . length - 1 ;
600+ return prev - 1 ;
603601 } ) ;
604602 } ,
605603
606604 navigateCommandDown : ( ) => {
607- // Import commands to get the filtered list length
608- import ( "./commands" ) . then ( ( { getCommands, filterCommands } ) => {
609- const allCommands = getCommands ( actions ) ;
610- const filtered = filterCommands (
611- allCommands ,
612- store . ui . commandPaletteQuery ,
613- ) ;
614- if ( filtered . length === 0 ) return ;
605+ const allCommands = getCommands ( actions ) ;
606+ const filtered = filterCommands (
607+ allCommands ,
608+ store . ui . commandPaletteQuery ,
609+ ) ;
610+ if ( filtered . length === 0 ) return ;
615611
616- setStore ( "ui" , "selectedCommandIndex" , ( prev ) => {
617- if ( prev >= filtered . length - 1 ) return 0 ;
618- return prev + 1 ;
619- } ) ;
612+ setStore ( "ui" , "selectedCommandIndex" , ( prev ) => {
613+ if ( prev >= filtered . length - 1 ) return 0 ;
614+ return prev + 1 ;
620615 } ) ;
621616 } ,
622617
623618 executeSelectedCommand : ( ) => {
624- // Import commands to get the selected command
625- import ( "./commands" ) . then ( ( { getCommands, filterCommands } ) => {
626- const allCommands = getCommands ( actions ) ;
627- const filtered = filterCommands (
628- allCommands ,
629- store . ui . commandPaletteQuery ,
630- ) ;
631- const selected = filtered [ store . ui . selectedCommandIndex ] ;
632- if ( selected ) {
633- selected . execute ( ) ;
634- batch ( ( ) => {
635- setStore ( "ui" , "showCommandPalette" , false ) ;
636- setStore ( "ui" , "commandPaletteQuery" , "" ) ;
637- setStore ( "ui" , "selectedCommandIndex" , 0 ) ;
638- } ) ;
639- }
640- } ) ;
619+ const allCommands = getCommands ( actions ) ;
620+ const filtered = filterCommands (
621+ allCommands ,
622+ store . ui . commandPaletteQuery ,
623+ ) ;
624+ const selected = filtered [ store . ui . selectedCommandIndex ] ;
625+ if ( selected ) {
626+ selected . execute ( ) ;
627+ batch ( ( ) => {
628+ setStore ( "ui" , "showCommandPalette" , false ) ;
629+ setStore ( "ui" , "commandPaletteQuery" , "" ) ;
630+ setStore ( "ui" , "selectedCommandIndex" , 0 ) ;
631+ } ) ;
632+ }
641633 } ,
642634
643635 expandAllSpans : ( ) => {
0 commit comments