Add Groovy language support (#111)

This commit is contained in:
Hojun Lee 2024-01-04 23:18:28 +09:00 committed by GitHub
parent 0f3c714d56
commit b80230454d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 3 deletions

View File

@ -16,7 +16,7 @@ Available for Mac, Windows, and Linux.
- Block-based
- Syntax highlighting:
C++, C#, Clojure, CSS, Erlang, Go, HTML, Java, JavaScript, JSX, Kotlin, TypeScript, TOML, TSX, JSON, Lezer, Markdown, PHP, Python, Ruby, Rust, Shell, SQL, Swift, XML, YAML
C++, C#, Clojure, CSS, Erlang, Go, Groovy, HTML, Java, JavaScript, JSX, Kotlin, TypeScript, TOML, TSX, JSON, Lezer, Markdown, PHP, Python, Ruby, Rust, Shell, SQL, Swift, XML, YAML
- Language auto-detection
- Auto-formatting

View File

@ -24,6 +24,7 @@ GUESSLANG_LANGUAGES = [
"toml",
"swift",
"kt",
"groovy",
]
const guessLang = new self.GuessLang()

View File

@ -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" }
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" }
Auto { "-a" }
noteDelimiterEnter { "\n" }
//NoteContent { String }

View File

@ -10,7 +10,7 @@ export const parser = LRParser.deserialize({
maxTerm: 10,
skippedNodes: [0],
repeatNodeCount: 1,
tokenData: ",Z~RaYZ!W}!O!]#V#W!h#X#Y$U#Z#[$t#[#]$z#^#_%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#h#o~!wP#c#d!z~!}P#^#_#Q~#TP#i#j#W~#ZP#f#g#^~#aP#X#Y#d~#iOT~~#lP#d#e#d~#rQ#[#]#x#g#h#d~#{P#T#U$O~$RP#f#g#i~$XP#f#g$[~$_P#`#a$b~$eP#T#U$h~$kP#b#c$n~$qP#Z#[#d~$wQ#c#d$[#f#g$}~%QP#c#d%T~%WP#c#d%Z~%^P#j#k%a~%dP#m#n#d~%jP#h#i%m~%pP#a#b%s~%vP#`#a#d~%|Q#T#U&S#g#h'W~&VP#j#k&Y~&]P#T#U&`~&ePT~#g#h&h~&kP#V#W&n~&qP#f#g&t~&wP#]#^&z~&}P#d#e'Q~'TP#h#i#d~'ZQ#c#d'a#l#m#d~'dP#b#c#d~'jP#c#d'm~'pP#h#i's~'vP#`#a'y~'|P#]#^'a~(SP#X#Y(V~(YP#n#o(]~(`P#X#Y(c~(fP#f#g#d~(lP#T#U(o~(rQ#f#g(x#h#i)b~({P#_#`)O~)RP#W#X)U~)XP#c#d)[~)_P#k#l'a~)eP#[#]#d~)kQ#[#]#i#m#n)q~)tP#h#i)w~)zP#[#])}~*QP#c#d'a~*WP#i#j*Z~*^Q#U#V%a#g#h'Q~*gR#[#]*p#e#f%s#k#l*|~*sP#X#Y*v~*yP#`#a%s~+PP#]#^+S~+VP#Y#Z'Q~+]S#X#Y+i#c#d%m#g#h+o#m#n+u~+lP#l#m'Q~+rP#l#m#d~+xP#d#e+{~,OP#X#Y,R~,UP#g#h&h~,[P#T#U%m~,bP%&x%&y,e~,hP%&x%&y,k~,pOY~",
tokenizers: [0, noteContent],
topRules: {"Document":[0,2]},
tokenPrec: 0

View File

@ -23,6 +23,7 @@ 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 } from "@codemirror/legacy-modes/mode/clike"
import { groovy } from "@codemirror/legacy-modes/mode/groovy"
import typescriptPlugin from "prettier/plugins/typescript.mjs"
import babelPrettierPlugin from "prettier/plugins/babel.mjs"
@ -232,6 +233,12 @@ export const LANGUAGES = [
parser: StreamLanguage.define(kotlin).parser,
guesslang: "kt",
}),
new Language({
token: "groovy",
name: "Groovy",
parser: StreamLanguage.define(groovy).parser,
guesslang: "groovy",
}),
]