Metadata of files


Here's a thought I had recently:

<.02?>
A lot of stuff IDEA does to please us depends on additional
information about the edited files. Some of this information
is configurable via some setting or the other, some other
information is obtained by IDEA via "sophisticated guessing"
(like for String completion in all kinds of files or path
completion in HTML or JSP files) other type of information
is stored in annotations (like @Nullable) or comments (like
//noinspection comments) directly in the code.

Especially the latter type of information appears somewhat
ugly to me: I don't want my co-workers (who may not be
using IDEA) to be bothered by stuff in the code that they
don't need (even if it may be their own fault - why don't
they use IDEA, too).

So, my idea was to have "IDEA specific" information stored
in some other place, like a metadata file or database, and
still display it in the edited file in one way or the other
(like a footnote in the code or a gutter mark which allows
access to an appropriate metadata editor or a special
highlighting or a suitable combination of the above). Of
course, the structure of the metadata for known file types
would have to be tightly interwoven with the respective PSI
structure.

Some usages of file metadata have already been mentioned:
- "base paths" settings for path completion
- file specific (even statement specific) inspection
behavior

Other possible usages that come to my mind are:
- JSP bean type information for EL completion
- JDBC connection settings for SQL completion in a (not yet
written) SQL plugin (that works in the main editor as
opposed to a plugin tool window)
- target XML file for XSL autocompletion in XPathView plugin

I'm sure there are plenty of other usage scenarios.

The last examples I mentioned shows that the OpenAPI would
also greatly benefit from file metadata.

I could imagine many aspects of what I described are already
in place internally, so maybe it would just be a matter of
adding things to the OpenAPI.
</.02?>

Regards,
Jens

5 comments

completion in HTML or JSP files) other type of information
is stored in annotations (like @Nullable) or comments (like
//noinspection comments) directly in the code.

>

Especially the latter type of information appears somewhat
ugly to me: I don't want my co-workers (who may not be
using IDEA) to be bothered by stuff in the code that they
don't need (even if it may be their own fault - why don't
they use IDEA, too).



While I could agree that tool-specific information is better stored outside from java sources, what's wrong with annotations like
@NotNull or @Nullable?
These particular annotations (and all annotations in general) are supposed to be in source code and serve at least as a hint to the
programmer even if the tool he/she uses does not "understand" it. Of course the situation will be much better when a set of
"standard" annotations is defined and various toots will support them, but even now these annotations cannot be considered as
IDEA-specific, IDEA just "knows" them (and can be extended to know any other annotations).

--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Eugene Zhuravlev (JetBrains) wrote:

While I could agree that tool-specific information is better stored outside
from java sources, what's wrong with annotations like @NotNull or @Nullable?


Eclipse users here feel upset about the org.jetbrains package name, so we don't
use Nullable/NN here. We filed http://jetbrains.net/jira/browse/IDEA-4276 about
this.

0

Hello Keith,

Eclipse users here feel upset

is that religous or something? We'd happy to have those in javax.annotations
but... well.

-


Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Eugene Zhuravlev (JetBrains) wrote:

>> While I could agree that tool-specific information is better stored
>> outside from java sources, what's wrong with annotations like
>> @NotNull or @Nullable?
>>

Eclipse users here feel upset about the org.jetbrains package name, so
we don't use Nullable/NN here. We filed
http://jetbrains.net/jira/browse/IDEA-4276 about this.



0

Hello Keith,

Well, I wonder if someone ever been upset of having org.jdom package in their
code but still want to use JDOM library...

-


Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Eugene Zhuravlev (JetBrains) wrote:

>> While I could agree that tool-specific information is better stored
>> outside from java sources, what's wrong with annotations like
>> @NotNull or @Nullable?
>>

Eclipse users here feel upset about the org.jetbrains package name, so
we don't use Nullable/NN here. We filed
http://jetbrains.net/jira/browse/IDEA-4276 about this.



0

I think it's silly as well, but that's the only reason we aren't using the
annotations.

Maxim Shafirov wrote:

Hello Keith,

Well, I wonder if someone ever been upset of having org.jdom package in
their code but still want to use JDOM library...

------------------
Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>> Eugene Zhuravlev (JetBrains) wrote:
>>
>>> While I could agree that tool-specific information is better stored
>>> outside from java sources, what's wrong with annotations like
>>> @NotNull or @Nullable?
>>>
>> Eclipse users here feel upset about the org.jetbrains package name, so
>> we don't use Nullable/NN here. We filed
>> http://jetbrains.net/jira/browse/IDEA-4276 about this.
>>


0

Please sign in to leave a comment.