Make mentions clickable

This commit is contained in:
Saoud Rizwan
2024-09-18 14:10:37 -04:00
parent c8050e603d
commit 593b3d6b7c
9 changed files with 55 additions and 18 deletions

View File

@@ -19,6 +19,7 @@ export interface WebviewMessage {
| "requestOllamaModels"
| "openImage"
| "openFile"
| "openMention"
text?: string
askResponse?: ClaudeAskResponse
apiConfiguration?: ApiConfiguration

View File

@@ -0,0 +1,9 @@
/*
Mention regex
- File and folder paths (starting with '/')
- URLs (containing '://')
- The 'problems' keyword
- Word boundary after 'problems' to avoid partial matches
*/
export const mentionRegex = /@((?:\/|\w+:\/\/)[^\s]+|problems\b)/
export const mentionRegexGlobal = new RegExp(mentionRegex.source, "g")