✨ Add more icons (#6)
This commit is contained in:
parent
871fe36488
commit
ba36d5cc2a
1 changed files with 28 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue