Bug 102569 - [compiler] Tasks view does honour task tags fully
Summary: [compiler] Tasks view does honour task tags fully
Status: VERIFIED DUPLICATE of bug 53727
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal with 2 votes (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-03 03:59 EDT by Keith Whittingham CLA
Modified: 2007-08-07 05:09 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Whittingham CLA 2005-07-03 03:59:14 EDT
First thanks for a great job on 3.1 - excellant!

I have the following set up in /Window/Preferences/Task tags:
- Tag:todo (default), Priority:Normal
- Tag:todo!, Priority:High
- Tag:todo?, Priority:Low
The "Tasks" view does not show the different priorities - it shows then all as 
'Normal' priority.

I would also suggest that the platform be shipped as default with these task 
tags. They are intuitive and a change would be backward compatible.

Thanks again for your hard work.
Comment 1 Philipe Mulet CLA 2005-07-04 09:37:30 EDT
These are nice interesting tags, but the standard is more in favour of TODO,
FIXME and XXX.

Still it should work properly with these.
Comment 2 Olivier Thomann CLA 2005-07-04 15:04:39 EDT
Philippe, is this a candidate for 3.1.1?
Comment 3 Philipe Mulet CLA 2005-07-04 15:42:29 EDT
Will depend on fix risk.
Comment 4 Jin Ruan CLA 2005-07-05 19:12:02 EDT
Looks like it is a duplicate of 97315 - a known problem. 

It is a major loss of functionality for us. We have hundreds of tags and depend 
on the priority sorting for organizing the current work. May I request to 
upgrade the Severity to "Major"?  Thanks. 
Comment 5 Olivier Thomann CLA 2005-07-05 21:19:15 EDT
This is a different problem.
The bug 97315 refers about the wrong priority to be set. I found the problem in
the abstract image builder.
This problem is related to the fact that several tasks start with the same
characters. The shortest one is selected.
Comment 6 Olivier Thomann CLA 2005-07-05 22:23:37 EDT
I was wrong. This is a duplicate of bug 91426.
Once I apply the fix for bug 91426, I get the right priority for each task tag.

*** This bug has been marked as a duplicate of 91426 ***
Comment 7 Olivier Thomann CLA 2005-07-11 09:50:57 EDT
This is another bug.
If more than one task starts with the same character, we select the first one. I
will work on a fix.
Comment 8 Olivier Thomann CLA 2005-07-11 11:45:29 EDT
I added the following comment in the JavaCore.getDefaultOptions()

Note: the tasks are ordered, and the first matching tag will be selected; e.g.
"TODO!,TODO" will match "TODO!" against "TODO" first.

I think the UI should propose a "UP" and "DOWN" buttons to allow the user to
specify his own order. The alphabetic order might not be the desired one.

Moving to JDT/UI.
Comment 9 Olivier Thomann CLA 2005-07-11 11:53:13 EDT
The note should read:
Note: the tasks are ordered, and the first matching tag will be selected; e.g.
"TODO,TODO!" will match "TODO!" against "TODO" first.
Comment 10 Dirk Baeumer CLA 2005-07-12 06:47:51 EDT
Adding Up and Down buttons is IMO confusing for the user since there is already
a priority field. It will be hard to explain what Up/Down would mean since it
will not affect all tags (only those with common prefixes).

Why don't we simply sort the task tags so that tags with common prefixes are
ordered in a way that longer onces appear before shorter onces. This is what the
user expect to happen anyway so there is no need for an additional user interface.

Olivier, could the sorting be done in JDT/Core ?
Comment 11 Martin Aeschlimann CLA 2005-07-12 07:15:30 EDT
The preference page doesn't allow you to enter two tags with the same name,
regardless if they have a different severity.
So the problem is only about tags that a prefix of an other tag.

When matching, the longest match should always be preferred.
Using the order doen't make much sense to me. Why would the user ever want to
sort the longer behind the shorter? It would never result in any matches.
Comment 12 Philipe Mulet CLA 2005-07-12 08:06:23 EDT
The severity is independant from the ordering of tags. 
The implementation is already order sensitive, and it would be the least amount
of changes to reflect this in the UI. Note that it would be consistent with the
handling of access rules or classpath entries. But indeed it only matters in
presence of conflicting tags.
Comment 13 Philipe Mulet CLA 2005-07-12 08:54:31 EDT
Also see comments in bug 53727 for motivation on allowing ordering vs. sorting.

Note that for backward compatibility purpose, having JDTCore start to do the
sorting would be non intuitive (we never do this in other APIs) and would change
some contracts. Selecting the first match is likely a more straightforward approach.
Comment 14 Martin Aeschlimann CLA 2005-07-12 10:33:20 EDT
The original reporter in bug 53727 and in bug 53727 comment 2 both want the
'longest match wins' behaviour. 
It is IMO the intuitive and expected behaviour and does not further complicate
the UI. We had bug reports requesting the UI to sort the elements form users
that had a large number of task tags.

The ordering of tags was so far unspecified by jdt.core. In jdt.ui we used this
fact to always put the 'default' tag first (the default tag is the tag used with
the ${todo} code template variable).
All users so far had to use our UI and did not/could not care about the order of
all entries except the first one.

Please stay backward compatible and keed the order of the entries unspecified.

Again: it makes no sens to order a longer name behind a substring of itself. Why
even offer this to the user? 
Comment 15 Philipe Mulet CLA 2005-07-12 10:43:58 EDT
Backward compatibility imposes we remain order sensitive: i.e. first match is
selected and has always been. UI is doing some sorting already (alphabetical),
so to me either you make it smarter (considering tag length) or you make it user
controlled with ordering buttons. Having the UI reflects what is going on
underneath is likely the best approach here; and having JDTCore be order
sensitive is the most powerful way (allows hiding etc...).

Try to add tag 'aaa', you'll see it added first to the list; even though it
isn't default. 
Comment 16 Philipe Mulet CLA 2005-07-12 10:45:54 EDT
And to clarify, we are not suddenly making the order specified; we always did
but never surfaced it inside our API doc. All we propose to do is to fix the doc
to reflect what the implementation does.
Comment 17 Dirk Baeumer CLA 2005-07-13 09:49:41 EDT
Here are my 2 cents:

- what users want to have is that longer tags match before shorter ones. There
  isn't a single request to allow arbitrary odering for matching and I think
  it isn't needed in the future. Ordering them would only make sense for me
  if we support patterns.

- the algorithm in JDT/Core is currently unspecified

Option one:

- JDT/UI (and all other clients) have to make sure that the tags are ordered in 
  a way so that longer tags appear before shorter in the list so that we get 
  the wanted behaviour with the current implementation in JDT/Core.

Option two:

- JDT/Core implements the longest match first algorithm. Since the semantic of
  the method is currently not speced I think changing it should be fine.


From an API point of view I prefer option two (if we would start with a new
method I think that's what we would implement). Philippe, what are your main
objections regarding changing the behaviour in core ?
Comment 18 Martin Aeschlimann CLA 2006-06-16 06:23:19 EDT
A bug that got forgotten...

As mentioned, we think the correct implementation and what users expect is to always match for the longest match. As this isn't yet specified I think it's fine to introduce that behaviour. Moving to jdt.core.

Comment 19 Keith Whittingham CLA 2006-06-16 07:17:57 EDT
Agreed - longest match is what makes sense to me.
Comment 20 Olivier Thomann CLA 2006-10-06 15:59:33 EDT
Let' see what we can do.
Comment 21 Olivier Thomann CLA 2007-06-21 12:14:35 EDT

*** This bug has been marked as a duplicate of bug 53727 ***
Comment 22 Frederic Fusier CLA 2007-08-07 05:09:27 EDT
Verified for 3.4M1 using build I20070806-1800.