Phantom source

I wondered if others might find useful what I'll call phantom source
code, something that really isn't in the actual source but is a kind of
annotation that you can instruct the IDEA editor to add visually, a type
of readonly addition to the source. I thought of it regarding a coding
standard requirement you sometimes see that closing curly braces be
followed by a comment identifying what block is being closed, for
example, that you must use one on closing methods and named classes. I
realize that in IDEA you can move the cursor down to the closing brace
to see what it actually closes in case it runs above the top of the
editor, but it would be even better if you didn't have to move your
cursor down and could conform to such a standard without junking up the
code with those pesky actual comments that are sometimes forgotten or
sometimes not kept up-to-date. Well, I started thinking about how to get
the editor to conform to a closing brace comment standard as a sort of
shadow/phantom comment that doesn't really exist in the actual code--
obviously a user preference. One of the benefits is that you could
possibly use this feature in an IDEA shop to sate certain silly coding
standards without yucking up the actual code.

Will the coming EditorOpenAPI be able to manifest this?

Are there other uses you can come up with for phantom source code,
other comments or something more interesting that isn't just comments,
maybe something involving intentions that show inline how the code would
change?

I admit that this phantom source thingy is my bizarre idea of the night
but want to float it to see what uses could be imagined before possibly
filing a Lovecraftian feature request.

Goodnight,
Jon

2 comments
Comment actions Permalink

For this certain purpose use Alt+Q - context info which displays the same as
if you'd stand on the closing brace but may be invoked anywhere in the
method/class.

--

Best regards,
Maxim Shafirov
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"


"Jon Steelman" <steelman@mindspring.com> wrote in message
news:bga6ig$143$1@is.intellij.net...

I wondered if others might find useful what I'll call phantom source
code, something that really isn't in the actual source but is a kind of
annotation that you can instruct the IDEA editor to add visually, a type
of readonly addition to the source. I thought of it regarding a coding
standard requirement you sometimes see that closing curly braces be
followed by a comment identifying what block is being closed, for
example, that you must use one on closing methods and named classes. I
realize that in IDEA you can move the cursor down to the closing brace
to see what it actually closes in case it runs above the top of the
editor, but it would be even better if you didn't have to move your
cursor down and could conform to such a standard without junking up the
code with those pesky actual comments that are sometimes forgotten or
sometimes not kept up-to-date. Well, I started thinking about how to get
the editor to conform to a closing brace comment standard as a sort of
shadow/phantom comment that doesn't really exist in the actual code--
obviously a user preference. One of the benefits is that you could
possibly use this feature in an IDEA shop to sate certain silly coding
standards without yucking up the actual code.

>

Will the coming EditorOpenAPI be able to manifest this?

>

Are there other uses you can come up with for phantom source code,
other comments or something more interesting that isn't just comments,
maybe something involving intentions that show inline how the code would
change?

>

I admit that this phantom source thingy is my bizarre idea of the night
but want to float it to see what uses could be imagined before possibly
filing a Lovecraftian feature request.

>

Goodnight,
Jon

>


0
Comment actions Permalink

Hi Maxim. I've used Alt+Q and hadn't completely forgotten about her, but
I was looking for an even lazier way as usual-- no need to even touch
the keyboard or the mouse.

Thanks,
Jon

Maxim Shafirov wrote:

For this certain purpose use Alt+Q - context info which displays the same as
if you'd stand on the closing brace but may be invoked anywhere in the
method/class.


0

Please sign in to leave a comment.