MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / getLanguageData

Function getLanguageData

app/src/components/queryEditor.tsx:192–212  ·  view source on GitHub ↗
(isSimpleString?: true)

Source from the content-addressed store, hash-verified

190}
191
192function getLanguageData(isSimpleString?: true) {
193 return {
194 closeBrackets: {
195 brackets: ['(', "'", '"', '`', "'''", '"""', '```', '[', '/'],
196 before: `)]'"\``,
197 } satisfies CloseBracketConfig,
198 autocomplete: queryCompletion(
199 {
200 getTags: async () => await C.db.getTags(),
201 getTemplates: async () =>
202 await C.db.getTemplates().then((ts) => ts.map((t) => t.name)),
203 getCardSettings: async () =>
204 await C.db.getCardSettings().then((css) => css.map((cs) => cs.name)),
205 getFields: C.db.getFields,
206 getHistory,
207 getDate: C.getDate,
208 },
209 isSimpleString,
210 ) satisfies CompletionSource,
211 }
212}
213
214// why & https://codemirror.net/examples/styling
215const prefix = '.query-editor &'

Callers 1

createEditorStateFunction · 0.85

Calls 1

queryCompletionFunction · 0.90

Tested by

no test coverage detected