Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions webview-ui/src/utils/context-mentions.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { mentionRegex } from "@roo/shared/context-mentions"
import { Fzf } from "fzf"
import { ModeConfig } from "@roo/shared/modes"
import * as path from "path"

import { escapeSpaces } from "./path-mentions"

export interface SearchResult {
path: string
type: "file" | "folder"
label?: string
}

function getBasename(filepath: string): string {
return filepath.split("/").pop() || filepath
}

export function insertMention(
text: string,
position: number,
Expand Down Expand Up @@ -254,7 +259,7 @@ export function getContextMenuOptions(

// For display purposes, we don't escape spaces in the label or description
const displayPath = formattedPath
const displayName = result.label || path.basename(result.path)
const displayName = result.label || getBasename(result.path)

// We don't need to escape spaces here because the insertMention function
// will handle that when the user selects a suggestion
Expand Down
Loading