Thank you to both of you. Michael, the plugin looks superb. It is exactly what I was looking for. I am not a Jetbrains user, but I think I need to become one immediately.
Rohit that is a very useful one-liner. Is there something similar that would allow me to go the other way? I.e. develop in IntelliJ, and then parse the file with Mathematica, so that it becomes a Notebook again? It isn't a problem if not - I would Mathematica would simply bring it all in as a single cell. However, for debugging purposes, it could be very useful to be able to single step through the code, and Notebooks are great for that.
Cheers
Andy