kotlin-jupyter icon indicating copy to clipboard operation
kotlin-jupyter copied to clipboard

Changes on codes in project are not applied to notebooks

Open sgc109 opened this issue 3 months ago • 5 comments

Even though I added new constructor parameter on a class in my project, compile error occurs when I run notebook saying 'Too many arguments ...'.

It usually takes so much time for changes in the project to be reflected. It also doesn't work even if I delete build directory and rebuild the project.

Is it possible to sync changes manually if there is no way to apply changes automatically?

Notebook plugin version: 233.14475.9 Kotlin compiler version: 1.9.0

sgc109 avatar Mar 31 '24 09:03 sgc109

Hi! Have you tried %useLatestDescriptors?

ileasile avatar Mar 31 '24 12:03 ileasile

And what exact changes do you wish to reflect?

ileasile avatar Mar 31 '24 12:03 ileasile

@ileasile Hi, I've just tried %useLatestDescriptors on for the first time at the moment, but it still doesn't work. As I mentioned, I just added a constructor parameter on a class in src/main/kotlin in the same project where the notebook exists. But, there is still a compile error Line_46.jupyter.kts (5:43 - 63) Too many arguments for public constructor StrategySimulator() defined in portfolio.rebalancer.StrategySimulator.

sgc109 avatar Mar 31 '24 13:03 sgc109

But, isn't %useLatestDescriptors related to the library getting with %use? My issue is about the compiler can't recognize the code update in the same project.

sgc109 avatar Mar 31 '24 13:03 sgc109

I see, it's actually not a kernel problem, it should be filed in https://youtrack.jetbrains.com/issues/KTNB. Please check following things:

  1. In notebook settings the module you depend on is enabled
  2. Restart notebook session after changes are made to make sure classes are rebuilt

ileasile avatar Mar 31 '24 13:03 ileasile