Bug 110797 - In case of multiple task tags on a single line, the tasks view does not show the complete line for each tag
Summary: In case of multiple task tags on a single line, the tasks view does not show ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-27 09:51 EDT by Maxime Daniel CLA
Modified: 2005-12-12 10:43 EST (History)
1 user (show)

See Also:


Attachments
Proposed fix (1.91 KB, patch)
2005-11-09 21:39 EST, 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 Maxime Daniel CLA 2005-09-27 09:51:39 EDT
Build is Build id: I20050923-1000 (aka 3.2 M2).

If for example I have the following line in my code:
// TODO FIXME need to review the loop
I will get the following items into the Tasks view:
TODO
FIXME need to review the loop
(plus file and line info).

I'd rather get something along the following:
TODO FIXME need to review the loop
FIXME need to review the loop
or:
TODO need to review the loop
FIXME need to review the loop

I could go for a single tag per line and that's it. But I believe that multiple
tags can help when people rely heavily on the source code as the central
artifact of the project (say for example you have a series along the urgency,
and a series along the subdomains like DATA, BUSINESS_RULE, REGULATORY, etc.).
Comment 1 Philipe Mulet CLA 2005-09-28 04:06:13 EDT
Interesting suggestion. We made each task span across the line, unless there was
another task defined on the same line. We simply need to adapt to the most
common usecase.

Is: TODO first thing  TODO second thing 
a valid scenario ? We believed it.

Now, we could simply consider the mangling in case the task description is
empty, so:
TODO FIXME something  
would yield:
--> TODO FIXME something  
--> FIXME something  

but:
TODO first FIXME next
would yield:
--> TODO first 
--> FIXME next

Would that be a fair approach ?



Comment 2 Maxime Daniel CLA 2005-09-28 04:17:19 EDT
I understand that there is a prior use case to protect here, and this would 
only constrain the user to put all his keywords next to each other if he wanted 
the new behavior, which could be considered as good practice anyway.
So all in all, yes, seems fair to me.

Now that I have seen the TODO one TODO second pattern though, I would maybe 
prefer a symmetric approach in which
// TODO FIXME comment TODO comment2 FIXME comment3
would produce:
TODO comment
TODO comment2
FIXME comment 
FIXME comment3
    (order and filtering depending on the tasks view)
or even better:
TODO FIXME comment
TODO comment2
FIXME TODO comment
FIXME comment3
But proposal of comment #1 is OK with me anyway.
Comment 3 Olivier Thomann CLA 2005-11-09 15:13:47 EST
What would you expect for :
// TODO TODO need to review the loop
?
Do you expect:
TODO need to review the loop
and:
TODO need to review the loop

where the first one starts at the beginning of the first TODO and the second one
starts at the beginning of the second TODO or you prefer to keep an empty TODO
and one with the comment?

Comment 4 Olivier Thomann CLA 2005-11-09 21:36:36 EST
The consequence of sharing the message between different tasks is that the end
position of both tasks is identical. So the two tasks overlap. If this is ok,
then I can release my fix.
My fix matches this behavior:
// TODO FIXME need to review the loop
=>
TODO need to review the loop
FIXME need to review the loop

I check if I need to share the message between the two tasks only when I detect
an empty message for one task. So this doesn't penalize the "standard" behavior
when a task has a specific message.

I could be interesting to know what you expect in the case the two tags are the
same.
For example:
// TODO TODO need to review the loop
=>
1) TODO need to review the loop
TODO need to review the loop
or
2) TODO
TODO need to review the loop

For consistency, I would lean to consider 1) as the right answer.
Is this ok for you?
Comment 5 Olivier Thomann CLA 2005-11-09 21:39:42 EST
Created attachment 29673 [details]
Proposed fix

This requires to update two tests in the NegativeTests. I will also add new
regression tests in the builder tests.
Comment 6 Maxime Daniel CLA 2005-11-10 03:26:23 EST
In reply to comment #4, yes, the first suggested behavior is OK with me.
(That is, 
TODO TODO remainder
yields
TODO remainder
TODO remainder
)
Comment 7 Olivier Thomann CLA 2005-11-10 09:29:57 EST
Ok, I will release this version and update the existing tests.
Comment 8 Olivier Thomann CLA 2005-11-10 10:42:18 EST
Fixed and released in HEAD.
Regression tests added in
org.eclipse.jdt.core.tests.builder.BasicBuildTests.testTags/testTags2.
Also updated tests test352/353 in the NegativeTests.
Comment 9 Frederic Fusier CLA 2005-12-12 10:43:35 EST
Verified for 3.2 M4 using build I20051212-0010