-
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
it is possible to replace iife usage by doing something like so:
import * as arborium from "https://cdn.jsdelivr.net/npm/@arborium/arborium@2/dist/arborium.js";I was able to approximate it with the following but it would be nice if there was a function directly from the library to ensure accuracy
function getTagForCapture(capture) {
for (const { name, tag, parentTag } of arborium.highlights) {
if (capture !== name) continue;
if (parentTag) return getTagForCapture(parentTag);
return tag;
}
if (capture === "field") return getTagForCapture("variable");
if (capture === "parameter") return getTagForCapture("variable");
if (capture.startsWith("function")) return "f";
console.warn(capture);
return null;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels