codemirror / google-modes

A consistent set of modes for C, C++, Java, Go, JavaScript, TypeScript, Python, HTML, and Angular Templates
MIT License
33 stars 28 forks source link

[kt] Kotlin 1.4 support: minimally fun interfaces appear broken #320

Closed kevin1e100 closed 4 years ago

kevin1e100 commented 4 years ago

Kotlin 1.4 introduces a few features that may affect parsing/syntax highlighting, notably:

mtaran-google commented 4 years ago

@marijnh do you think you would be able to help with this?

marijnh commented 4 years ago

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.

kevin1e100 commented 4 years ago

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!