AtomMaterialUI / color-highlighter

JetBrains plugin to preview colors directly from within the code.
MIT License
40 stars 23 forks source link

java.lang.NumberFormatException while working in Scala sources #132

Open OndrejSpanel opened 10 months ago

OndrejSpanel commented 10 months ago

Describe the bug

While working in Scala I got exception:

java.lang.NumberFormatException: For input string: "drk(c.getRed" at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054) at java.base/jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122) at java.base/java.lang.Float.parseFloat(Float.java:476) at com.mallowigi.colors.ColorData.parseComponent(ColorData.kt:57) at com.mallowigi.search.parsers.ColorCtorParser.parseConstructor(ColorCtorParser.kt:51) at com.mallowigi.search.parsers.ColorCtorParser.parseColor(ColorCtorParser.kt:35) at com.mallowigi.visitors.ScalaVisitor.parseCtor(ScalaVisitor.kt:57) at com.mallowigi.visitors.ScalaVisitor.access$parseCtor(ScalaVisitor.kt:45) at com.mallowigi.visitors.ScalaVisitor$parsedTypes$3.invoke(ScalaVisitor.kt:50) at com.mallowigi.visitors.ScalaVisitor$parsedTypes$3.invoke(ScalaVisitor.kt:50) at com.mallowigi.visitors.ScalaVisitor.accept(ScalaVisitor.kt:82) at com.mallowigi.visitors.ColorVisitor.visit(ColorVisitor.kt:88)

I will prepare a PR for this once I find time.