Add more icons (#6)
All checks were successful
/ build (push) Successful in 16s
Linter / lint (push) Successful in 11s

This commit is contained in:
Robin van der Linde 2025-07-19 16:58:36 +02:00
parent 871fe36488
commit ba36d5cc2a

View file

@ -62,11 +62,39 @@ export const iconCompletionProvider =
label: name,
kind: vscode.CompletionItemKind.File,
insertText: name,
// Sort these before the other icons
sortText: "#" + name,
});
}
}
});
// Add other icons
const allIcons = await vscode.workspace.findFiles(
"assets/**/**/*.{svg,png}",
"assets/{svg,png}/**"
);
allIcons.forEach((icon) => {
// We want to create the path relative to the main folder (e.g. ./assets/layers/beehive/beehive.svg)
// Though since files can also be deeper we need to remove the workspace folder from the path
const name =
"." +
icon.fsPath.replace(
(vscode.workspace.workspaceFolders
? vscode.workspace.workspaceFolders[0].uri.fsPath
: "") || "",
""
);
if (name) {
icons.push({
label: name,
kind: vscode.CompletionItemKind.File,
insertText: name,
});
}
});
return icons;
}
},