mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-22 13:21:07 -05:00
Prettier backfill
This commit is contained in:
@@ -49,11 +49,12 @@ Mention regex:
|
||||
- `mentionRegexGlobal`: Creates a global version of the `mentionRegex` to find all matches within a given string.
|
||||
|
||||
*/
|
||||
export const mentionRegex = /@((?:\/|\w+:\/\/)[^\s]+?|[a-f0-9]{7,40}\b|problems\b|git-changes\b)(?=[.,;:!?]?(?=[\s\r\n]|$))/
|
||||
export const mentionRegex =
|
||||
/@((?:\/|\w+:\/\/)[^\s]+?|[a-f0-9]{7,40}\b|problems\b|git-changes\b)(?=[.,;:!?]?(?=[\s\r\n]|$))/
|
||||
export const mentionRegexGlobal = new RegExp(mentionRegex.source, "g")
|
||||
|
||||
export interface MentionSuggestion {
|
||||
type: 'file' | 'folder' | 'git' | 'problems'
|
||||
type: "file" | "folder" | "git" | "problems"
|
||||
label: string
|
||||
description?: string
|
||||
value: string
|
||||
@@ -61,7 +62,7 @@ export interface MentionSuggestion {
|
||||
}
|
||||
|
||||
export interface GitMentionSuggestion extends MentionSuggestion {
|
||||
type: 'git'
|
||||
type: "git"
|
||||
hash: string
|
||||
shortHash: string
|
||||
subject: string
|
||||
@@ -69,17 +70,23 @@ export interface GitMentionSuggestion extends MentionSuggestion {
|
||||
date: string
|
||||
}
|
||||
|
||||
export function formatGitSuggestion(commit: { hash: string; shortHash: string; subject: string; author: string; date: string }): GitMentionSuggestion {
|
||||
export function formatGitSuggestion(commit: {
|
||||
hash: string
|
||||
shortHash: string
|
||||
subject: string
|
||||
author: string
|
||||
date: string
|
||||
}): GitMentionSuggestion {
|
||||
return {
|
||||
type: 'git',
|
||||
type: "git",
|
||||
label: commit.subject,
|
||||
description: `${commit.shortHash} by ${commit.author} on ${commit.date}`,
|
||||
value: commit.hash,
|
||||
icon: '$(git-commit)', // VSCode git commit icon
|
||||
icon: "$(git-commit)", // VSCode git commit icon
|
||||
hash: commit.hash,
|
||||
shortHash: commit.shortHash,
|
||||
subject: commit.subject,
|
||||
author: commit.author,
|
||||
date: commit.date
|
||||
date: commit.date,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user