Hi everyone!
I’ve recently created two new language packages for CodeMirror 6:
-
@fazelstudio/codemirror-lang-kotlin— Kotlin language support -
@fazelstudio/codemirror-lang-swift— Swift language support
Both packages are built with Lezer and provide parsing and syntax highlighting designed for CodeMirror 6.
Kotlin
@fazelstudio/codemirror-lang-kotlin supports Kotlin (.kt, .kts), including:
-
Classes, interfaces, objects, sealed/data classes
-
Functions, extension functions, and infix functions
-
Lambdas and
whenexpressions -
Null-safety operators
-
String templates
-
Ranges and generics
-
Annotations
-
KDoc comments
Repository:
Swift
@fazelstudio/codemirror-lang-swift supports Swift (.swift), including:
-
Classes, structs, enums, protocols, extensions, and actors
-
Generics and
whereclauses -
Functions with
async/throws -
Closures and trailing closure syntax
-
Optionals and optional chaining
-
Pattern matching and
switch -
String interpolation and raw/multiline strings
-
Property wrappers and attributes
-
Custom operators
-
Swift documentation comments
Repository:
Both packages are released under the MIT license.
I’d love to hear feedback from the CodeMirror community, especially regarding grammar coverage, edge cases, and areas where the language support could be improved.
Thanks!