Closed kevin1e100 closed 4 years ago
@marijnh do you think you would be able to help with this?
Sure. Attached patch adds support for fun interface
(as I understand it from your explanation, not being a Kotlin programmer myself). The grammar seems to already allow annotations in front of types. If that doesn't cover your 3rd point, please elaborate.
The fun interface
patch looks right to me: fun
immediately precedes interface
for this case, IIUC, and there can be modifiers incl. annotations preceding, e.g., @Foo public @Bar fun interface Baz
.
Agree that type annotations appear to be working: I get the expected highlighting using them in functions, type parameters, and type arguments.
Thanks so much for your quick help with this!
Kotlin 1.4 introduces a few features that may affect parsing/syntax highlighting, notably:
fun interface
declarations: these currently look broken, apparently because codemirror expects a function declaration after thefun
keyword. Instead,fun
should be treated as a modifier here (while leaving function declarations unchanged).fun foo(init: @Bar Baz.(@Bar Foo)->String): @Bar String