Bug 53727 - [Tasks] longest tags should match
Summary: [Tasks] longest tags should match
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 102569 198072 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-04 06:21 EST by Dr. Andreas Krüger CLA
Modified: 2007-08-07 05:00 EDT (History)
3 users (show)

See Also:


Attachments
Proposed fix (2.88 KB, patch)
2007-07-23 15:07 EDT, Olivier Thomann CLA
no flags Details | Diff
Proposed fix + regression test (6.61 KB, patch)
2007-07-24 10:27 EDT, Olivier Thomann CLA
no flags Details | Diff
Proposed fix + regression test (8.27 KB, patch)
2007-07-24 10:29 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dr. Andreas Krüger CLA 2004-03-04 06:21:47 EST
This team I'm with uses

// TODO

task tags a lot.

My name is Andreas Krüger, so to mark stuff I personally need to work on,
I use tags

// TODO AK

I assign "high" priority to these tasks, to make it easier for me to find them.

This works - but only if my personal tag happens to be listed
above the normal one in Windows / Preferences / Java / Task Tags .

For one thing, it is not easy to get it there.  But this is a workaround
only, and besides the point.

In my opinion, the algorithm should be sequence-independent.
Comment 1 Nitin Dahyabhai CLA 2004-04-14 17:55:08 EDT
Are you suggesting matching the longer tags first or making the tag order both
significant and settable with up/down buttons?
Comment 2 Nick Edgar CLA 2005-07-07 10:56:41 EDT
This is a JDT core issue.  I don't think the order in the UI should matter. 
Core should match longer sequences first.
Comment 3 Nitin Dahyabhai CLA 2005-07-07 11:28:07 EDT
I think matching the longest tag first is exactly the wrong thing to do.  I no
place is this implied by the UI, and the UI is what the user sees.  Either they
should be matched in the order shown in the UI or they should all be matched all
of the time.
Comment 4 Nitin Dahyabhai CLA 2005-07-07 11:29:26 EDT
And if the order in the UI does become significant, there should be buttons
added to reorder the tags.
Comment 5 Olivier Thomann CLA 2007-06-21 12:14:35 EDT
*** Bug 102569 has been marked as a duplicate of this bug. ***
Comment 6 Olivier Thomann CLA 2007-06-21 12:17:50 EDT
The task tag definition order should not matter. The longest tag should always match when more than one tag start with the same characters.
Comment 7 Olivier Thomann CLA 2007-07-23 15:07:18 EDT
Created attachment 74386 [details]
Proposed fix

With this patch, the longest match works fine. The user can define task tags like:
TODO, TODO!, TODO?
or TODO AK, TODO, FIXME
and get the proper priority reported.
However this leads to a bug in the syntax highlighting. The highlighted part doesn't correspond to the right tag.
See bug 197530 for details.
Comment 8 Olivier Thomann CLA 2007-07-24 09:41:19 EDT
(In reply to comment #3)
> I think matching the longest tag first is exactly the wrong thing to do.
Why? I believe the longest match is exactly what users are expecting to see.
Comment 9 Olivier Thomann CLA 2007-07-24 10:27:21 EDT
Created attachment 74463 [details]
Proposed fix + regression test
Comment 10 Olivier Thomann CLA 2007-07-24 10:29:33 EDT
Created attachment 74464 [details]
Proposed fix + regression test

I forgot to include the right regression test.
Comment 11 Olivier Thomann CLA 2007-07-24 10:30:04 EDT
Released for 3.4M1.
Regression test added in org.eclipse.jdt.core.tests.builder.BasicBuildTests#testTags4
Comment 12 Nitin Dahyabhai CLA 2007-07-24 14:49:29 EDT
(In reply to comment #8)
> (In reply to comment #3)
> > I think matching the longest tag first is exactly the wrong thing to do.
> Why? I believe the longest match is exactly what users are expecting to see.

Matching from the list in the order shown is what I'd expect.

Comment 13 Olivier Thomann CLA 2007-07-30 10:53:49 EDT
*** Bug 198072 has been marked as a duplicate of this bug. ***
Comment 14 Olivier Thomann CLA 2007-07-30 11:06:31 EDT
(In reply to comment #12)
> Matching from the list in the order shown is what I'd expect.
As long as the UI has no way to sort the items in the list, this is not possible as some tasks could never be used (TODO! vs TODO).
The longuest match has been implemented.
Comment 15 Nitin Dahyabhai CLA 2007-07-30 16:29:20 EDT
(In reply to comment #14)
> (In reply to comment #12)
> > Matching from the list in the order shown is what I'd expect.
> As long as the UI has no way to sort the items in the list, this is not
> possible as some tasks could never be used (TODO! vs TODO).

Admittedly I'm not volunteering to implement it at the moment, but maybe it *should*?
Comment 16 Frederic Fusier CLA 2007-08-07 05:00:55 EDT
Verified for 3.4M1 using build I20070806-1800.

Note that UI still does not color correctly tags with white spaces (in 'TODO AK', only 'TODO' is colored as a task tag, 'AK' is still colored as a part of a comment text) but this is already described in bug 58205...