Kotlin / kotlin-jupyter

Kotlin kernel for Jupyter/IPython
Apache License 2.0
1.09k stars 106 forks source link

Changes on codes in project are not applied to notebooks #455

Open sgc109 opened 3 months ago

sgc109 commented 3 months ago

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

ileasile commented 3 months ago

Hi! Have you tried %useLatestDescriptors?

ileasile commented 3 months ago

And what exact changes do you wish to reflect?

sgc109 commented 3 months ago

@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 commented 3 months ago

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.

ileasile commented 3 months ago

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