File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11import { mentionRegex } from "@roo/shared/context-mentions"
22import { Fzf } from "fzf"
33import { ModeConfig } from "@roo/shared/modes"
4- import * as path from "path"
4+
55import { escapeSpaces } from "./path-mentions"
66
77export interface SearchResult {
88 path : string
99 type : "file" | "folder"
1010 label ?: string
1111}
12+
13+ function getBasename ( filepath : string ) : string {
14+ return filepath . split ( "/" ) . pop ( ) || filepath
15+ }
16+
1217export function insertMention (
1318 text : string ,
1419 position : number ,
@@ -254,7 +259,7 @@ export function getContextMenuOptions(
254259
255260 // For display purposes, we don't escape spaces in the label or description
256261 const displayPath = formattedPath
257- const displayName = result . label || path . basename ( result . path )
262+ const displayName = result . label || getBasename ( result . path )
258263
259264 // We don't need to escape spaces here because the insertMention function
260265 // will handle that when the user selects a suggestion
You can’t perform that action at this time.
0 commit comments