mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-09 22:31:08 +00:00
Remove duplicates
This commit is contained in:
parent
45a7566e6a
commit
966ac5ecba
1 changed files with 12 additions and 1 deletions
|
|
@ -178,7 +178,18 @@ export function getContextMenuOptions(
|
|||
|
||||
// Combine suggestions with matching items in the desired order
|
||||
if (suggestions.length > 0 || matchingItems.length > 0) {
|
||||
return [...suggestions, ...fileMatches, ...gitMatches, ...otherMatches]
|
||||
const allItems = [...suggestions, ...fileMatches, ...gitMatches, ...otherMatches]
|
||||
|
||||
// Remove duplicates based on type and value
|
||||
const seen = new Set()
|
||||
const deduped = allItems.filter(item => {
|
||||
const key = `${item.type}-${item.value}`
|
||||
if (seen.has(key)) return false
|
||||
seen.add(key)
|
||||
return true
|
||||
})
|
||||
|
||||
return deduped
|
||||
}
|
||||
|
||||
return [{ type: ContextMenuOptionType.NoResults }]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue