IDEA 15 Debug: disable 'alternative source'
Hey,
A new IDEA 15 feature is bugging me a bit. Every time I go into debug, a choice appears at the top of the editor that offers me 'Alternative source available for the class ...'. The choices I get are 1. The Java file in the editor itself and 2. the same class from the sources-jar on my classpath (Maven).
I'd rather not have that choice appear. It covers part of my screen and when I make any choice the editor moves back to the top of the file.
I haven't been able to locate a way to disable that in IDEA 15. I could also try to ignore it, but then the choice remains there as long as that Java file is opened in the editor. Ignoring such things is not one of my strong points :-)
请先登录再写评论。
Why do you have the same classes as you have in the project also added as a library? Your Maven configuration may have some dependencies that you don't need.
Please provide a sample project to reproduce.
It's not added as a library. Every build has the sources jar available in its Maven target folder. Why that is doesn't matter, what matters is that I'd like to disable the feature.
This looks like https://youtrack.jetbrains.com/issue/IDEA-147298, fixed in 15.0.2, you can check it in the available EAP https://confluence.jetbrains.com/display/IDEADEV/IDEA+15+EAP
It doesn't appear to be fixed in EAP 143.1015.7
then please wait for https://youtrack.jetbrains.com/issue/IDEA-141792 to be integrated, it will allow to switch it off
So I've been able to disable the 'alternative source' choice. However now when I debug the IDEA debugger chooses its source to debug rather arbitrary.
It should choose the source visible from the module you run first.
If possible please attach a sample project to reproduce the issue.
I don't own the code but it's rather easily reproduced by using the maven-source-plugin. Every build has its sources-jar in its target folder. The debugger chooses either that sources jar or the effective codebase loaded in IDEA.
we tried, but still can not reproduce this.
I usually have a JBoss server running locally with our modules deployed. It seems that this issue only occurrs when I've got a server running in debug mode. IDEA chooses the sources-jar classes when such a class is also deployed on the server (in debug). Perhaps that's why you've got trouble reproducing the issue.
Now that I installed 15.0.2 (143.1184) this issue has gone away completely.
Thanks!
Glad to hear that, thank you!
Once disabled, going back into Build, Execution, Deployment > Debugger and selecting 'Show alternative source switcher' the preference to enable the option does not enable the Apply button, and clicking OK, the perfeerence does not persist therefore allowing one to switch back to the default.
Ups, thanks! Will fix: https://youtrack.jetbrains.com/issue/IDEA-149379
Workaround is to change something else together with this, click apply, then change another setting back.
I ended up changing my options.xml file on mac ~/Library/Preferences/IntelliJIdea15/options
<component name="DebuggerSettings">
<option name="SHOW_ALTERNATIVE_SOURCE" value="true" />