Anyone played/worked with debugging Kotlin/JS code...
# javascript
r
Anyone played/worked with debugging Kotlin/JS code with IntelliJ IDEA Ultimate JS Debugger?
I've played a bit and encountered two issues.
Conditional breakpoints work, but it seems I need to write conditions with JavaScript (even though IntelliJ claims I can write Kotlin code and highlights JS code as being incorrect). There is no error message if the condition has wrong syntax or is just some trash code - it just doesn't work.
When stepping through Kotlin code IntelliJ doesn't show current variable values in the editor window (neither next to declarations nor as popups over mouse cursor). It's strange, because it can do this for JavaScript code. And even Chrome DevTools can do this for Kotlin code.
c
Are you using IR or Legacy?
r
Legacy
IR doesn't support source maps, so its currently unusable for Kotlin debugging
c
That's what I thought. I never managed to do anything like that
o
@Robert Jaros Did you have a chance to try the JS debugger on IR with 1.5.30-M1, where source maps are supported?
r
Not yet. But I plan to try.
c
Hopefully it'll get released soon. I'm already pushing my companies' boundaries by using IR, so using the pre-release... 😅
o
I have just experimented with 1.5.30-M1 JS/IR. Source maps are definitely there. Properties have mangled names and the debugger evaluation assumes pure JS. So instead of
model.value.toInt()
you'd write something like
parseInt(model._value_52)
. JS also works in a breakpoint's "evaluate and log" expression and in breakpoint conditions, e.g.
(parseInt(model._value_52) % 2) == 0
. I'd say it's an important initial step as we now have debuggable JS/IR. Obviously, there is room for improvement.
🙏 1
c
What is your set up to make highlighjs works with kotlin/js + react