Format
This commit is contained in:
parent
134c767484
commit
908a7bda9a
|
|
@ -12,7 +12,7 @@ function wait_highlight(...args) {
|
|||
try {
|
||||
const subChannel = new MessageChannel();
|
||||
worker.postMessage({ signal, port: subChannel.port1, args }, [
|
||||
subChannel.port1
|
||||
subChannel.port1,
|
||||
]);
|
||||
Atomics.wait(signal, 0, 0);
|
||||
return receiveMessageOnPort(subChannel.port2).message.result;
|
||||
|
|
|
|||
|
|
@ -3,19 +3,17 @@ const shiki = require("shiki");
|
|||
const path = require("path");
|
||||
|
||||
async function shiki_highlight(code, lang) {
|
||||
const highlighter = await
|
||||
shiki
|
||||
.getHighlighter({
|
||||
theme: 'nord',
|
||||
const highlighter = await shiki.getHighlighter({
|
||||
theme: "nord",
|
||||
langs: [
|
||||
{
|
||||
id: "kdl",
|
||||
scopeName: "source.kdl",
|
||||
path: path.join(process.cwd(), "kdl.tmLanguage.json")
|
||||
}
|
||||
]
|
||||
})
|
||||
return highlighter.codeToHtml(code, lang)
|
||||
path: path.join(process.cwd(), "kdl.tmLanguage.json"),
|
||||
},
|
||||
],
|
||||
});
|
||||
return highlighter.codeToHtml(code, lang);
|
||||
}
|
||||
|
||||
parentPort.addListener("message", async ({ signal, port, args }) => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
||||
"comment":"Some of these patterns are taken straight from rust-analyzer: https://github.com/rust-lang/vscode-rust/blob/master/rust-analyzer/editors/code/rust.tmGrammar.json. Some was also taken from https://github.com/arm32x/vscode-sdlang/blob/master/syntaxes/sdlang.tmLanguage.json",
|
||||
"comment": "Some of these patterns are taken straight from rust-analyzer: https://github.com/rust-lang/vscode-rust/blob/master/rust-analyzer/editors/code/rust.tmGrammar.json. Some was also taken from https://github.com/arm32x/vscode-sdlang/blob/master/syntaxes/sdlang.tmLanguage.json",
|
||||
"name": "KDL",
|
||||
"patterns": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue