Hi, I’m new and I’m having trouble implementing autocompletion. Could someone give me an example of how I can use it?
Here is the sample code that I can’t implement:
function myCompletions(context) {
let word = context.matchBefore(/\w*/)
if (word.from == word.to && !context.explicit)
return null
return {
from: word.from,
options: [
{label: "match", type: "keyword"},
{label: "hello", type: "variable", info: "(World)"},
{label: "magic", type: "text", apply: "⠁⭒*.✩.*⭒⠁", detail: "macro"}
]
}
}
Thank you very much if someone can help me :