Skip to content

Build your personal knowledge base with Trilium Notes

chore(code): define legacy mappings

Elian Doran5a07d5a91315
diff --git a/packages/codemirror/src/syntax_highlighting.ts b/packages/codemirror/src/syntax_highlighting.ts
index 2a59472ca5..0e679b762b 100644
--- a/packages/codemirror/src/syntax_highlighting.ts
+++ b/packages/codemirror/src/syntax_highlighting.ts
@@ -1,167 +1,165 @@
-import { type Extension } from '@codemirror/state';
import { type StreamParser } from "@codemirror/language"
const mappings: Record<string, (() => Promise<StreamParser<unknown>>) | null> = {
"text/plain": null,
"text/apl": async () => (await import('@codemirror/legacy-modes/mode/apl')).apl,
- "text/x-ttcn-asn": null,
+ "text/x-ttcn-asn": async () => (await import('@codemirror/legacy-modes/mode/ttcn')).ttcn,
"application/x-aspx": null,
- "text/x-asterisk": null,
+ "text/x-asterisk": async () => (await import('@codemirror/legacy-modes/mode/asterisk')).asterisk,
"application/x-bat": null,
- "text/x-brainfuck": null,
- "text/x-csrc": null,
- "text/x-csharp": null,
- "text/x-c++src": null,
- "text/x-clojure": null,
+ "text/x-brainfuck": async () => (await import('@codemirror/legacy-modes/mode/brainfuck')).brainfuck,
+ "text/x-csrc": async () => (await import('@codemirror/legacy-modes/mode/clike')).c,
+ "text/x-csharp": async () => (await import('@codemirror/legacy-modes/mode/clike')).csharp,
+ "text/x-c++src": async () => (await import('@codemirror/legacy-modes/mode/clike')).cpp,
+ "text/x-clojure": async () => (await import('@codemirror/legacy-modes/mode/clojure')).clojure,
"text/x-clojurescript": null,
- "text/x-gss": null,
- "text/x-cmake": null,
- "text/x-cobol": null,
- "text/coffeescript": null,
- "text/x-common-lisp": null,
- "text/x-cassandra": null,
- "text/x-crystal": null,
- "text/css": null,
- "application/x-cypher-query": null,
- "text/x-cython": null,
- "text/x-d": null,
- "application/dart": null,
- "text/x-diff": null,
+ "text/x-gss": async () => (await import('@codemirror/legacy-modes/mode/css')).gss,
+ "text/x-cmake": async () => (await import('@codemirror/legacy-modes/mode/cmake')).cmake,
+ "text/x-cobol": async () => (await import('@codemirror/legacy-modes/mode/cobol')).cobol,
+ "text/coffeescript": async () => (await import('@codemirror/legacy-modes/mode/coffeescript')).coffeeScript,
+ "text/x-common-lisp": async () => (await import('@codemirror/legacy-modes/mode/commonlisp')).commonLisp,
+ "text/x-cassandra": async () => (await import('@codemirror/legacy-modes/mode/sql')).cassandra,
+ "text/x-crystal": async () => (await import('@codemirror/legacy-modes/mode/crystal')).crystal,
+ "text/css": async () => (await import('@codemirror/legacy-modes/mode/css')).css,
+ "application/x-cypher-query": async () => (await import('@codemirror/legacy-modes/mode/cypher')).cypher,
+ "text/x-cython": async () => (await import('@codemirror/legacy-modes/mode/python')).cython,
+ "text/x-d": async () => (await import('@codemirror/legacy-modes/mode/d')).d,
+ "application/dart": async () => (await import('@codemirror/legacy-modes/mode/clike')).dart,
+ "text/x-diff": async () => (await import('@codemirror/legacy-modes/mode/diff')).diff,
"text/x-django": null,
- "text/x-dockerfile": null,
- "application/xml-dtd": null,
- "text/x-dylan": null,
- "text/x-ebnf": null,
- "text/x-ecl": null,
+ "text/x-dockerfile": async () => (await import('@codemirror/legacy-modes/mode/dockerfile')).dockerFile,
+ "application/xml-dtd": async () => (await import('@codemirror/legacy-modes/mode/xml')).xml,
+ "text/x-dylan": async () => (await import('@codemirror/legacy-modes/mode/dylan')).dylan,
+ "text/x-ebnf": async () => (await import('@codemirror/legacy-modes/mode/ebnf')).ebnf,
+ "text/x-ecl": async () => (await import('@codemirror/legacy-modes/mode/ecl')).ecl,
"application/edn": null,
- "text/x-eiffel": null,
- "text/x-elm": null,
+ "text/x-eiffel": async () => (await import('@codemirror/legacy-modes/mode/eiffel')).eiffel,
+ "text/x-elm": async () => (await import('@codemirror/legacy-modes/mode/elm')).elm,
"application/x-ejs": null,
"application/x-erb": null,
- "text/x-erlang": null,
- "text/x-esper": null,
- "text/x-fsharp": null,
- "text/x-factor": null,
- "text/x-fcl": null,
- "text/x-forth": null,
- "text/x-fortran": null,
- "text/x-gas": null,
+ "text/x-erlang": async () => (await import('@codemirror/legacy-modes/mode/erlang')).erlang,
+ "text/x-esper": async () => (await import('@codemirror/legacy-modes/mode/sql')).esper,
+ "text/x-fsharp": async () => (await import('@codemirror/legacy-modes/mode/mllike')).fSharp,
+ "text/x-factor": async () => (await import('@codemirror/legacy-modes/mode/factor')).factor,
+ "text/x-fcl": async () => (await import('@codemirror/legacy-modes/mode/fcl')).fcl,
+ "text/x-forth": async () => (await import('@codemirror/legacy-modes/mode/forth')).forth,
+ "text/x-fortran": async () => (await import('@codemirror/legacy-modes/mode/fortran')).fortran,
+ "text/x-gas": async () => (await import('@codemirror/legacy-modes/mode/gas')).gas,
"text/x-feature": null,
"text/x-gfm": null,
- "text/x-go": null,
- "text/x-groovy": null,
+ "text/x-go": async () => (await import('@codemirror/legacy-modes/mode/go')).go,
+ "text/x-groovy": async () => (await import('@codemirror/legacy-modes/mode/groovy')).groovy,
"text/x-haml": null,
"text/x-literate-haskell": null,
- "text/x-haskell": null,
- "text/x-haxe": null,
- "text/html": null,
- "message/http": null,
- "text/x-hxml": null,
- "text/x-idl": null,
+ "text/x-haskell": async () => (await import('@codemirror/legacy-modes/mode/haskell')).haskell,
+ "text/x-haxe": async () => (await import('@codemirror/legacy-modes/mode/haxe')).haxe,
+ "text/html": async () => (await import('@codemirror/legacy-modes/mode/xml')).html,
+ "message/http": async () => (await import('@codemirror/legacy-modes/mode/http')).http,
+ "text/x-hxml": async () => (await import('@codemirror/legacy-modes/mode/haxe')).hxml,
+ "text/x-idl": async () => (await import('@codemirror/legacy-modes/mode/idl')).idl,
"application/x-jsp": null,
- "text/x-java": null,
- "text/jinja2": null,
- "application/javascript;env=backend": null,
- "application/javascript;env=frontend": null,
- "application/ld+json": null,
- "application/json": null,
+ "text/x-java": async () => (await import('@codemirror/legacy-modes/mode/clike')).java,
+ "text/jinja2": async () => (await import('@codemirror/legacy-modes/mode/jinja2')).jinja2,
+ "application/javascript;env=backend": async () => (await import('@codemirror/legacy-modes/mode/javascript')).javascript,
+ "application/javascript;env=frontend": async () => (await import('@codemirror/legacy-modes/mode/javascript')).javascript,
+ "application/ld+json": async () => (await import('@codemirror/legacy-modes/mode/javascript')).jsonld,
+ "application/json": async () => (await import('@codemirror/legacy-modes/mode/javascript')).json,
"text/jsx": null,
- "text/x-julia": null,
- "text/x-kotlin": null,
+ "text/x-julia": async () => (await import('@codemirror/legacy-modes/mode/julia')).julia,
+ "text/x-kotlin": async () => (await import('@codemirror/legacy-modes/mode/clike')).kotlin,
"text/x-latex": null,
- "text/x-less": null,
- "text/x-livescript": null,
- "text/x-lua": null,
- "text/x-mariadb": null,
+ "text/x-less": async () => (await import('@codemirror/legacy-modes/mode/css')).less,
+ "text/x-livescript": async () => (await import('@codemirror/legacy-modes/mode/livescript')).liveScript,
+ "text/x-lua": async () => (await import('@codemirror/legacy-modes/mode/lua')).lua,
+ "text/x-mariadb": async () => (await import('@codemirror/legacy-modes/mode/sql')).sqlite,
"text/x-markdown": null,
- "text/x-mathematica": null,
- "application/mbox": null,
+ "text/x-mathematica": async () => (await import('@codemirror/legacy-modes/mode/mathematica')).mathematica,
+ "application/mbox": async () => (await import('@codemirror/legacy-modes/mode/mbox')).mbox,
"text/x-asm-mips": null,
- "text/mirc": null,
- "text/x-modelica": null,
- "text/x-mssql": null,
- "text/x-mscgen": null,
- "text/x-msgenny": null,
- "text/x-mumps": null,
- "text/x-mysql": null,
- "text/x-nginx-conf": null,
- "text/x-nsis": null,
- "application/n-triples": null,
- "text/x-objectivec": null,
- "text/x-ocaml": null,
- "text/x-octave": null,
- "text/x-oz": null,
- "text/x-pascal": null,
- "null": null,
- "text/x-perl": null,
+ "text/mirc": async () => (await import('@codemirror/legacy-modes/mode/mirc')).mirc,
+ "text/x-modelica": async () => (await import('@codemirror/legacy-modes/mode/modelica')).modelica,
+ "text/x-mssql": async () => (await import('@codemirror/legacy-modes/mode/sql')).msSQL,
+ "text/x-mscgen": async () => (await import('@codemirror/legacy-modes/mode/mscgen')).mscgen,
+ "text/x-msgenny": async () => (await import('@codemirror/legacy-modes/mode/mscgen')).msgenny,
+ "text/x-mumps": async () => (await import('@codemirror/legacy-modes/mode/mumps')).mumps,
+ "text/x-mysql": async () => (await import('@codemirror/legacy-modes/mode/sql')).mySQL,
+ "text/x-nginx-conf": async () => (await import('@codemirror/legacy-modes/mode/nginx')).nginx,
+ "text/x-nsis": async () => (await import('@codemirror/legacy-modes/mode/nsis')).nsis,
+ "application/n-triples": async () => (await import('@codemirror/legacy-modes/mode/ntriples')).ntriples,
+ "text/x-objectivec": async () => (await import('@codemirror/legacy-modes/mode/clike')).objectiveC,
+ "text/x-ocaml": async () => (await import('@codemirror/legacy-modes/mode/mllike')).oCaml,
+ "text/x-octave": async () => (await import('@codemirror/legacy-modes/mode/octave')).octave,
+ "text/x-oz": async () => (await import('@codemirror/legacy-modes/mode/oz')).oz,
+ "text/x-pascal": async () => (await import('@codemirror/legacy-modes/mode/pascal')).pascal,
+ "text/x-perl": async () => (await import('@codemirror/legacy-modes/mode/perl')).perl,
"application/pgp": null,
"text/x-php": null,
- "text/x-pig": null,
- "text/x-plsql": null,
- "text/x-pgsql": null,
- "application/x-powershell": null,
- "text/x-properties": null,
- "text/x-protobuf": null,
- "text/x-pug": null,
- "text/x-puppet": null,
- "text/x-python": null,
- "text/x-q": null,
+ "text/x-pig": async () => (await import('@codemirror/legacy-modes/mode/pig')).pig,
+ "text/x-plsql": async () => (await import('@codemirror/legacy-modes/mode/sql')).plSQL,
+ "text/x-pgsql": async () => (await import('@codemirror/legacy-modes/mode/sql')).pgSQL,
+ "application/x-powershell": async () => (await import('@codemirror/legacy-modes/mode/powershell')).powerShell,
+ "text/x-properties": async () => (await import('@codemirror/legacy-modes/mode/properties')).properties,
+ "text/x-protobuf": async () => (await import('@codemirror/legacy-modes/mode/protobuf')).protobuf,
+ "text/x-pug": async () => (await import('@codemirror/legacy-modes/mode/pug')).pug,
+ "text/x-puppet": async () => (await import('@codemirror/legacy-modes/mode/puppet')).puppet,
+ "text/x-python": async () => (await import('@codemirror/legacy-modes/mode/python')).python,
+ "text/x-q": async () => (await import('@codemirror/legacy-modes/mode/q')).q,
"text/x-rsrc": null,
"text/x-rst": null,
- "text/x-rpm-changes": null,
- "text/x-rpm-spec": null,
- "text/x-ruby": null,
- "text/x-rustsrc": null,
- "text/x-sas": null,
- "text/x-sass": null,
- "text/x-scala": null,
- "text/x-scheme": null,
- "text/x-scss": null,
- "text/x-sh": null,
- "application/sieve": null,
+ "text/x-rpm-changes": async () => (await import('@codemirror/legacy-modes/mode/rpm')).rpmChanges,
+ "text/x-rpm-spec": async () => (await import('@codemirror/legacy-modes/mode/rpm')).rpmSpec,
+ "text/x-ruby": async () => (await import('@codemirror/legacy-modes/mode/ruby')).ruby,
+ "text/x-rustsrc": async () => (await import('@codemirror/legacy-modes/mode/rust')).rust,
+ "text/x-sas": async () => (await import('@codemirror/legacy-modes/mode/sas')).sas,
+ "text/x-sass": async () => (await import('@codemirror/legacy-modes/mode/sass')).sass,
+ "text/x-scala": async () => (await import('@codemirror/legacy-modes/mode/clike')).scala,
+ "text/x-scheme": async () => (await import('@codemirror/legacy-modes/mode/scheme')).scheme,
+ "text/x-scss": async () => (await import('@codemirror/legacy-modes/mode/css')).sCSS,
+ "text/x-sh": async () => (await import('@codemirror/legacy-modes/mode/shell')).shell,
+ "application/sieve": async () => (await import('@codemirror/legacy-modes/mode/sieve')).sieve,
"text/x-slim": null,
"text/x-stsrc": null,
"text/x-smarty": null,
- "text/x-sml": null,
- "text/x-solr": null,
+ "text/x-sml": async () => (await import('@codemirror/legacy-modes/mode/mllike')).sml,
+ "text/x-solr": async () => (await import('@codemirror/legacy-modes/mode/solr')).solr,
"text/x-soy": null,
- "application/sparql-query": null,
- "text/x-spreadsheet": null,
- "text/x-sql": null,
- "text/x-sqlite;schema=trilium": null,
- "text/x-sqlite": null,
- "text/x-squirrel": null,
- "text/x-stex": null,
- "text/x-styl": null,
- "text/x-swift": null,
+ "application/sparql-query": async () => (await import('@codemirror/legacy-modes/mode/sparql')).sparql,
+ "text/x-spreadsheet": async () => (await import('@codemirror/legacy-modes/mode/spreadsheet')).spreadsheet,
+ "text/x-sql": async () => (await import('@codemirror/legacy-modes/mode/sql')).mySQL,
+ "text/x-sqlite;schema=trilium": async () => (await import('@codemirror/legacy-modes/mode/sql')).sqlite,
+ "text/x-sqlite": async () => (await import('@codemirror/legacy-modes/mode/sql')).sqlite,
+ "text/x-squirrel": async () => (await import('@codemirror/legacy-modes/mode/clike')).squirrel,
+ "text/x-stex": async () => (await import('@codemirror/legacy-modes/mode/stex')).stex,
+ "text/x-styl": async () => (await import('@codemirror/legacy-modes/mode/stylus')).stylus,
+ "text/x-swift": async () => (await import('@codemirror/legacy-modes/mode/swift')).swift,
"text/x-systemverilog": null,
- "text/x-tcl": null,
+ "text/x-tcl": async () => (await import('@codemirror/legacy-modes/mode/tcl')).tcl,
"text/x-hcl": null,
- "text/x-textile": null,
- "text/x-tiddlywiki": null,
- "text/tiki": null,
- "text/x-toml": null,
+ "text/x-textile": async () => (await import('@codemirror/legacy-modes/mode/textile')).textile,
+ "text/x-tiddlywiki": async () => (await import('@codemirror/legacy-modes/mode/tiddlywiki')).tiddlyWiki,
+ "text/tiki": async () => (await import('@codemirror/legacy-modes/mode/tiki')).tiki,
+ "text/x-toml": async () => (await import('@codemirror/legacy-modes/mode/toml')).toml,
"text/x-tornado": null,
- "text/troff": null,
- "text/x-ttcn-cfg": null,
- "text/x-ttcn": null,
- "text/turtle": null,
+ "text/troff": async () => (await import('@codemirror/legacy-modes/mode/troff')).troff,
+ "text/x-ttcn-cfg": async () => (await import('@codemirror/legacy-modes/mode/ttcn-cfg')).ttcnCfg,
+ "text/x-ttcn": async () => (await import('@codemirror/legacy-modes/mode/ttcn')).ttcn,
+ "text/turtle": async () => (await import('@codemirror/legacy-modes/mode/turtle')).turtle,
"text/x-twig": null,
"text/typescript-jsx": null,
- "application/typescript": null,
- "text/x-vb": null,
- "text/vbscript": null,
- "text/velocity": null,
- "text/x-verilog": null,
- "text/x-vhdl": null,
+ "application/typescript": async () => (await import('@codemirror/legacy-modes/mode/javascript')).typescript,
+ "text/x-vb": async () => (await import('@codemirror/legacy-modes/mode/vb')).vb,
+ "text/vbscript": async () => (await import('@codemirror/legacy-modes/mode/vbscript')).vbScript,
+ "text/velocity": async () => (await import('@codemirror/legacy-modes/mode/velocity')).velocity,
+ "text/x-verilog": async () => (await import('@codemirror/legacy-modes/mode/verilog')).verilog,
+ "text/x-vhdl": async () => (await import('@codemirror/legacy-modes/mode/vhdl')).vhdl,
"text/x-vue": null,
- "text/x-webidl": null,
- "text/xml": null,
- "application/xquery": null,
- "text/x-xu": null,
- "text/x-yacas": null,
- "text/x-yaml": null,
- "text/x-z80": null
+ "text/x-webidl": async () => (await import('@codemirror/legacy-modes/mode/webidl')).webIDL,
+ "text/xml": async () => (await import('@codemirror/legacy-modes/mode/xml')).xml,
+ "application/xquery": async () => (await import('@codemirror/legacy-modes/mode/xquery')).xQuery,
+ "text/x-xu": async () => (await import('@codemirror/legacy-modes/mode/mscgen')).xu,
+ "text/x-yacas": async () => (await import('@codemirror/legacy-modes/mode/yacas')).yacas,
+ "text/x-yaml": async () => (await import('@codemirror/legacy-modes/mode/yaml')).yaml,
+ "text/x-z80": async () => (await import('@codemirror/legacy-modes/mode/z80')).z80
}
export default mappings;