RFE: easy sourcepath switch on/off

would it be possible / useful to use the same lvcs instead?

usecase: I have an IDEA project on e.g. d:\test\test.ipr
+ a folder named "decompiled", which contains 10000 decompiled java source files. I want to use IDEAs code navigation features on them: find implementing classes etc.
BUT I do not want to have it as sourcepath on my "normal" project because:
a) this causes local history to be created, takes a lot of time "scanning files"...
b) when I launch a run config, I would have to uncheck "make project...", otherwise IDEA would try to compile all 10000 decompiled sources (which btw. is not possible due to lots of not fully correctly decompiled sources).

So, I could just switch the sourcepath away with the "excluded"-marker. BUT: that takes a very long time "saving local history", probably because of purging out the history entries from the 10000 sources...
And next time I switch them back in again, it starts again "scanning files"...

Therefore I created a separate project, that has the same module root.
-> thus the question, could 2 projects on same module root use the same local vcs cache?

-> another way to help me with my use case would of course be: TEMPORARILY deactivate a sourcefolder, without the local vcs being cleared out...

Does anybody care? ;)

13 comments
Comment actions Permalink

I assume that the decompiled sources are from libraries used by your project that don't
contain source files.
What if you set the source path of the libraries containing those jars to the "decompiled"
directory? Then you could use IDEA code navigation features.
I haven't tried it, but it seems like that would work.

0
Comment actions Permalink

yes, thanks, that does work indeed.
But it has the following problems, as I described:

a) it takes very long time until the >10000 sourcefiles are scanned / parsed
b) I have the switch "make module before running" checked, but would have to uncheck it, otherwise IDEA tries to compile all the 100000 decompiled sources.
I do not want to uncheck it ;)
because when coding I run the app very often, and I am used to not having to compile it first.
If the "make module before running" is not checked, this is what happens:

1. I make some very clever source code modifications ;)
2. I run the app
this takes some time, it is quite big and produces tons of debug output.
when the app is launched, I need to start a second app (native exe) which communicates with the java app via socket.
then I have to press a lot of keys, to navigate the app into the state I want to debug.
3. I discover that my changes have not been compiled...
4. hit the "make project" button
5. realize that I need to remove the decompiled sources - they cannot be recompiled due to things like this:

if(addressdescription.getSafeDescriptions().length <= 0)
break MISSING_BLOCK_LABEL_282;
word0;
JVM INSTR tableswitch 0 5: default 234
// 0 156
// 1 177
// 2 177
// 3 177
// 4 177
// 5 177;
goto _L1 _L2 _L3 _L3 _L3 _L3 _L3
_L2:

6. I remove the "decompiled"-source path
7. I wait until local history is saved

and so on ;)

0
Comment actions Permalink

b) I have the switch "make module before running"
checked, but would have to uncheck it, otherwise IDEA
tries to compile all the 100000 decompiled sources.


Not if you add these decompiled sources as a library -- you get the best from both world in this way: you can browse (and modify, unfortunately) the code, but IDEA won't compile them.

0
Comment actions Permalink

Michael Damberger wrote:

yes, thanks, that does work indeed.
But it has the following problems, as I described:


Tim meant to attach the sources to a library in Paths > Libraries >
Attach Sources. IDEA doesn't try to compile those. (But it assumes that
you are actually using a library, which you may not be)

--
Rob Harwood
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

brilliant! thanks!!! it works :)

... someone should write things like this in a book or sth. ;)

0
Comment actions Permalink

ok, yes, Tim wrote " set the source path of the libraries"
Did not read carefully enough.

So: thanks to Tim + Rob!

... be warned: because of this positive experience you might see more messages from me - about problems where I also might just miss some easy solution :)

0
Comment actions Permalink

ok, there's room for improvement, still:

1. when debugging, clicking on entries from the frame-tab will not jump to the line of the method in the source.


2. if I want to set a breakpoint in one of the decompiled sources, I seem to have to do the following:

2a) delete the source
this is not possible via "delete" from IDEA
2b) navigate to it again, e.g. ctrl-n alt-n, and decompile it, but into a "real" source path
then it can be compiled and breakpoints will work

--> this would be easier if it would be possible to compile the source directly from the "library-attached" source.

in other words: generally it is a good feature that the sources from the "library-attached" folder will not be compiled,
but for debugging it would be nice to be able to manually compile some of them.

0
Comment actions Permalink

Michael Damberger wrote:

ok, there's room for improvement, still:


I believe that if the libraries you are using were originally compiled with debugging
information, it works as you wish it to. Otherwise, yes, you have to take the steps
outlined in your last post.

0
Comment actions Permalink

to summarize: sources that are attached to a library, can be modified, but they will not be compiled.

--> please indicate those sources the same way as other java sources from non-source-roots.
otherwise coders will find themselves writing code and wondering why it won't get executed...

M.

0
Comment actions Permalink

For the user's sake, libraries source code should be read-only.

0
Comment actions Permalink

sorry if I ask sth. that has been answered elsehwere:
IDEABKL means backlog, right?
does that mean that it will be fixed? ;)

M.

0
Comment actions Permalink

In article <24809156.1120587239010.JavaMail.itn@is.intellij.net>,
Michael Damberger <michael.damberger@t-online.de> wrote:

sorry if I ask sth. that has been answered elsehwere:
IDEABKL means backlog, right?
does that mean that it will be fixed? ;)


it means it's not going to be tossed out as won't fix, but it also means
it's not for IDEA 5.0, and doesn't specify any timeframe in which you
can expect it to be fixed :) So it's better than Won't Fix, and not
better than being in Feature or DEV.

R

0

Please sign in to leave a comment.