MCPcopy Create free account
hub / github.com/anomalyco/opencode / currentMention

Function currentMention

packages/session-ui/src/components/line-comment.tsx:264–279  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

262 }
263
264 const currentMention = () => {
265 const textarea = refs.textarea
266 if (!textarea) return
267 if (!split.mention) return
268 if (textarea.selectionStart !== textarea.selectionEnd) return
269
270 const end = textarea.selectionStart
271 const match = textarea.value.slice(0, end).match(/@(\S*)$/)
272 if (!match) return
273
274 return {
275 query: match[1] ?? "",
276 start: end - match[0].length,
277 end,
278 }
279 }
280
281 const syncMention = () => {
282 const item = currentMention()

Callers 2

selectMentionFunction · 0.85
syncMentionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected