File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
apps/code/src/renderer/features/message-editor/suggestions Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ import Fuse, { type IFuseOptions } from "fuse.js";
66import { useDraftStore } from "../stores/draftStore" ;
77import type { CommandSuggestionItem , FileSuggestionItem } from "../types" ;
88
9- const COMMAND_LIMIT = 5 ;
10-
119const COMMAND_FUSE_OPTIONS : IFuseOptions < AvailableCommand > = {
1210 keys : [
1311 { name : "name" , weight : 0.7 } ,
@@ -22,11 +20,11 @@ function searchCommands(
2220 query : string ,
2321) : AvailableCommand [ ] {
2422 if ( ! query . trim ( ) ) {
25- return commands . slice ( 0 , COMMAND_LIMIT ) ;
23+ return commands ;
2624 }
2725
2826 const fuse = new Fuse ( commands , COMMAND_FUSE_OPTIONS ) ;
29- const results = fuse . search ( query , { limit : COMMAND_LIMIT * 2 } ) ;
27+ const results = fuse . search ( query ) ;
3028
3129 const lowerQuery = query . toLowerCase ( ) ;
3230 results . sort ( ( a , b ) => {
@@ -38,7 +36,7 @@ function searchCommands(
3836 return ( a . score ?? 0 ) - ( b . score ?? 0 ) ;
3937 } ) ;
4038
41- return results . slice ( 0 , COMMAND_LIMIT ) . map ( ( result ) => result . item ) ;
39+ return results . map ( ( result ) => result . item ) ;
4240}
4341
4442export async function getFileSuggestions (
You can’t perform that action at this time.
0 commit comments