File tree Expand file tree Collapse file tree
apps/code/src/renderer/features/message-editor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,13 +52,18 @@ export async function getFileSuggestions(
5252 const { files, fzf } = await fetchRepoFiles ( repoPath ) ;
5353 const matched = searchFiles ( fzf , files , query ) ;
5454
55- return matched . map ( ( file ) => ( {
56- id : file . path ,
57- label : file . name ,
58- description : file . dir || undefined ,
59- filename : file . name ,
60- path : file . path ,
61- } ) ) ;
55+ return matched . map ( ( file ) => {
56+ const parentDir = file . dir ? file . dir . split ( "/" ) . pop ( ) : undefined ;
57+ const label = parentDir ? `${ parentDir } /${ file . name } ` : file . name ;
58+
59+ return {
60+ id : file . path ,
61+ label,
62+ description : file . dir || undefined ,
63+ filename : file . name ,
64+ path : file . path ,
65+ } ;
66+ } ) ;
6267}
6368
6469export function getCommandSuggestions (
Original file line number Diff line number Diff line change @@ -35,8 +35,9 @@ function DefaultChip({
3535
3636 const isCommand = type === "command" ;
3737 const prefix = isCommand ? "/" : "@" ;
38+ const isFile = type === "file" ;
3839
39- return (
40+ const chip = (
4041 < span
4142 className = { `${ isCommand ? "cli-slash-command" : "cli-file-mention" } ${ chipClass } ` }
4243 contentEditable = { false }
@@ -45,6 +46,12 @@ function DefaultChip({
4546 { label }
4647 </ span >
4748 ) ;
49+
50+ if ( isFile ) {
51+ return < Tooltip content = { id } > { chip } </ Tooltip > ;
52+ }
53+
54+ return chip ;
4855}
4956
5057function PastedTextChip ( {
You can’t perform that action at this time.
0 commit comments