MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / getAllMentionElements

Function getAllMentionElements

packages/web/src/features/chat/utils.ts:156–168  ·  view source on GitHub ↗
(children: Descendant[])

Source from the content-addressed store, hash-verified

154}
155
156export const getAllMentionElements = (children: Descendant[]): MentionElement[] => {
157 return children.flatMap((child) => {
158 if (isCustomTextElement(child)) {
159 return [];
160 }
161
162 if (isMentionElement(child)) {
163 return [child];
164 }
165
166 return getAllMentionElements(child.children);
167 });
168}
169
170export const clearEditorHistory = (editor: CustomEditor) => {
171 // slate-history exposes `history` publicly, but does not provide a clear API.

Callers 2

useCreateNewChatThreadFunction · 0.90
ChatThreadFunction · 0.90

Calls 2

isCustomTextElementFunction · 0.85
isMentionElementFunction · 0.70

Tested by

no test coverage detected