Community
Participate
Working Groups
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.).
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 ?
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.
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?
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?
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.
In reply to comment #4, yes, the first suggested behavior is OK with me. (That is, TODO TODO remainder yields TODO remainder TODO remainder )
Ok, I will release this version and update the existing tests.
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.
Verified for 3.2 M4 using build I20051212-0010