During debug scala in intellj, can we pause on a statement, and then run other code? - scala

Sometimes I need interactive with scala console during debug. What I am doing now is: write a class with a method, and let that method return some object, then in scala console, I import that class ,create a new instance and run the method to get a object, then doing interactive thing with that object. If I need to modify that method, then I have to first change in IDE, then exit console, re-run console and import the class (since the class is change), to run the method again. This takes time, if it possible in IDE, set a breakpoint, run until that breakpoint, and then kick off a console, and doing interactive thing in that console?

The way I work within intellij is to use the terminal console, and have that in the lower third of my IDE window, and then have SBT (console) or scala just running in there. That way you can just switch between windows and evaluate expressions you need to from there. If you want to evaluate specific (in place) expressions such as those that are only in context within the currently debugged block of code, then I think that you might be able to do that via the Watch window. There is an option in Intellij 14 which pops up a separate evaluation window. (Not tried this with Scala though to be honest, but works well with Java).

Related

How to automatically terminate last instance when running or debugging in VS Code

Coming from Eclipse, I am very used to the option to terminate the possible old and running instance of the code I'm working on. With VS Code, I instead have to select the console, press Ctrl+C, wait for the process to end and only then can I launch a new instance via Ctrl+F5 (same for debug/regular F5).
I was surprised to find no such option in VS Code, am I missing something or is this feature simply not supported ? If this is possible to configure somehow, how would I go about it ? Multiple tags because I'm not sure which part of VS Code would be responsible here. I am specifically developing in Java, if that is relevant.

Eclipse keybindings. Setting up a shortcut for executing a specific run configuration

I'm trying to setup a key binding in Eclipse to directly execute a background Java file. My file is called CodeChecker.java and it's sufficient for my purposes to run the main method without any arguments. I need to run it repeatedly and so I'm trying to setup a shortcut key to run it directly without having to bring up the Run... menu or having to bring up the file itself.
As far as I'm aware Eclipse is not able to offer this functionality directly. I've tried using a plugin called Practically Macro according to this answer Assigning a keyboard shortcut for a specific Eclipse build configuration. But this answer is horribly out of date and doesn't work any longer.
So I'm wondering if Practically Macro can still be used to achieve this? Any other solution, plugin, script or otherwise would be equally welcome.

Eclipse run test one by one

I'm looking for a way to run a only a one test case in my test class from the some kind of test methods list.
For example, when I run a whole batch of test methods, the failure list appears like that:
And I can right-click on the appropriate test method and re-run it without a running a whole batch. But in the next i'm getting the error list, that consists of only that method:
At that point it would be nice to run the another test method as only one, without running a whole batch. Is there a way in Eclipse to get the list of my test methods where it's would be possible to choose the method to run?
In the JUnit view toolbar there is a Test Run History... button/drop-down where you can go back to the test result of a previous run without rerunning it.
In addition, you can also right-click on a test method to run this method only: for example in the Java editor, in Outline view of the Java editor, in the Package Explorer or in the Project Explorer.

Eclipse Pydev interactive console use inside functions

What are the best practices for developing with the Eclipse Pydev interactive console once code migrates inside a function?
I heavily use the interactive console as my projects are typically experimental, open-ended, and not spec-driven. The interactive console works well for code in the main loop, but as soon as I migrate that code to a function, I only know to use breakpoints with the debug view. However, that seems unwieldy, and I don't need the entire stack, nor error-catching mechanisms.
Is there a way to have the vanilla pydev environment interactive console inside a function, for example on the first breakpoint, or raised error?
Without this, I typically have to copy the function back into the main loop. Then, I end up using the same variable names, which leads to occasional global variable name accidents when I copy back to a function.
Thanks in advance.

Eclipse Run As Groovy Script by Default

I'd like to run my Groovy project in Eclipse using a shortcut (CTRL+F11). The trouble is, every time I do so I get a "Select a way to run " dialog, which gives me the choice between Groovy Console, Groovy Script, Java Application.
I've already set a Run Configuration to use Groovy Script, and if I click that Run Configuration under the Run As menu, it just runs.
How can I get my project to execute from a keyboard shortcut without that dialog popping up? I can't imagine ever selecting one of the other options.
I've never been able to get a satisfactory keyboard shortcut for Groovy script runs out of ctrl-F11. Instead I use alt-shift-X and then press G when the menu appears.
For debugging I use alt-shift-D, then G.
Both are two-stroke, rather than one-stroke, solutions, but neither one forces me to use the mouse or the arrow keys.
Under Project>Properties>Java Build Path and then click on Java SE, what ever it may be, click finish.
On the off chance that you deleted your java system library you can o pick up a new one... http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html