Strumenta / antlr-kotlin

Support for Kotlin as a target for ANTLR 4
Apache License 2.0
221 stars 47 forks source link

JsName Only Available in Common and JS Projects #175

Closed piacenti closed 6 months ago

piacenti commented 6 months ago

I know you just added JsName to solve for label variable name clashes. However, when not using a JS target the import for that is taken as an error. I'm not sure if there is an easy fix but for now I'm just running a gradle task to delete all JsName references for jvm only projects. My use case is needing to use an antlr grammar in gradle buildSrc to do some automation for the build process. Gradle buildSrc is generally just a jvm project.

image

lppedd commented 6 months ago

Not an easy one. Let me see if it's doable.

lppedd commented 6 months ago

Ok! Seems like I got it. Easier than what I thought, although it introduces an additional complexity.

ftomassetti commented 6 months ago

This problem seems weird to me. How is it possible that the JetBrains team did not consider this use case?

lppedd commented 6 months ago

@ftomassetti the thing is it doesn't depend on the binaries we ship, but it depends on the code we generate.

The kotlin-jvm plugin doesn't contain JS related definitions, that's why JsName is not found. If you think about it from this perspective, it makes more sense.

lppedd commented 5 months ago

@piacenti RC2 is out, so you can remove your workaround.