🐛 Handle old-style icon colors

This commit is contained in:
Robin van der Linde 2025-01-03 00:32:21 +01:00
parent 301bc2862b
commit 8bdc9f16d8
Signed by: Robin-van-der-Linde
GPG key ID: 53956B3252478F0D

View file

@ -44,13 +44,15 @@ export const iconDefinitionProvider =
// Check if the path starts with a dot, if so, it's a relative path // Check if the path starts with a dot, if so, it's a relative path
// if not, it's a built-in icon // if not, it's a built-in icon
if (!iconPath.startsWith(".")) { if (!iconPath.startsWith(".")) {
// For built-in icons, it's possible that a color is specified, like circle:red, so we need to remove that
const parts = iconPath.split(":");
fullIconPath = path.join( fullIconPath = path.join(
(vscode.workspace.workspaceFolders (vscode.workspace.workspaceFolders
? vscode.workspace.workspaceFolders[0].uri.fsPath ? vscode.workspace.workspaceFolders[0].uri.fsPath
: "") || "", : "") || "",
"assets", "assets",
"svg", "svg",
iconPath + ".svg" parts[0] + ".svg"
); );
} else { } else {
fullIconPath = path.join( fullIconPath = path.join(