Opinions about editing library source

Sometimes I use my own code as a library in another project, and I Attach Sources to the library. Then sometimes I use Ctrl+Click to navigate from my outer project to the library source, and make a change to the code.

There is a problem: those changes to external library source never show up in my project, since they are not part of the build for the current project.

I understand that this is my own error, not IDEA's, but I think IDEA should warn you, or prevent you from editing library source.

I filed this as an RFE a while ago http://intellij.net/tracker/idea/viewSCR?publicId=30046 and it was marked as To Be Discussed, and it still is. People had different opinions so I thought I'd post here.

I wonder what people would think of a warning message, or a different icon in the tab bar, or a different source background color, for library source code.

So, what does everyone think?

6 comments
Comment actions Permalink

I wouldn't want a warning: Maybe you are just not using Idea to build, but edit library source and use ant to rebuild the library.

But a different tab icon would be definitly nice.

(Editor background is configured by user, e.g. I have very light yellow, so changing that would interfer with user settings.)

0
Comment actions Permalink

Em Thu, 10 Jun 2004 13:23:05 +0400, Stephen Kelvin escreveu:

I wouldn't want a warning: Maybe you are just not using Idea to build, but
edit library source and use ant to rebuild the library.


If this is the case, why not make the so-called library part of your
project? For me, what tells apart libraries from project is exactly how
editable they are: if I can mess around and change the code, it's part of
my project, not a library.

So, +1 for making library source code read only.

--
Marcus Brito <pazu@animegaiden.com.br>


0
Comment actions Permalink

Marcus Brito wrote:

Em Thu, 10 Jun 2004 13:23:05 +0400, Stephen Kelvin escreveu:

>>I wouldn't want a warning: Maybe you are just not using Idea to build, but
>>edit library source and use ant to rebuild the library.


If this is the case, why not make the so-called library part of your
project? For me, what tells apart libraries from project is exactly how
editable they are: if I can mess around and change the code, it's part of
my project, not a library.

So, +1 for making library source code read only.


I agree entirely.

If it is to be changed in the current scope, it is a module;
if it is not to be changed, it is a library.

0
Comment actions Permalink

You could just as well argue the other way round:
If you just use it as a library why do you have writable source files anyway. For most libraries I use I have the sources mounted as a jar only.
If you want to unpack them, you can still make them read only in the files system.
Well, different people, different needs...
An editor option would probably suit us all.

0
Comment actions Permalink

I don't just use it as a library. I use projects that I've written as libraries for other projects, and I add the project's sourcepath to the IDEA library definition so I can get Javadoc and parameter names with Ctrl+Q.

So, the source is writable simply because there's no reason for me to make it read-only, except to prevent myself from accidentally editing it in the wrong project.

0
Comment actions Permalink

I agree with the main idea, but anyway perhaps you should consider using your other projects as Modules instead of libraries, and set the dependancies the right way. I use that approach and it works well for me.

0

Please sign in to leave a comment.