diff --git a/README.md b/README.md index 26cfc944..247dddf4 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Available for Mac, Windows, and Linux. - Block-based - Syntax highlighting: - C++, C#, Clojure, CSS, Erlang, Dart, Go, Groovy, HTML, Java, JavaScript, JSX, Kotlin, TypeScript, TOML, TSX, JSON, Lezer, Markdown, PHP, Python, Ruby, Rust, Shell, SQL, Swift, Vue, XML, YAML + C++, C#, Clojure, CSS, Erlang, Dart, Go, Groovy, HTML, Java, JavaScript, JSX, Kotlin, TypeScript, TOML, TSX, JSON, Lezer, Markdown, PHP, Python, Ruby, Rust, Scala, Shell, SQL, Swift, Vue, XML, YAML - Language auto-detection - Auto-formatting diff --git a/docs/index.md b/docs/index.md index 6cf08225..c841b5e1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -14,7 +14,7 @@ Available for Mac, Windows, and Linux. - Block-based - Syntax highlighting: - C++, C#, Clojure, CSS, Erlang, Dart, Go, Groovy, HTML, Java, JavaScript, JSX, Kotlin, TypeScript, TOML, TSX, JSON, Lezer, Markdown, PHP, Python, Ruby, Rust, Shell, SQL, Swift, Vue, XML, YAML + C++, C#, Clojure, CSS, Erlang, Dart, Go, Groovy, HTML, Java, JavaScript, JSX, Kotlin, TypeScript, TOML, TSX, JSON, Lezer, Markdown, PHP, Python, Ruby, Rust, Scala, Shell, SQL, Swift, Vue, XML, YAML - Language auto-detection - Auto-formatting diff --git a/public/langdetect-worker.js b/public/langdetect-worker.js index 15d736f9..d622c16d 100644 --- a/public/langdetect-worker.js +++ b/public/langdetect-worker.js @@ -1,6 +1,6 @@ importScripts("guesslang.min.js") -GUESSLANG_LANGUAGES = ["json","py","html","sql","md","java","php","css","xml","cpp","rs","cs","rb","sh","yaml","toml","go","clj","erl","js","ts","swift","kt","groovy","ps1","dart"] +GUESSLANG_LANGUAGES = ["json","py","html","sql","md","java","php","css","xml","cpp","rs","cs","rb","sh","yaml","toml","go","clj","erl","js","ts","swift","kt","groovy","ps1","dart","scala"] const guessLang = new self.GuessLang() diff --git a/src/editor/lang-heynote/heynote.grammar b/src/editor/lang-heynote/heynote.grammar index 78e6f239..b091c950 100644 --- a/src/editor/lang-heynote/heynote.grammar +++ b/src/editor/lang-heynote/heynote.grammar @@ -11,7 +11,7 @@ NoteDelimiter { @tokens { noteDelimiterMark { "∞∞∞" } - NoteLanguage { "text" | "math" | "javascript" | "typescript" | "jsx" | "tsx" | "json" | "python" | "html" | "sql" | "markdown" | "java" | "php" | "css" | "xml" | "cpp" | "rust" | "csharp" | "ruby" | "shell" | "yaml" | "golang" | "clojure" | "erlang" | "lezer" | "toml" | "swift" | "kotlin" | "groovy" | "diff" | "powershell" | "vue" | "dart" } + NoteLanguage { "text" | "math" | "javascript" | "typescript" | "jsx" | "tsx" | "json" | "python" | "html" | "sql" | "markdown" | "java" | "php" | "css" | "xml" | "cpp" | "rust" | "csharp" | "ruby" | "shell" | "yaml" | "golang" | "clojure" | "erlang" | "lezer" | "toml" | "swift" | "kotlin" | "groovy" | "diff" | "powershell" | "vue" | "dart" | "scala" } Auto { "-a" } noteDelimiterEnter { "\n" } //NoteContent { String } diff --git a/src/editor/lang-heynote/parser.js b/src/editor/lang-heynote/parser.js index defa20cc..6ecba3a8 100644 --- a/src/editor/lang-heynote/parser.js +++ b/src/editor/lang-heynote/parser.js @@ -10,7 +10,7 @@ export const parser = LRParser.deserialize({ maxTerm: 10, skippedNodes: [0], repeatNodeCount: 1, - tokenData: ".[~RcYZ!^}!O!c#V#W!n#W#X$[#X#Y$}#Z#[%m#[#]&`#^#_&r#_#`(Y#`#a(r#a#b)[#d#e*Z#f#g+u#g#h,U#h#i,n#j#k-m#l#m&f#m#n-s%&x%&y-y~!cOX~~!fP#T#U!i~!nOU~~!qR#`#a!z#d#e#o#g#h#u~!}P#c#d#Q~#TP#^#_#W~#ZP#i#j#^~#aP#f#g#d~#gP#X#Y#j~#oOT~~#rP#d#e#j~#xQ#[#]$O#g#h#j~$RP#T#U$U~$XP#f#g#o~$_Q#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j~#oOT~~#rP#d#e#j~#xQ#[#]$O#g#h#j~$RP#T#U$U~$XP#f#g#o~$_Q#T#U$e#]#^$q~$hP#f#g$k~$nP#h#i#j~$tP#Y#Z$w~$zP#Y#Z#j~%QP#f#g%T~%WP#`#a%Z~%^P#T#U%a~%dP#b#c%g~%jP#Z#[#j~%pQ#c#d%T#f#g%v~%yP#c#d%|~&PP#c#d&S~&VP#j#k&Y~&]P#m#n#j~&cP#h#i&f~&iP#a#b&l~&oP#`#a#j~&uQ#T#U&{#g#h'y~'OP#j#k'R~'UP#T#U'X~'^PT~#g#h'a~'dP#V#W'g~'jP#f#g'm~'pP#]#^'s~'vP#d#e$k~'|Q#c#d(S#l#m#j~(VP#b#c#j~(]P#c#d(`~(cP#h#i(f~(iP#`#a(l~(oP#]#^(S~(uP#X#Y(x~({P#n#o)O~)RP#X#Y)U~)XP#f#g#j~)_P#T#U)b~)eQ#f#g)k#h#i*T~)nP#_#`)q~)tP#W#X)w~)zP#c#d)}~*QP#k#l(S~*WP#[#]#j~*^R#[#]#o#c#d*g#m#n+c~*jP#k#l*m~*pP#X#Y*s~*vP#f#g*y~*|P#g#h+P~+SP#[#]+V~+YP#X#Y+]~+`P#`#a&l~+fP#h#i+i~+lP#[#]+o~+rP#c#d(S~+xP#i#j+{~,OQ#U#V&Y#g#h$k~,XS#V#W,e#[#]+V#e#f&l#k#l,w~,hP#T#U,k~,nP#`#a,q~,tP#T#U#j~,zP#]#^,}~-QP#Y#Z$k~-WS#X#Y-d#c#d&f#g#h-j#m#n-p~-gP#l#m$k~-mP#l#m#j~-sP#d#e-v~-yP#X#Y-|~.PP#g#h'a~.VP#i#j#d~.]P#T#U&f~.cP%&x%&y.f~.iP%&x%&y.l~.qOY~", tokenizers: [0, noteContent], topRules: {"Document":[0,2]}, tokenPrec: 0 diff --git a/src/editor/languages.js b/src/editor/languages.js index 2d16b847..34055bec 100644 --- a/src/editor/languages.js +++ b/src/editor/languages.js @@ -23,7 +23,7 @@ import { clojure } from "@codemirror/legacy-modes/mode/clojure" import { erlang } from "@codemirror/legacy-modes/mode/erlang" import { toml } from "@codemirror/legacy-modes/mode/toml" import { swift } from "@codemirror/legacy-modes/mode/swift" -import { kotlin, dart } from "@codemirror/legacy-modes/mode/clike" +import { kotlin, dart, scala } from "@codemirror/legacy-modes/mode/clike" import { groovy } from "@codemirror/legacy-modes/mode/groovy" import { diff } from "@codemirror/legacy-modes/mode/diff"; import { powerShell } from "@codemirror/legacy-modes/mode/powershell"; @@ -265,6 +265,12 @@ export const LANGUAGES = [ name: "Dart", parser: StreamLanguage.define(dart).parser, guesslang: "dart", + }), + new Language({ + token: "scala", + name: "Scala", + parser: StreamLanguage.define(scala).parser, + guesslang: "scala", }), ]