Add synonyms to autocomplete

This commit is contained in:
Aria 2025-09-13 16:21:09 -05:00
parent c199b51645
commit 709b654ed3
5 changed files with 42 additions and 15 deletions

View file

@ -112,6 +112,13 @@
margin: 0 0 8px 0;
}
.autocomplete-info-function-synonyms {
margin: 0 0 12px 0;
color: var(--foreground);
line-height: 1.5;
opacity: 0.8;
}
.autocomplete-info-function-description {
margin: 0 0 12px 0;
color: var(--foreground);

View file

@ -16,8 +16,7 @@ const availableFunctions = (() => {
if (!s || seen.has(s)) continue;
seen.add(s);
// Swap `doc.name` in for `s` in the list of synonyms
const notS = synonyms.filter((x) => x && x !== s);
const synonymsWithDoc = Array.from(new Set([doc.name, ...notS]));
const synonymsWithDoc = [doc.name, ...synonyms].filter((x) => x && x !== s);
functions.push({
...doc,
name: s, // update names for the synonym