Bug 115708 - Allow marker type for Java Task Tags to be specified (via extension-point)
Summary: Allow marker type for Java Task Tags to be specified (via extension-point)
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-09 16:58 EST by Christopher Daly CLA
Modified: 2007-06-22 07:58 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Daly CLA 2005-11-09 16:58:07 EST
Currently Task Tags (i.e. "TODO") can be defined and the Java scanner looks for
these and creates markers.  My complaint is that only "Task" markers can be
created this way.  I might want to get a "Bookmark" type of marker or I might
want to specify my own marker type that I created with the
org.eclipse.core.resources.markers extension-point.  (Actually it's this second
case - my own marker types - that I'm most interested in).

I'd like to see a jdt extension point for specifying the elements of a Task tag
(the tag text and priority) and specifying a marker id to tell the Java scanner
what type of marker to create.

It's not important to me that this be do-able from the preferences UI, but that
would be nice too.
Comment 1 Christopher Daly CLA 2005-11-09 19:56:11 EST
Let me expand on this a little:  I'd actually like for specifying priority in
the extension-point to be optional.

The JDT code processing the extension-point would create the marker of the
provided marker type and then use IMarker.isSubtypeOf(String) to decide what
marker attributes to write to the new marker.

If the marker is a subtype of org.eclipse.core.resources.markers.textmarker, it
should fill in charStart, charEnd and lineNumber

If the marker is a subtype of org.eclipse.core.resources.markers.taskmarker, it
should fill in priority (and maybe others, such as message)
Comment 2 Philipe Mulet CLA 2005-11-10 06:15:23 EST
What is the usecase for this ? Tasks are really textual matches, nothing fancy.
We are planning on providing hooks for participating in compilation, allowing to
create arbitrary markers, not just for tasks or whatever you decide.
Comment 3 Christopher Daly CLA 2005-11-10 15:56:11 EST
(In reply to comment #2)
> What is the usecase for this ? Tasks are really textual matches, nothing fancy.
> We are planning on providing hooks for participating in compilation, allowing to
> create arbitrary markers, not just for tasks or whatever you decide.

Would the planned hooks include some down at the scanner level (where comments
are treated)?  Is there some writeup on this?

It's very possible that these hooks will allow me to do what I want, but I want
to stress that the current system already seems extremely close to what I need.
 I just need a different kind of marker created.

I can't give my exact usecase here, but it boils down to something like this:
- I need to put something in source code that indicates a marker (so this
information will be shared by a team via CVS).
- I want to use IMarkers because it's easy to search for them and listen for
change events.
- I need to put these markers in arbitrary places in Java source (so I can't use
Java annotations to specify the markers).
- Using comments of the form "// TAG message...." or "/* TAG message... */" is a
nice way to specify the markers.
- But my markers are not conceptually tasks and I don't want them appearing in
the Tasks view.

----

A problem I see with my request is when you change Task tags there is a dialog
that says something like "If you do this I need to rebuild everything!".  So if
tags are specified via extension points, how do you show this and when do you
rebuild?

A possible solution would be to add a column to the Task Tags preferences page
with checkboxes indicating that the tag is enabled/disabled.  Tags defined via
extension points would initially be disabled and the user would have to go to
preferences and enable them (at which point he gets the "rebuilding the world"
message).