Cool Xcode feature

Apple's Xcode has a cool feature for C and ObjC code that lets you label
sections of your code using a "#pragma mark ]]>" directive. I've
attached a screenshot, showing one of the mark lines, while I'm pulling
down the current file members combobox.

I think something like this would be useful for IDEA - it could be used
to separate methods and fields in Structure View, and there could be
hotkeys "jump to section," and the section separators could be
highlighted in some color in the editor to easily differentiate when
scrolling.

What do you guys think? This kind of feature is definitely less useful
for Java code than for languages where a single file has more than one
class, but I think maybe we can think of a cool way to do this, then
file a request in JIRA.



Attachment(s):
Picture 1.png
4 comments
Comment actions Permalink


I'm trying to think of a time where I would use this in preference to the Ctrl-(Alt-)(Shift-)N family, Ctrl-B, F2, TODO comments, or bookmarking. There's just not that many navigation needs that aren't already covered.

Implementation-wise, I'd do this with a structured comment (usable in any language with comment support). Other than showing up in a pulldown rather than a tool-window, it would be pretty much exactly like TODOs.

When all is said and done, though, I'm just not sure IDEA needs any more navigation features. The one's it's got are insanely powerful already.

--Dave Griffith

0
Comment actions Permalink

Try bookmarks: F11 and Shift-F11 - you can label them with text.

Keith Lea wrote:

Apple's Xcode has a cool feature for C and ObjC code that lets you
label sections of your code using a "#pragma mark <name>" directive.
I've attached a screenshot, showing one of the mark lines, while I'm
pulling down the current file members combobox.

>

I think something like this would be useful for IDEA - it could be
used to separate methods and fields in Structure View, and there could
be hotkeys "jump to section," and the section separators could be
highlighted in some color in the editor to easily differentiate when
scrolling.

>

What do you guys think? This kind of feature is definitely less useful
for Java code than for languages where a single file has more than one
class, but I think maybe we can think of a cool way to do this, then
file a request in JIRA.

>

------------------------------------------------------------------------

>



Attachment(s):
att1.dat
0
Comment actions Permalink

I'm saying it would be cool to integrate labels throughout the IDE.
Anyway, I don't think bookmarks are the right way. I think some special
comment would be better.

Norris Shelton wrote:

Try bookmarks: F11 and Shift-F11 - you can label them with text.

Keith Lea wrote:

>> Apple's Xcode has a cool feature for C and ObjC code that lets you
>> label sections of your code using a "#pragma mark " directive. >> I've attached a screenshot, showing one of the mark lines, while I'm >> pulling down the current file members combobox. >> >> I think something like this would be useful for IDEA - it could be >> used to separate methods and fields in Structure View, and there could >> be hotkeys "jump to section," and the section separators could be >> highlighted in some color in the editor to easily differentiate when >> scrolling. >> >> What do you guys think? This kind of feature is definitely less useful >> for Java code than for languages where a single file has more than one >> class, but I think maybe we can think of a cool way to do this, then >> file a request in JIRA. >> >>]]> -


>>

0
Comment actions Permalink

Keith Lea wrote:

I'm saying it would be cool to integrate labels throughout the IDE.
Anyway, I don't think bookmarks are the right way. I think some special
comment would be better.


-1000

I absolutely hate "special comments" in my code for use by an IDE/GUI builder/etc.
If it is not something that is industry standard, IDE agnostic, and nearly impossible to
break when you go in there and manually muck with the code, then keep it out of my code.
Things like that belong in the project and module configuration files that are specific to
IDEA.

In fact, I would prefer if all of the @noinspection stuff were not in my comments as well.
Unless the user uses the @noinspection to justify a deviation from a coding standard,
then it really doesn't belong there. AFAIK that doesn't currently happen.

0

Please sign in to leave a comment.