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 :-)

15 comments
Comment actions Permalink

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.

0
Comment actions Permalink

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.

0
Comment actions Permalink

It doesn't appear to be fixed in EAP 143.1015.7

0
Comment actions Permalink

then please wait for https://youtrack.jetbrains.com/issue/IDEA-141792 to be integrated, it will allow to switch it off

0
Comment actions Permalink

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.  

0
Comment actions Permalink

It should choose the source visible from the module you run first.
If possible please attach a sample project to reproduce the issue.

0
Comment actions Permalink

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.

0
Comment actions Permalink

we tried, but still can not reproduce this.

0
Comment actions Permalink

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.

0
Comment actions Permalink

Now that I installed 15.0.2 (143.1184) this issue has gone away completely.

Thanks!

0
Comment actions Permalink

Glad to hear that, thank you!

0
Comment actions Permalink

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.

0
Comment actions Permalink

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.

0
Comment actions Permalink

I ended up changing my options.xml file on mac ~/Library/Preferences/IntelliJIdea15/options

<component name="DebuggerSettings">

    <option name="SHOW_ALTERNATIVE_SOURCE" value="true" />

0

Please sign in to leave a comment.