mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2025-09-15 12:27:30 +00:00
1722 lines
46 KiB
JavaScript
1722 lines
46 KiB
JavaScript
import { loadWASM, createOnigScanner, createOnigString } from 'vscode-oniguruma';
|
|
import { INITIAL, Registry as Registry$1 } from 'vscode-textmate';
|
|
|
|
const themes = [
|
|
"css-variables",
|
|
"dark-plus",
|
|
"dracula-soft",
|
|
"dracula",
|
|
"github-dark-dimmed",
|
|
"github-dark",
|
|
"github-light",
|
|
"light-plus",
|
|
"material-theme-darker",
|
|
"material-theme-lighter",
|
|
"material-theme-ocean",
|
|
"material-theme-palenight",
|
|
"material-theme",
|
|
"min-dark",
|
|
"min-light",
|
|
"monokai",
|
|
"nord",
|
|
"one-dark-pro",
|
|
"poimandres",
|
|
"rose-pine-dawn",
|
|
"rose-pine-moon",
|
|
"rose-pine",
|
|
"slack-dark",
|
|
"slack-ochin",
|
|
"solarized-dark",
|
|
"solarized-light",
|
|
"vitesse-black",
|
|
"vitesse-dark",
|
|
"vitesse-light"
|
|
];
|
|
|
|
const languages = [
|
|
{
|
|
id: "abap",
|
|
scopeName: "source.abap",
|
|
path: "abap.tmLanguage.json",
|
|
displayName: "ABAP",
|
|
samplePath: "abap.sample"
|
|
},
|
|
{
|
|
id: "actionscript-3",
|
|
scopeName: "source.actionscript.3",
|
|
path: "actionscript-3.tmLanguage.json",
|
|
displayName: "ActionScript",
|
|
samplePath: "actionscript-3.sample"
|
|
},
|
|
{
|
|
id: "ada",
|
|
scopeName: "source.ada",
|
|
path: "ada.tmLanguage.json",
|
|
displayName: "Ada",
|
|
samplePath: "ada.sample"
|
|
},
|
|
{
|
|
id: "apache",
|
|
scopeName: "source.apacheconf",
|
|
path: "apache.tmLanguage.json",
|
|
displayName: "Apache Conf",
|
|
samplePath: "apache.sample"
|
|
},
|
|
{
|
|
id: "apex",
|
|
scopeName: "source.apex",
|
|
path: "apex.tmLanguage.json",
|
|
displayName: "Apex",
|
|
samplePath: "apex.sample"
|
|
},
|
|
{
|
|
id: "apl",
|
|
scopeName: "source.apl",
|
|
path: "apl.tmLanguage.json",
|
|
displayName: "APL",
|
|
samplePath: "apl.sample",
|
|
embeddedLangs: ["html", "xml", "css", "javascript", "json"]
|
|
},
|
|
{
|
|
id: "applescript",
|
|
scopeName: "source.applescript",
|
|
path: "applescript.tmLanguage.json",
|
|
displayName: "AppleScript",
|
|
samplePath: "applescript.sample"
|
|
},
|
|
{
|
|
id: "ara",
|
|
scopeName: "source.ara",
|
|
path: "ara.tmLanguage.json",
|
|
displayName: "Ara",
|
|
samplePath: "ara.sample"
|
|
},
|
|
{
|
|
id: "asm",
|
|
scopeName: "source.asm.x86_64",
|
|
path: "asm.tmLanguage.json",
|
|
displayName: "Assembly",
|
|
samplePath: "asm.sample"
|
|
},
|
|
{
|
|
id: "astro",
|
|
scopeName: "source.astro",
|
|
path: "astro.tmLanguage.json",
|
|
displayName: "Astro",
|
|
samplePath: "astro.sample",
|
|
embeddedLangs: ["json", "javascript", "typescript", "stylus", "sass", "css", "scss", "less", "postcss", "tsx"]
|
|
},
|
|
{
|
|
id: "awk",
|
|
scopeName: "source.awk",
|
|
path: "awk.tmLanguage.json",
|
|
displayName: "AWK",
|
|
samplePath: "awk.sample"
|
|
},
|
|
{
|
|
id: "ballerina",
|
|
scopeName: "source.ballerina",
|
|
path: "ballerina.tmLanguage.json",
|
|
displayName: "Ballerina",
|
|
samplePath: "ballerina.sample"
|
|
},
|
|
{
|
|
id: "bat",
|
|
scopeName: "source.batchfile",
|
|
path: "bat.tmLanguage.json",
|
|
displayName: "Batch",
|
|
samplePath: "bat.sample",
|
|
aliases: ["batch"]
|
|
},
|
|
{
|
|
id: "beancount",
|
|
scopeName: "text.beancount",
|
|
path: "beancount.tmLanguage.json",
|
|
displayName: "Beancount",
|
|
samplePath: "beancount.sample"
|
|
},
|
|
{
|
|
id: "berry",
|
|
scopeName: "source.berry",
|
|
path: "berry.tmLanguage.json",
|
|
displayName: "Berry",
|
|
samplePath: "berry.sample",
|
|
aliases: ["be"]
|
|
},
|
|
{
|
|
id: "bibtex",
|
|
scopeName: "text.bibtex",
|
|
path: "bibtex.tmLanguage.json",
|
|
displayName: "BibTeX",
|
|
samplePath: "bibtex.sample"
|
|
},
|
|
{
|
|
id: "bicep",
|
|
scopeName: "source.bicep",
|
|
path: "bicep.tmLanguage.json",
|
|
displayName: "Bicep",
|
|
samplePath: "bicep.sample"
|
|
},
|
|
{
|
|
id: "blade",
|
|
scopeName: "text.html.php.blade",
|
|
path: "blade.tmLanguage.json",
|
|
displayName: "Blade",
|
|
samplePath: "blade.sample",
|
|
embeddedLangs: ["html", "xml", "sql", "javascript", "json", "css"]
|
|
},
|
|
{
|
|
id: "c",
|
|
scopeName: "source.c",
|
|
path: "c.tmLanguage.json",
|
|
displayName: "C",
|
|
samplePath: "c.sample"
|
|
},
|
|
{
|
|
id: "cadence",
|
|
scopeName: "source.cadence",
|
|
path: "cadence.tmLanguage.json",
|
|
displayName: "Cadence",
|
|
samplePath: "cadence.sample",
|
|
aliases: ["cdc"]
|
|
},
|
|
{
|
|
id: "clarity",
|
|
scopeName: "source.clar",
|
|
path: "clarity.tmLanguage.json",
|
|
displayName: "Clarity",
|
|
samplePath: "clarity.sample"
|
|
},
|
|
{
|
|
id: "clojure",
|
|
scopeName: "source.clojure",
|
|
path: "clojure.tmLanguage.json",
|
|
displayName: "Clojure",
|
|
samplePath: "clojure.sample",
|
|
aliases: ["clj"]
|
|
},
|
|
{
|
|
id: "cmake",
|
|
scopeName: "source.cmake",
|
|
path: "cmake.tmLanguage.json",
|
|
displayName: "CMake",
|
|
samplePath: "cmake.sample"
|
|
},
|
|
{
|
|
id: "cobol",
|
|
scopeName: "source.cobol",
|
|
path: "cobol.tmLanguage.json",
|
|
displayName: "COBOL",
|
|
samplePath: "cobol.sample",
|
|
embeddedLangs: ["sql", "html", "java"]
|
|
},
|
|
{
|
|
id: "codeql",
|
|
scopeName: "source.ql",
|
|
path: "codeql.tmLanguage.json",
|
|
displayName: "CodeQL",
|
|
samplePath: "codeql.sample",
|
|
aliases: ["ql"]
|
|
},
|
|
{
|
|
id: "coffee",
|
|
scopeName: "source.coffee",
|
|
path: "coffee.tmLanguage.json",
|
|
displayName: "CoffeeScript",
|
|
samplePath: "coffee.sample",
|
|
embeddedLangs: ["javascript"]
|
|
},
|
|
{
|
|
id: "cpp",
|
|
scopeName: "source.cpp",
|
|
path: "cpp.tmLanguage.json",
|
|
displayName: "C++",
|
|
samplePath: "cpp.sample",
|
|
aliases: ["c++"],
|
|
embeddedLangs: ["glsl", "sql"]
|
|
},
|
|
{
|
|
id: "crystal",
|
|
scopeName: "source.crystal",
|
|
path: "crystal.tmLanguage.json",
|
|
displayName: "Crystal",
|
|
samplePath: "crystal.sample",
|
|
embeddedLangs: ["html", "sql", "css", "c", "javascript", "shellscript"]
|
|
},
|
|
{
|
|
id: "csharp",
|
|
scopeName: "source.cs",
|
|
path: "csharp.tmLanguage.json",
|
|
displayName: "C#",
|
|
samplePath: "csharp.sample",
|
|
aliases: ["c#", "cs"]
|
|
},
|
|
{
|
|
id: "css",
|
|
scopeName: "source.css",
|
|
path: "css.tmLanguage.json",
|
|
displayName: "CSS",
|
|
samplePath: "css.sample"
|
|
},
|
|
{
|
|
id: "csv",
|
|
scopeName: "text.csv",
|
|
path: "csv.tmLanguage.json",
|
|
displayName: "csv syntax",
|
|
samplePath: "csv.sample"
|
|
},
|
|
{
|
|
id: "cue",
|
|
scopeName: "source.cue",
|
|
path: "cue.tmLanguage.json",
|
|
displayName: "CUE",
|
|
samplePath: "cue.sample"
|
|
},
|
|
{
|
|
id: "cypher",
|
|
scopeName: "source.cypher",
|
|
path: "cypher.tmLanguage.json",
|
|
displayName: "Cypher",
|
|
samplePath: "cypher.sample",
|
|
aliases: ["cql"]
|
|
},
|
|
{
|
|
id: "d",
|
|
scopeName: "source.d",
|
|
path: "d.tmLanguage.json",
|
|
displayName: "D",
|
|
samplePath: "d.sample"
|
|
},
|
|
{
|
|
id: "dart",
|
|
scopeName: "source.dart",
|
|
path: "dart.tmLanguage.json",
|
|
displayName: "Dart",
|
|
samplePath: "dart.sample"
|
|
},
|
|
{
|
|
id: "dax",
|
|
scopeName: "source.dax",
|
|
path: "dax.tmLanguage.json",
|
|
displayName: "DAX",
|
|
samplePath: "dax.sample"
|
|
},
|
|
{
|
|
id: "diff",
|
|
scopeName: "source.diff",
|
|
path: "diff.tmLanguage.json",
|
|
displayName: "Diff",
|
|
samplePath: "diff.sample"
|
|
},
|
|
{
|
|
id: "docker",
|
|
scopeName: "source.dockerfile",
|
|
path: "docker.tmLanguage.json",
|
|
displayName: "Docker",
|
|
samplePath: "docker.sample",
|
|
aliases: ["dockerfile"]
|
|
},
|
|
{
|
|
id: "dream-maker",
|
|
scopeName: "source.dm",
|
|
path: "dream-maker.tmLanguage.json",
|
|
displayName: "Dream Maker",
|
|
samplePath: "dream-maker.sample"
|
|
},
|
|
{
|
|
id: "elixir",
|
|
scopeName: "source.elixir",
|
|
path: "elixir.tmLanguage.json",
|
|
displayName: "Elixir",
|
|
samplePath: "elixir.sample",
|
|
embeddedLangs: ["html"]
|
|
},
|
|
{
|
|
id: "elm",
|
|
scopeName: "source.elm",
|
|
path: "elm.tmLanguage.json",
|
|
displayName: "Elm",
|
|
samplePath: "elm.sample",
|
|
embeddedLangs: ["glsl"]
|
|
},
|
|
{
|
|
id: "erb",
|
|
scopeName: "text.html.erb",
|
|
path: "erb.tmLanguage.json",
|
|
displayName: "ERB",
|
|
samplePath: "erb.sample",
|
|
embeddedLangs: ["html", "ruby"]
|
|
},
|
|
{
|
|
id: "erlang",
|
|
scopeName: "source.erlang",
|
|
path: "erlang.tmLanguage.json",
|
|
displayName: "Erlang",
|
|
samplePath: "erlang.sample",
|
|
aliases: ["erl"]
|
|
},
|
|
{
|
|
id: "fish",
|
|
scopeName: "source.fish",
|
|
path: "fish.tmLanguage.json",
|
|
displayName: "Fish",
|
|
samplePath: "fish.sample"
|
|
},
|
|
{
|
|
id: "fsharp",
|
|
scopeName: "source.fsharp",
|
|
path: "fsharp.tmLanguage.json",
|
|
displayName: "F#",
|
|
samplePath: "fsharp.sample",
|
|
aliases: ["f#", "fs"],
|
|
embeddedLangs: ["markdown"]
|
|
},
|
|
{
|
|
id: "gdresource",
|
|
scopeName: "source.gdresource",
|
|
path: "gdresource.tmLanguage.json",
|
|
displayName: "GDResource",
|
|
samplePath: "gdresource.sample",
|
|
embeddedLangs: ["gdshader", "gdscript"]
|
|
},
|
|
{
|
|
id: "gdscript",
|
|
scopeName: "source.gdscript",
|
|
path: "gdscript.tmLanguage.json",
|
|
displayName: "GDScript",
|
|
samplePath: "gdscript.sample"
|
|
},
|
|
{
|
|
id: "gdshader",
|
|
scopeName: "source.gdshader",
|
|
path: "gdshader.tmLanguage.json",
|
|
displayName: "GDShader",
|
|
samplePath: "gdshader.sample"
|
|
},
|
|
{
|
|
id: "gherkin",
|
|
scopeName: "text.gherkin.feature",
|
|
path: "gherkin.tmLanguage.json",
|
|
displayName: "Gherkin",
|
|
samplePath: "gherkin.sample"
|
|
},
|
|
{
|
|
id: "git-commit",
|
|
scopeName: "text.git-commit",
|
|
path: "git-commit.tmLanguage.json",
|
|
displayName: "Git Commit Message",
|
|
embeddedLangs: ["diff"]
|
|
},
|
|
{
|
|
id: "git-rebase",
|
|
scopeName: "text.git-rebase",
|
|
path: "git-rebase.tmLanguage.json",
|
|
displayName: "Git Rebase Message",
|
|
embeddedLangs: ["shellscript"]
|
|
},
|
|
{
|
|
id: "glimmer-js",
|
|
scopeName: "source.gjs",
|
|
path: "glimmer-js.tmLanguage.json",
|
|
displayName: "Glimmer JS",
|
|
aliases: ["gjs"],
|
|
embeddedLangs: ["javascript", "handlebars"]
|
|
},
|
|
{
|
|
id: "glimmer-ts",
|
|
scopeName: "source.gts",
|
|
path: "glimmer-ts.tmLanguage.json",
|
|
displayName: "Glimmer TS",
|
|
aliases: ["gts"],
|
|
embeddedLangs: ["typescript", "handlebars"]
|
|
},
|
|
{
|
|
id: "glsl",
|
|
scopeName: "source.glsl",
|
|
path: "glsl.tmLanguage.json",
|
|
displayName: "GLSL",
|
|
samplePath: "glsl.sample",
|
|
embeddedLangs: ["c"]
|
|
},
|
|
{
|
|
id: "gnuplot",
|
|
scopeName: "source.gnuplot",
|
|
path: "gnuplot.tmLanguage.json",
|
|
displayName: "Gnuplot",
|
|
samplePath: "gnuplot.sample"
|
|
},
|
|
{
|
|
id: "go",
|
|
scopeName: "source.go",
|
|
path: "go.tmLanguage.json",
|
|
displayName: "Go",
|
|
samplePath: "go.sample"
|
|
},
|
|
{
|
|
id: "graphql",
|
|
scopeName: "source.graphql",
|
|
path: "graphql.tmLanguage.json",
|
|
displayName: "GraphQL",
|
|
samplePath: "graphql.sample",
|
|
aliases: ["gql"],
|
|
embeddedLangs: ["javascript", "typescript", "jsx", "tsx"]
|
|
},
|
|
{
|
|
id: "groovy",
|
|
scopeName: "source.groovy",
|
|
path: "groovy.tmLanguage.json",
|
|
displayName: "Groovy",
|
|
samplePath: "groovy.sample"
|
|
},
|
|
{
|
|
id: "hack",
|
|
scopeName: "source.hack",
|
|
path: "hack.tmLanguage.json",
|
|
displayName: "Hack",
|
|
samplePath: "hack.sample",
|
|
embeddedLangs: ["html", "sql"]
|
|
},
|
|
{
|
|
id: "haml",
|
|
scopeName: "text.haml",
|
|
path: "haml.tmLanguage.json",
|
|
displayName: "Ruby Haml",
|
|
samplePath: "haml.sample",
|
|
embeddedLangs: ["ruby", "javascript", "sass", "coffee", "markdown", "css"]
|
|
},
|
|
{
|
|
id: "handlebars",
|
|
scopeName: "text.html.handlebars",
|
|
path: "handlebars.tmLanguage.json",
|
|
displayName: "Handlebars",
|
|
samplePath: "handlebars.sample",
|
|
aliases: ["hbs"],
|
|
embeddedLangs: ["html", "css", "javascript", "yaml"]
|
|
},
|
|
{
|
|
id: "haskell",
|
|
scopeName: "source.haskell",
|
|
path: "haskell.tmLanguage.json",
|
|
displayName: "Haskell",
|
|
samplePath: "haskell.sample",
|
|
aliases: ["hs"]
|
|
},
|
|
{
|
|
id: "hcl",
|
|
scopeName: "source.hcl",
|
|
path: "hcl.tmLanguage.json",
|
|
displayName: "HashiCorp HCL",
|
|
samplePath: "hcl.sample"
|
|
},
|
|
{
|
|
id: "hjson",
|
|
scopeName: "source.hjson",
|
|
path: "hjson.tmLanguage.json",
|
|
displayName: "Hjson",
|
|
samplePath: "hjson.sample"
|
|
},
|
|
{
|
|
id: "hlsl",
|
|
scopeName: "source.hlsl",
|
|
path: "hlsl.tmLanguage.json",
|
|
displayName: "HLSL",
|
|
samplePath: "hlsl.sample"
|
|
},
|
|
{
|
|
id: "html",
|
|
scopeName: "text.html.basic",
|
|
path: "html.tmLanguage.json",
|
|
displayName: "HTML",
|
|
samplePath: "html.sample",
|
|
embeddedLangs: ["javascript", "css"]
|
|
},
|
|
{
|
|
id: "http",
|
|
scopeName: "source.http",
|
|
path: "http.tmLanguage.json",
|
|
displayName: "HTTP",
|
|
samplePath: "http.sample",
|
|
embeddedLangs: ["shellscript", "json", "xml", "graphql"]
|
|
},
|
|
{
|
|
id: "imba",
|
|
scopeName: "source.imba",
|
|
path: "imba.tmLanguage.json",
|
|
displayName: "Imba",
|
|
samplePath: "imba.sample"
|
|
},
|
|
{
|
|
id: "ini",
|
|
scopeName: "source.ini",
|
|
path: "ini.tmLanguage.json",
|
|
displayName: "INI",
|
|
samplePath: "ini.sample",
|
|
aliases: ["properties"]
|
|
},
|
|
{
|
|
id: "java",
|
|
scopeName: "source.java",
|
|
path: "java.tmLanguage.json",
|
|
displayName: "Java",
|
|
samplePath: "java.sample"
|
|
},
|
|
{
|
|
id: "javascript",
|
|
scopeName: "source.js",
|
|
path: "javascript.tmLanguage.json",
|
|
displayName: "JavaScript",
|
|
samplePath: "javascript.sample",
|
|
aliases: ["js"]
|
|
},
|
|
{
|
|
id: "jinja-html",
|
|
scopeName: "text.html.jinja",
|
|
path: "jinja-html.tmLanguage.json",
|
|
displayName: "Jinja",
|
|
samplePath: "jinja-html.sample",
|
|
embeddedLangs: ["html"]
|
|
},
|
|
{
|
|
id: "jison",
|
|
scopeName: "source.jison",
|
|
path: "jison.tmLanguage.json",
|
|
displayName: "Jison",
|
|
samplePath: "jison.sample",
|
|
embeddedLangs: ["javascript"]
|
|
},
|
|
{
|
|
id: "json",
|
|
scopeName: "source.json",
|
|
path: "json.tmLanguage.json",
|
|
displayName: "JSON",
|
|
samplePath: "json.sample"
|
|
},
|
|
{
|
|
id: "json5",
|
|
scopeName: "source.json5",
|
|
path: "json5.tmLanguage.json",
|
|
displayName: "JSON5",
|
|
samplePath: "json5.sample"
|
|
},
|
|
{
|
|
id: "jsonc",
|
|
scopeName: "source.json.comments",
|
|
path: "jsonc.tmLanguage.json",
|
|
displayName: "JSON with Comments",
|
|
samplePath: "jsonc.sample"
|
|
},
|
|
{
|
|
id: "jsonl",
|
|
scopeName: "source.json.lines",
|
|
path: "jsonl.tmLanguage.json",
|
|
displayName: "JSON Lines",
|
|
samplePath: "jsonl.sample"
|
|
},
|
|
{
|
|
id: "jsonnet",
|
|
scopeName: "source.jsonnet",
|
|
path: "jsonnet.tmLanguage.json",
|
|
displayName: "Jsonnet",
|
|
samplePath: "jsonnet.sample"
|
|
},
|
|
{
|
|
id: "jssm",
|
|
scopeName: "source.jssm",
|
|
path: "jssm.tmLanguage.json",
|
|
displayName: "JSSM",
|
|
samplePath: "jssm.sample",
|
|
aliases: ["fsl"]
|
|
},
|
|
{
|
|
id: "jsx",
|
|
scopeName: "source.js.jsx",
|
|
path: "jsx.tmLanguage.json",
|
|
displayName: "JSX",
|
|
samplePath: "jsx.sample"
|
|
},
|
|
{
|
|
id: "julia",
|
|
scopeName: "source.julia",
|
|
path: "julia.tmLanguage.json",
|
|
displayName: "Julia",
|
|
samplePath: "julia.sample",
|
|
embeddedLangs: ["cpp", "python", "javascript", "r", "sql"]
|
|
},
|
|
{
|
|
id: "kotlin",
|
|
scopeName: "source.kotlin",
|
|
path: "kotlin.tmLanguage.json",
|
|
displayName: "Kotlin",
|
|
samplePath: "kotlin.sample",
|
|
aliases: ["kt", "kts"]
|
|
},
|
|
{
|
|
id: "kusto",
|
|
scopeName: "source.kusto",
|
|
path: "kusto.tmLanguage.json",
|
|
displayName: "Kusto",
|
|
samplePath: "kusto.sample",
|
|
aliases: ["kql"]
|
|
},
|
|
{
|
|
id: "latex",
|
|
scopeName: "text.tex.latex",
|
|
path: "latex.tmLanguage.json",
|
|
displayName: "LaTeX",
|
|
samplePath: "latex.sample",
|
|
embeddedLangs: ["tex", "css", "haskell", "html", "xml", "java", "lua", "julia", "ruby", "javascript", "typescript", "python", "yaml", "rust", "scala", "gnuplot"]
|
|
},
|
|
{
|
|
id: "less",
|
|
scopeName: "source.css.less",
|
|
path: "less.tmLanguage.json",
|
|
displayName: "Less",
|
|
samplePath: "less.sample"
|
|
},
|
|
{
|
|
id: "liquid",
|
|
scopeName: "text.html.liquid",
|
|
path: "liquid.tmLanguage.json",
|
|
displayName: "Liquid",
|
|
samplePath: "liquid.sample",
|
|
embeddedLangs: ["html", "css", "json", "javascript"]
|
|
},
|
|
{
|
|
id: "lisp",
|
|
scopeName: "source.lisp",
|
|
path: "lisp.tmLanguage.json",
|
|
displayName: "Lisp",
|
|
samplePath: "lisp.sample"
|
|
},
|
|
{
|
|
id: "logo",
|
|
scopeName: "source.logo",
|
|
path: "logo.tmLanguage.json",
|
|
displayName: "Logo",
|
|
samplePath: "logo.sample"
|
|
},
|
|
{
|
|
id: "lua",
|
|
scopeName: "source.lua",
|
|
path: "lua.tmLanguage.json",
|
|
displayName: "Lua",
|
|
samplePath: "lua.sample",
|
|
embeddedLangs: ["c"]
|
|
},
|
|
{
|
|
id: "make",
|
|
scopeName: "source.makefile",
|
|
path: "make.tmLanguage.json",
|
|
displayName: "Makefile",
|
|
samplePath: "make.sample",
|
|
aliases: ["makefile"]
|
|
},
|
|
{
|
|
id: "markdown",
|
|
scopeName: "text.html.markdown",
|
|
path: "markdown.tmLanguage.json",
|
|
displayName: "Markdown",
|
|
samplePath: "markdown.sample",
|
|
aliases: ["md"],
|
|
embeddedLangs: ["css", "html", "ini", "java", "lua", "make", "perl", "r", "ruby", "php", "sql", "vb", "xml", "xsl", "yaml", "bat", "clojure", "coffee", "c", "cpp", "diff", "docker", "git-commit", "git-rebase", "go", "groovy", "pug", "javascript", "json", "jsonc", "less", "objective-c", "swift", "scss", "raku", "powershell", "python", "julia", "rust", "scala", "shellscript", "typescript", "tsx", "csharp", "fsharp", "dart", "handlebars", "erlang", "elixir", "latex", "bibtex"]
|
|
},
|
|
{
|
|
id: "marko",
|
|
scopeName: "text.marko",
|
|
path: "marko.tmLanguage.json",
|
|
displayName: "Marko",
|
|
samplePath: "marko.sample",
|
|
embeddedLangs: ["css", "less", "scss", "javascript"]
|
|
},
|
|
{
|
|
id: "matlab",
|
|
scopeName: "source.matlab",
|
|
path: "matlab.tmLanguage.json",
|
|
displayName: "MATLAB",
|
|
samplePath: "matlab.sample"
|
|
},
|
|
{
|
|
id: "mdc",
|
|
scopeName: "text.markdown.mdc",
|
|
path: "mdc.tmLanguage.json",
|
|
displayName: "mdc",
|
|
samplePath: "mdc.sample",
|
|
embeddedLangs: ["markdown", "yaml"]
|
|
},
|
|
{
|
|
id: "mdx",
|
|
scopeName: "source.mdx",
|
|
path: "mdx.tmLanguage.json",
|
|
displayName: "MDX",
|
|
samplePath: "mdx.sample",
|
|
embeddedLangs: ["tsx", "toml", "yaml", "c", "clojure", "coffee", "cpp", "csharp", "css", "diff", "docker", "elixir", "elm", "erlang", "go", "graphql", "haskell", "html", "ini", "java", "javascript", "json", "julia", "kotlin", "less", "lua", "make", "markdown", "objective-c", "perl", "python", "r", "ruby", "rust", "scala", "scss", "shellscript", "shellsession", "sql", "xml", "swift", "typescript"]
|
|
},
|
|
{
|
|
id: "mermaid",
|
|
scopeName: "source.mermaid",
|
|
path: "mermaid.tmLanguage.json",
|
|
displayName: "Mermaid",
|
|
samplePath: "mermaid.sample"
|
|
},
|
|
{
|
|
id: "mojo",
|
|
scopeName: "source.mojo",
|
|
path: "mojo.tmLanguage.json",
|
|
displayName: "MagicPython",
|
|
samplePath: "mojo.sample"
|
|
},
|
|
{
|
|
id: "narrat",
|
|
scopeName: "source.narrat",
|
|
path: "narrat.tmLanguage.json",
|
|
displayName: "Narrat Language",
|
|
samplePath: "narrat.sample",
|
|
aliases: ["nar"]
|
|
},
|
|
{
|
|
id: "nextflow",
|
|
scopeName: "source.nextflow",
|
|
path: "nextflow.tmLanguage.json",
|
|
displayName: "Nextflow",
|
|
samplePath: "nextflow.sample",
|
|
aliases: ["nf"]
|
|
},
|
|
{
|
|
id: "nginx",
|
|
scopeName: "source.nginx",
|
|
path: "nginx.tmLanguage.json",
|
|
displayName: "Nginx",
|
|
samplePath: "nginx.sample",
|
|
embeddedLangs: ["lua"]
|
|
},
|
|
{
|
|
id: "nim",
|
|
scopeName: "source.nim",
|
|
path: "nim.tmLanguage.json",
|
|
displayName: "Nim",
|
|
samplePath: "nim.sample",
|
|
embeddedLangs: ["c", "html", "xml", "javascript", "css", "glsl", "markdown"]
|
|
},
|
|
{
|
|
id: "nix",
|
|
scopeName: "source.nix",
|
|
path: "nix.tmLanguage.json",
|
|
displayName: "Nix",
|
|
samplePath: "nix.sample"
|
|
},
|
|
{
|
|
id: "nushell",
|
|
scopeName: "source.nushell",
|
|
path: "nushell.tmLanguage.json",
|
|
displayName: "nushell",
|
|
samplePath: "nushell.sample",
|
|
aliases: ["nu"]
|
|
},
|
|
{
|
|
id: "objective-c",
|
|
scopeName: "source.objc",
|
|
path: "objective-c.tmLanguage.json",
|
|
displayName: "Objective-C",
|
|
samplePath: "objective-c.sample",
|
|
aliases: ["objc"]
|
|
},
|
|
{
|
|
id: "objective-cpp",
|
|
scopeName: "source.objcpp",
|
|
path: "objective-cpp.tmLanguage.json",
|
|
displayName: "Objective-C++",
|
|
samplePath: "objective-cpp.sample"
|
|
},
|
|
{
|
|
id: "ocaml",
|
|
scopeName: "source.ocaml",
|
|
path: "ocaml.tmLanguage.json",
|
|
displayName: "OCaml",
|
|
samplePath: "ocaml.sample"
|
|
},
|
|
{
|
|
id: "pascal",
|
|
scopeName: "source.pascal",
|
|
path: "pascal.tmLanguage.json",
|
|
displayName: "Pascal",
|
|
samplePath: "pascal.sample"
|
|
},
|
|
{
|
|
id: "perl",
|
|
scopeName: "source.perl",
|
|
path: "perl.tmLanguage.json",
|
|
displayName: "Perl",
|
|
samplePath: "perl.sample",
|
|
embeddedLangs: ["html", "xml", "css", "javascript", "sql"]
|
|
},
|
|
{
|
|
id: "php",
|
|
scopeName: "source.php",
|
|
path: "php.tmLanguage.json",
|
|
displayName: "PHP",
|
|
samplePath: "php.sample",
|
|
embeddedLangs: ["html", "xml", "sql", "javascript", "json", "css"]
|
|
},
|
|
{
|
|
id: "plsql",
|
|
scopeName: "source.plsql.oracle",
|
|
path: "plsql.tmLanguage.json",
|
|
displayName: "PL/SQL",
|
|
samplePath: "plsql.sample"
|
|
},
|
|
{
|
|
id: "postcss",
|
|
scopeName: "source.css.postcss",
|
|
path: "postcss.tmLanguage.json",
|
|
displayName: "PostCSS",
|
|
samplePath: "postcss.sample"
|
|
},
|
|
{
|
|
id: "powerquery",
|
|
scopeName: "source.powerquery",
|
|
path: "powerquery.tmLanguage.json",
|
|
displayName: "PowerQuery",
|
|
samplePath: "powerquery.sample"
|
|
},
|
|
{
|
|
id: "powershell",
|
|
scopeName: "source.powershell",
|
|
path: "powershell.tmLanguage.json",
|
|
displayName: "PowerShell",
|
|
samplePath: "powershell.sample",
|
|
aliases: ["ps", "ps1"]
|
|
},
|
|
{
|
|
id: "prisma",
|
|
scopeName: "source.prisma",
|
|
path: "prisma.tmLanguage.json",
|
|
displayName: "Prisma",
|
|
samplePath: "prisma.sample"
|
|
},
|
|
{
|
|
id: "prolog",
|
|
scopeName: "source.prolog",
|
|
path: "prolog.tmLanguage.json",
|
|
displayName: "Prolog",
|
|
samplePath: "prolog.sample"
|
|
},
|
|
{
|
|
id: "proto",
|
|
scopeName: "source.proto",
|
|
path: "proto.tmLanguage.json",
|
|
displayName: "Protocol Buffer 3",
|
|
samplePath: "proto.sample"
|
|
},
|
|
{
|
|
id: "pug",
|
|
scopeName: "text.pug",
|
|
path: "pug.tmLanguage.json",
|
|
displayName: "Pug",
|
|
samplePath: "pug.sample",
|
|
aliases: ["jade"],
|
|
embeddedLangs: ["javascript", "css", "sass", "scss", "stylus", "coffee", "html"]
|
|
},
|
|
{
|
|
id: "puppet",
|
|
scopeName: "source.puppet",
|
|
path: "puppet.tmLanguage.json",
|
|
displayName: "Puppet",
|
|
samplePath: "puppet.sample"
|
|
},
|
|
{
|
|
id: "purescript",
|
|
scopeName: "source.purescript",
|
|
path: "purescript.tmLanguage.json",
|
|
displayName: "PureScript",
|
|
samplePath: "purescript.sample"
|
|
},
|
|
{
|
|
id: "python",
|
|
scopeName: "source.python",
|
|
path: "python.tmLanguage.json",
|
|
displayName: "Python",
|
|
samplePath: "python.sample",
|
|
aliases: ["py"]
|
|
},
|
|
{
|
|
id: "r",
|
|
scopeName: "source.r",
|
|
path: "r.tmLanguage.json",
|
|
displayName: "R",
|
|
samplePath: "r.sample"
|
|
},
|
|
{
|
|
id: "raku",
|
|
scopeName: "source.perl.6",
|
|
path: "raku.tmLanguage.json",
|
|
displayName: "Raku",
|
|
samplePath: "raku.sample",
|
|
aliases: ["perl6"]
|
|
},
|
|
{
|
|
id: "razor",
|
|
scopeName: "text.aspnetcorerazor",
|
|
path: "razor.tmLanguage.json",
|
|
displayName: "ASP.NET Razor",
|
|
samplePath: "razor.sample",
|
|
embeddedLangs: ["html", "csharp"]
|
|
},
|
|
{
|
|
id: "reg",
|
|
scopeName: "source.reg",
|
|
path: "reg.tmLanguage.json",
|
|
displayName: "Windows Registry Script",
|
|
samplePath: "reg.sample"
|
|
},
|
|
{
|
|
id: "rel",
|
|
scopeName: "source.rel",
|
|
path: "rel.tmLanguage.json",
|
|
displayName: "Rel",
|
|
samplePath: "rel.sample"
|
|
},
|
|
{
|
|
id: "riscv",
|
|
scopeName: "source.riscv",
|
|
path: "riscv.tmLanguage.json",
|
|
displayName: "RISC-V",
|
|
samplePath: "riscv.sample"
|
|
},
|
|
{
|
|
id: "rst",
|
|
scopeName: "source.rst",
|
|
path: "rst.tmLanguage.json",
|
|
displayName: "reStructuredText",
|
|
samplePath: "rst.sample",
|
|
embeddedLangs: ["cpp", "python", "javascript", "shellscript", "yaml", "cmake", "ruby"]
|
|
},
|
|
{
|
|
id: "ruby",
|
|
scopeName: "source.ruby",
|
|
path: "ruby.tmLanguage.json",
|
|
displayName: "Ruby",
|
|
samplePath: "ruby.sample",
|
|
aliases: ["rb"],
|
|
embeddedLangs: ["html", "xml", "sql", "css", "c", "javascript", "shellscript", "lua"]
|
|
},
|
|
{
|
|
id: "rust",
|
|
scopeName: "source.rust",
|
|
path: "rust.tmLanguage.json",
|
|
displayName: "Rust",
|
|
samplePath: "rust.sample",
|
|
aliases: ["rs"]
|
|
},
|
|
{
|
|
id: "sas",
|
|
scopeName: "source.sas",
|
|
path: "sas.tmLanguage.json",
|
|
displayName: "SAS",
|
|
samplePath: "sas.sample",
|
|
embeddedLangs: ["sql"]
|
|
},
|
|
{
|
|
id: "sass",
|
|
scopeName: "source.sass",
|
|
path: "sass.tmLanguage.json",
|
|
displayName: "Sass",
|
|
samplePath: "sass.sample"
|
|
},
|
|
{
|
|
id: "scala",
|
|
scopeName: "source.scala",
|
|
path: "scala.tmLanguage.json",
|
|
displayName: "Scala",
|
|
samplePath: "scala.sample"
|
|
},
|
|
{
|
|
id: "scheme",
|
|
scopeName: "source.scheme",
|
|
path: "scheme.tmLanguage.json",
|
|
displayName: "Scheme",
|
|
samplePath: "scheme.sample"
|
|
},
|
|
{
|
|
id: "scss",
|
|
scopeName: "source.css.scss",
|
|
path: "scss.tmLanguage.json",
|
|
displayName: "SCSS",
|
|
samplePath: "scss.sample",
|
|
embeddedLangs: ["css"]
|
|
},
|
|
{
|
|
id: "shaderlab",
|
|
scopeName: "source.shaderlab",
|
|
path: "shaderlab.tmLanguage.json",
|
|
displayName: "ShaderLab",
|
|
samplePath: "shaderlab.sample",
|
|
aliases: ["shader"],
|
|
embeddedLangs: ["hlsl"]
|
|
},
|
|
{
|
|
id: "shellscript",
|
|
scopeName: "source.shell",
|
|
path: "shellscript.tmLanguage.json",
|
|
displayName: "Shell",
|
|
samplePath: "shellscript.sample",
|
|
aliases: ["bash", "sh", "shell", "zsh"]
|
|
},
|
|
{
|
|
id: "shellsession",
|
|
scopeName: "text.shell-session",
|
|
path: "shellsession.tmLanguage.json",
|
|
displayName: "Shell Session",
|
|
samplePath: "shellsession.sample",
|
|
aliases: ["console"],
|
|
embeddedLangs: ["shellscript"]
|
|
},
|
|
{
|
|
id: "smalltalk",
|
|
scopeName: "source.smalltalk",
|
|
path: "smalltalk.tmLanguage.json",
|
|
displayName: "Smalltalk",
|
|
samplePath: "smalltalk.sample"
|
|
},
|
|
{
|
|
id: "solidity",
|
|
scopeName: "source.solidity",
|
|
path: "solidity.tmLanguage.json",
|
|
displayName: "Solidity",
|
|
samplePath: "solidity.sample"
|
|
},
|
|
{
|
|
id: "sparql",
|
|
scopeName: "source.sparql",
|
|
path: "sparql.tmLanguage.json",
|
|
displayName: "SPARQL",
|
|
samplePath: "sparql.sample",
|
|
embeddedLangs: ["turtle"]
|
|
},
|
|
{
|
|
id: "splunk",
|
|
scopeName: "source.splunk_search",
|
|
path: "splunk.tmLanguage.json",
|
|
displayName: "Splunk Query Language",
|
|
samplePath: "splunk.sample",
|
|
aliases: ["spl"]
|
|
},
|
|
{
|
|
id: "sql",
|
|
scopeName: "source.sql",
|
|
path: "sql.tmLanguage.json",
|
|
displayName: "SQL",
|
|
samplePath: "sql.sample"
|
|
},
|
|
{
|
|
id: "ssh-config",
|
|
scopeName: "source.ssh-config",
|
|
path: "ssh-config.tmLanguage.json",
|
|
displayName: "SSH Config",
|
|
samplePath: "ssh-config.sample"
|
|
},
|
|
{
|
|
id: "stata",
|
|
scopeName: "source.stata",
|
|
path: "stata.tmLanguage.json",
|
|
displayName: "Stata",
|
|
samplePath: "stata.sample",
|
|
embeddedLangs: ["sql"]
|
|
},
|
|
{
|
|
id: "stylus",
|
|
scopeName: "source.stylus",
|
|
path: "stylus.tmLanguage.json",
|
|
displayName: "Stylus",
|
|
samplePath: "stylus.sample",
|
|
aliases: ["styl"]
|
|
},
|
|
{
|
|
id: "svelte",
|
|
scopeName: "source.svelte",
|
|
path: "svelte.tmLanguage.json",
|
|
displayName: "Svelte",
|
|
samplePath: "svelte.sample",
|
|
embeddedLangs: ["javascript", "typescript", "coffee", "stylus", "sass", "css", "scss", "less", "postcss", "pug", "markdown"]
|
|
},
|
|
{
|
|
id: "swift",
|
|
scopeName: "source.swift",
|
|
path: "swift.tmLanguage.json",
|
|
displayName: "Swift",
|
|
samplePath: "swift.sample"
|
|
},
|
|
{
|
|
id: "system-verilog",
|
|
scopeName: "source.systemverilog",
|
|
path: "system-verilog.tmLanguage.json",
|
|
displayName: "SystemVerilog",
|
|
samplePath: "system-verilog.sample"
|
|
},
|
|
{
|
|
id: "tasl",
|
|
scopeName: "source.tasl",
|
|
path: "tasl.tmLanguage.json",
|
|
displayName: "Tasl",
|
|
samplePath: "tasl.sample"
|
|
},
|
|
{
|
|
id: "tcl",
|
|
scopeName: "source.tcl",
|
|
path: "tcl.tmLanguage.json",
|
|
displayName: "Tcl",
|
|
samplePath: "tcl.sample"
|
|
},
|
|
{
|
|
id: "tex",
|
|
scopeName: "text.tex",
|
|
path: "tex.tmLanguage.json",
|
|
displayName: "TeX",
|
|
samplePath: "tex.sample",
|
|
embeddedLangs: ["r"]
|
|
},
|
|
{
|
|
id: "toml",
|
|
scopeName: "source.toml",
|
|
path: "toml.tmLanguage.json",
|
|
displayName: "TOML",
|
|
samplePath: "toml.sample"
|
|
},
|
|
{
|
|
id: "tsx",
|
|
scopeName: "source.tsx",
|
|
path: "tsx.tmLanguage.json",
|
|
displayName: "TSX",
|
|
samplePath: "tsx.sample"
|
|
},
|
|
{
|
|
id: "turtle",
|
|
scopeName: "source.turtle",
|
|
path: "turtle.tmLanguage.json",
|
|
displayName: "Turtle",
|
|
samplePath: "turtle.sample"
|
|
},
|
|
{
|
|
id: "twig",
|
|
scopeName: "text.html.twig",
|
|
path: "twig.tmLanguage.json",
|
|
displayName: "Twig",
|
|
samplePath: "twig.sample",
|
|
embeddedLangs: ["css", "javascript", "scss", "php", "python", "ruby"]
|
|
},
|
|
{
|
|
id: "typescript",
|
|
scopeName: "source.ts",
|
|
path: "typescript.tmLanguage.json",
|
|
displayName: "TypeScript",
|
|
samplePath: "typescript.sample",
|
|
aliases: ["ts"]
|
|
},
|
|
{
|
|
id: "v",
|
|
scopeName: "source.v",
|
|
path: "v.tmLanguage.json",
|
|
displayName: "V",
|
|
samplePath: "v.sample"
|
|
},
|
|
{
|
|
id: "vb",
|
|
scopeName: "source.asp.vb.net",
|
|
path: "vb.tmLanguage.json",
|
|
displayName: "Visual Basic",
|
|
samplePath: "vb.sample",
|
|
aliases: ["cmd"]
|
|
},
|
|
{
|
|
id: "verilog",
|
|
scopeName: "source.verilog",
|
|
path: "verilog.tmLanguage.json",
|
|
displayName: "Verilog",
|
|
samplePath: "verilog.sample"
|
|
},
|
|
{
|
|
id: "vhdl",
|
|
scopeName: "source.vhdl",
|
|
path: "vhdl.tmLanguage.json",
|
|
displayName: "VHDL",
|
|
samplePath: "vhdl.sample"
|
|
},
|
|
{
|
|
id: "viml",
|
|
scopeName: "source.viml",
|
|
path: "viml.tmLanguage.json",
|
|
displayName: "Vim Script",
|
|
samplePath: "viml.sample",
|
|
aliases: ["vim", "vimscript"]
|
|
},
|
|
{
|
|
id: "vue-html",
|
|
scopeName: "text.html.vue-html",
|
|
path: "vue-html.tmLanguage.json",
|
|
displayName: "Vue HTML",
|
|
samplePath: "vue-html.sample",
|
|
embeddedLangs: ["vue", "javascript"]
|
|
},
|
|
{
|
|
id: "vue",
|
|
scopeName: "source.vue",
|
|
path: "vue.tmLanguage.json",
|
|
displayName: "Vue",
|
|
samplePath: "vue.sample",
|
|
embeddedLangs: ["html", "markdown", "pug", "stylus", "sass", "css", "scss", "less", "javascript", "typescript", "jsx", "tsx", "json", "jsonc", "json5", "yaml", "toml", "graphql"]
|
|
},
|
|
{
|
|
id: "vyper",
|
|
scopeName: "source.vyper",
|
|
path: "vyper.tmLanguage.json",
|
|
displayName: "Vyper",
|
|
samplePath: "vyper.sample",
|
|
aliases: ["vy"]
|
|
},
|
|
{
|
|
id: "wasm",
|
|
scopeName: "source.wat",
|
|
path: "wasm.tmLanguage.json",
|
|
displayName: "WebAssembly",
|
|
samplePath: "wasm.sample"
|
|
},
|
|
{
|
|
id: "wenyan",
|
|
scopeName: "source.wenyan",
|
|
path: "wenyan.tmLanguage.json",
|
|
displayName: "Wenyan",
|
|
samplePath: "wenyan.sample",
|
|
aliases: ["\u6587\u8A00"]
|
|
},
|
|
{
|
|
id: "wgsl",
|
|
scopeName: "source.wgsl",
|
|
path: "wgsl.tmLanguage.json",
|
|
displayName: "WGSL",
|
|
samplePath: "wgsl.sample"
|
|
},
|
|
{
|
|
id: "wolfram",
|
|
scopeName: "source.wolfram",
|
|
path: "wolfram.tmLanguage.json",
|
|
displayName: "Wolfram",
|
|
samplePath: "wolfram.sample",
|
|
aliases: ["wl"]
|
|
},
|
|
{
|
|
id: "xml",
|
|
scopeName: "text.xml",
|
|
path: "xml.tmLanguage.json",
|
|
displayName: "XML",
|
|
samplePath: "xml.sample",
|
|
embeddedLangs: ["java"]
|
|
},
|
|
{
|
|
id: "xsl",
|
|
scopeName: "text.xml.xsl",
|
|
path: "xsl.tmLanguage.json",
|
|
displayName: "XSL",
|
|
samplePath: "xsl.sample",
|
|
embeddedLangs: ["xml"]
|
|
},
|
|
{
|
|
id: "yaml",
|
|
scopeName: "source.yaml",
|
|
path: "yaml.tmLanguage.json",
|
|
displayName: "YAML",
|
|
samplePath: "yaml.sample",
|
|
aliases: ["yml"]
|
|
},
|
|
{
|
|
id: "zenscript",
|
|
scopeName: "source.zenscript",
|
|
path: "zenscript.tmLanguage.json",
|
|
displayName: "ZenScript",
|
|
samplePath: "zenscript.sample"
|
|
},
|
|
{
|
|
id: "zig",
|
|
scopeName: "source.zig",
|
|
path: "zig.tmLanguage.json",
|
|
displayName: "zig",
|
|
samplePath: "zig.sample"
|
|
}
|
|
];
|
|
|
|
var FontStyle = /* @__PURE__ */ ((FontStyle2) => {
|
|
FontStyle2[FontStyle2["NotSet"] = -1] = "NotSet";
|
|
FontStyle2[FontStyle2["None"] = 0] = "None";
|
|
FontStyle2[FontStyle2["Italic"] = 1] = "Italic";
|
|
FontStyle2[FontStyle2["Bold"] = 2] = "Bold";
|
|
FontStyle2[FontStyle2["Underline"] = 4] = "Underline";
|
|
return FontStyle2;
|
|
})(FontStyle || {});
|
|
class StackElementMetadata {
|
|
static toBinaryStr(metadata) {
|
|
let r = metadata.toString(2);
|
|
while (r.length < 32) {
|
|
r = "0" + r;
|
|
}
|
|
return r;
|
|
}
|
|
static printMetadata(metadata) {
|
|
let languageId = StackElementMetadata.getLanguageId(metadata);
|
|
let tokenType = StackElementMetadata.getTokenType(metadata);
|
|
let fontStyle = StackElementMetadata.getFontStyle(metadata);
|
|
let foreground = StackElementMetadata.getForeground(metadata);
|
|
let background = StackElementMetadata.getBackground(metadata);
|
|
console.log({
|
|
languageId,
|
|
tokenType,
|
|
fontStyle,
|
|
foreground,
|
|
background
|
|
});
|
|
}
|
|
static getLanguageId(metadata) {
|
|
return (metadata & 255 /* LANGUAGEID_MASK */) >>> 0 /* LANGUAGEID_OFFSET */;
|
|
}
|
|
static getTokenType(metadata) {
|
|
return (metadata & 768 /* TOKEN_TYPE_MASK */) >>> 8 /* TOKEN_TYPE_OFFSET */;
|
|
}
|
|
static getFontStyle(metadata) {
|
|
return (metadata & 14336 /* FONT_STYLE_MASK */) >>> 11 /* FONT_STYLE_OFFSET */;
|
|
}
|
|
static getForeground(metadata) {
|
|
return (metadata & 8372224 /* FOREGROUND_MASK */) >>> 15 /* FOREGROUND_OFFSET */;
|
|
}
|
|
static getBackground(metadata) {
|
|
return (metadata & 4286578688 /* BACKGROUND_MASK */) >>> 24 /* BACKGROUND_OFFSET */;
|
|
}
|
|
static containsBalancedBrackets(metadata) {
|
|
return (metadata & 1024 /* BALANCED_BRACKETS_MASK */) !== 0;
|
|
}
|
|
static set(metadata, languageId, tokenType, fontStyle, foreground, background) {
|
|
let _languageId = StackElementMetadata.getLanguageId(metadata);
|
|
let _tokenType = StackElementMetadata.getTokenType(metadata);
|
|
let _fontStyle = StackElementMetadata.getFontStyle(metadata);
|
|
let _foreground = StackElementMetadata.getForeground(metadata);
|
|
let _background = StackElementMetadata.getBackground(metadata);
|
|
let _containsBalancedBracketsBit = StackElementMetadata.containsBalancedBrackets(
|
|
metadata
|
|
) ? 1 : 0;
|
|
if (languageId !== 0) {
|
|
_languageId = languageId;
|
|
}
|
|
if (tokenType !== 0 /* Other */) {
|
|
_tokenType = tokenType === 8 /* MetaEmbedded */ ? 0 /* Other */ : tokenType;
|
|
}
|
|
if (fontStyle !== -1 /* NotSet */) {
|
|
_fontStyle = fontStyle;
|
|
}
|
|
if (foreground !== 0) {
|
|
_foreground = foreground;
|
|
}
|
|
if (background !== 0) {
|
|
_background = background;
|
|
}
|
|
return (_languageId << 0 /* LANGUAGEID_OFFSET */ | _tokenType << 8 /* TOKEN_TYPE_OFFSET */ | _fontStyle << 11 /* FONT_STYLE_OFFSET */ | _containsBalancedBracketsBit << 10 /* BALANCED_BRACKETS_OFFSET */ | _foreground << 15 /* FOREGROUND_OFFSET */ | _background << 24 /* BACKGROUND_OFFSET */) >>> 0;
|
|
}
|
|
}
|
|
|
|
function trimEndSlash(str) {
|
|
if (str.endsWith("/") || str.endsWith("\\"))
|
|
return str.slice(0, -1);
|
|
return str;
|
|
}
|
|
function trimStartDot(str) {
|
|
if (str.startsWith("./"))
|
|
return str.slice(2);
|
|
return str;
|
|
}
|
|
function dirpathparts(str) {
|
|
const parts = str.split(/[\/\\]/g);
|
|
return parts.slice(0, parts.length - 1);
|
|
}
|
|
function join(...parts) {
|
|
return parts.map(trimEndSlash).map(trimStartDot).join("/");
|
|
}
|
|
function groupBy(elements, keyGetter) {
|
|
const map = /* @__PURE__ */ new Map();
|
|
for (const element of elements) {
|
|
const key = keyGetter(element);
|
|
if (map.has(key)) {
|
|
const group = map.get(key);
|
|
group.push(element);
|
|
} else {
|
|
map.set(key, [element]);
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
/**
|
|
* Creates a JSON scanner on the given text.
|
|
* If ignoreTrivia is set, whitespaces or comments are ignored.
|
|
*/
|
|
function createScanner(text, ignoreTrivia = false) {
|
|
const len = text.length;
|
|
let pos = 0, value = '', tokenOffset = 0, token = 16 /* SyntaxKind.Unknown */, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0 /* ScanError.None */;
|
|
function scanHexDigits(count, exact) {
|
|
let digits = 0;
|
|
let value = 0;
|
|
while (digits < count || !exact) {
|
|
let ch = text.charCodeAt(pos);
|
|
if (ch >= 48 /* CharacterCodes._0 */ && ch <= 57 /* CharacterCodes._9 */) {
|
|
value = value * 16 + ch - 48 /* CharacterCodes._0 */;
|
|
}
|
|
else if (ch >= 65 /* CharacterCodes.A */ && ch <= 70 /* CharacterCodes.F */) {
|
|
value = value * 16 + ch - 65 /* CharacterCodes.A */ + 10;
|
|
}
|
|
else if (ch >= 97 /* CharacterCodes.a */ && ch <= 102 /* CharacterCodes.f */) {
|
|
value = value * 16 + ch - 97 /* CharacterCodes.a */ + 10;
|
|
}
|
|
else {
|
|
break;
|
|
}
|
|
pos++;
|
|
digits++;
|
|
}
|
|
if (digits < count) {
|
|
value = -1;
|
|
}
|
|
return value;
|
|
}
|
|
function setPosition(newPosition) {
|
|
pos = newPosition;
|
|
value = '';
|
|
tokenOffset = 0;
|
|
token = 16 /* SyntaxKind.Unknown */;
|
|
scanError = 0 /* ScanError.None */;
|
|
}
|
|
function scanNumber() {
|
|
let start = pos;
|
|
if (text.charCodeAt(pos) === 48 /* CharacterCodes._0 */) {
|
|
pos++;
|
|
}
|
|
else {
|
|
pos++;
|
|
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
pos++;
|
|
}
|
|
}
|
|
if (pos < text.length && text.charCodeAt(pos) === 46 /* CharacterCodes.dot */) {
|
|
pos++;
|
|
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
pos++;
|
|
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
pos++;
|
|
}
|
|
}
|
|
else {
|
|
scanError = 3 /* ScanError.UnexpectedEndOfNumber */;
|
|
return text.substring(start, pos);
|
|
}
|
|
}
|
|
let end = pos;
|
|
if (pos < text.length && (text.charCodeAt(pos) === 69 /* CharacterCodes.E */ || text.charCodeAt(pos) === 101 /* CharacterCodes.e */)) {
|
|
pos++;
|
|
if (pos < text.length && text.charCodeAt(pos) === 43 /* CharacterCodes.plus */ || text.charCodeAt(pos) === 45 /* CharacterCodes.minus */) {
|
|
pos++;
|
|
}
|
|
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
pos++;
|
|
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
pos++;
|
|
}
|
|
end = pos;
|
|
}
|
|
else {
|
|
scanError = 3 /* ScanError.UnexpectedEndOfNumber */;
|
|
}
|
|
}
|
|
return text.substring(start, end);
|
|
}
|
|
function scanString() {
|
|
let result = '', start = pos;
|
|
while (true) {
|
|
if (pos >= len) {
|
|
result += text.substring(start, pos);
|
|
scanError = 2 /* ScanError.UnexpectedEndOfString */;
|
|
break;
|
|
}
|
|
const ch = text.charCodeAt(pos);
|
|
if (ch === 34 /* CharacterCodes.doubleQuote */) {
|
|
result += text.substring(start, pos);
|
|
pos++;
|
|
break;
|
|
}
|
|
if (ch === 92 /* CharacterCodes.backslash */) {
|
|
result += text.substring(start, pos);
|
|
pos++;
|
|
if (pos >= len) {
|
|
scanError = 2 /* ScanError.UnexpectedEndOfString */;
|
|
break;
|
|
}
|
|
const ch2 = text.charCodeAt(pos++);
|
|
switch (ch2) {
|
|
case 34 /* CharacterCodes.doubleQuote */:
|
|
result += '\"';
|
|
break;
|
|
case 92 /* CharacterCodes.backslash */:
|
|
result += '\\';
|
|
break;
|
|
case 47 /* CharacterCodes.slash */:
|
|
result += '/';
|
|
break;
|
|
case 98 /* CharacterCodes.b */:
|
|
result += '\b';
|
|
break;
|
|
case 102 /* CharacterCodes.f */:
|
|
result += '\f';
|
|
break;
|
|
case 110 /* CharacterCodes.n */:
|
|
result += '\n';
|
|
break;
|
|
case 114 /* CharacterCodes.r */:
|
|
result += '\r';
|
|
break;
|
|
case 116 /* CharacterCodes.t */:
|
|
result += '\t';
|
|
break;
|
|
case 117 /* CharacterCodes.u */:
|
|
const ch3 = scanHexDigits(4, true);
|
|
if (ch3 >= 0) {
|
|
result += String.fromCharCode(ch3);
|
|
}
|
|
else {
|
|
scanError = 4 /* ScanError.InvalidUnicode */;
|
|
}
|
|
break;
|
|
default:
|
|
scanError = 5 /* ScanError.InvalidEscapeCharacter */;
|
|
}
|
|
start = pos;
|
|
continue;
|
|
}
|
|
if (ch >= 0 && ch <= 0x1f) {
|
|
if (isLineBreak(ch)) {
|
|
result += text.substring(start, pos);
|
|
scanError = 2 /* ScanError.UnexpectedEndOfString */;
|
|
break;
|
|
}
|
|
else {
|
|
scanError = 6 /* ScanError.InvalidCharacter */;
|
|
// mark as error but continue with string
|
|
}
|
|
}
|
|
pos++;
|
|
}
|
|
return result;
|
|
}
|
|
function scanNext() {
|
|
value = '';
|
|
scanError = 0 /* ScanError.None */;
|
|
tokenOffset = pos;
|
|
lineStartOffset = lineNumber;
|
|
prevTokenLineStartOffset = tokenLineStartOffset;
|
|
if (pos >= len) {
|
|
// at the end
|
|
tokenOffset = len;
|
|
return token = 17 /* SyntaxKind.EOF */;
|
|
}
|
|
let code = text.charCodeAt(pos);
|
|
// trivia: whitespace
|
|
if (isWhiteSpace(code)) {
|
|
do {
|
|
pos++;
|
|
value += String.fromCharCode(code);
|
|
code = text.charCodeAt(pos);
|
|
} while (isWhiteSpace(code));
|
|
return token = 15 /* SyntaxKind.Trivia */;
|
|
}
|
|
// trivia: newlines
|
|
if (isLineBreak(code)) {
|
|
pos++;
|
|
value += String.fromCharCode(code);
|
|
if (code === 13 /* CharacterCodes.carriageReturn */ && text.charCodeAt(pos) === 10 /* CharacterCodes.lineFeed */) {
|
|
pos++;
|
|
value += '\n';
|
|
}
|
|
lineNumber++;
|
|
tokenLineStartOffset = pos;
|
|
return token = 14 /* SyntaxKind.LineBreakTrivia */;
|
|
}
|
|
switch (code) {
|
|
// tokens: []{}:,
|
|
case 123 /* CharacterCodes.openBrace */:
|
|
pos++;
|
|
return token = 1 /* SyntaxKind.OpenBraceToken */;
|
|
case 125 /* CharacterCodes.closeBrace */:
|
|
pos++;
|
|
return token = 2 /* SyntaxKind.CloseBraceToken */;
|
|
case 91 /* CharacterCodes.openBracket */:
|
|
pos++;
|
|
return token = 3 /* SyntaxKind.OpenBracketToken */;
|
|
case 93 /* CharacterCodes.closeBracket */:
|
|
pos++;
|
|
return token = 4 /* SyntaxKind.CloseBracketToken */;
|
|
case 58 /* CharacterCodes.colon */:
|
|
pos++;
|
|
return token = 6 /* SyntaxKind.ColonToken */;
|
|
case 44 /* CharacterCodes.comma */:
|
|
pos++;
|
|
return token = 5 /* SyntaxKind.CommaToken */;
|
|
// strings
|
|
case 34 /* CharacterCodes.doubleQuote */:
|
|
pos++;
|
|
value = scanString();
|
|
return token = 10 /* SyntaxKind.StringLiteral */;
|
|
// comments
|
|
case 47 /* CharacterCodes.slash */:
|
|
const start = pos - 1;
|
|
// Single-line comment
|
|
if (text.charCodeAt(pos + 1) === 47 /* CharacterCodes.slash */) {
|
|
pos += 2;
|
|
while (pos < len) {
|
|
if (isLineBreak(text.charCodeAt(pos))) {
|
|
break;
|
|
}
|
|
pos++;
|
|
}
|
|
value = text.substring(start, pos);
|
|
return token = 12 /* SyntaxKind.LineCommentTrivia */;
|
|
}
|
|
// Multi-line comment
|
|
if (text.charCodeAt(pos + 1) === 42 /* CharacterCodes.asterisk */) {
|
|
pos += 2;
|
|
const safeLength = len - 1; // For lookahead.
|
|
let commentClosed = false;
|
|
while (pos < safeLength) {
|
|
const ch = text.charCodeAt(pos);
|
|
if (ch === 42 /* CharacterCodes.asterisk */ && text.charCodeAt(pos + 1) === 47 /* CharacterCodes.slash */) {
|
|
pos += 2;
|
|
commentClosed = true;
|
|
break;
|
|
}
|
|
pos++;
|
|
if (isLineBreak(ch)) {
|
|
if (ch === 13 /* CharacterCodes.carriageReturn */ && text.charCodeAt(pos) === 10 /* CharacterCodes.lineFeed */) {
|
|
pos++;
|
|
}
|
|
lineNumber++;
|
|
tokenLineStartOffset = pos;
|
|
}
|
|
}
|
|
if (!commentClosed) {
|
|
pos++;
|
|
scanError = 1 /* ScanError.UnexpectedEndOfComment */;
|
|
}
|
|
value = text.substring(start, pos);
|
|
return token = 13 /* SyntaxKind.BlockCommentTrivia */;
|
|
}
|
|
// just a single slash
|
|
value += String.fromCharCode(code);
|
|
pos++;
|
|
return token = 16 /* SyntaxKind.Unknown */;
|
|
// numbers
|
|
case 45 /* CharacterCodes.minus */:
|
|
value += String.f |