Bug 99812 - [navigation] Outliner doesn't highlight the name of the package declaration for package-info
Summary: [navigation] Outliner doesn't highlight the name of the package declaration f...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC3   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-13 16:01 EDT by Olivier Thomann CLA
Modified: 2005-06-16 04:58 EDT (History)
1 user (show)

See Also:


Attachments
Possible fix (1008 bytes, patch)
2005-06-13 16:22 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 Olivier Thomann CLA 2005-06-13 16:01:46 EDT
RC2.

1) Create a project P with src/bin as source/output folders
2) Create a package 'p'
3) Create a file in this package that contains:
@java.lang.Deprecated
package p;

Click on the package declaration in the outliner and you get the position of the
'p' in Deprecated.

It looks like the first 'p' is highlighted. This looks awkwards.
Comment 1 Olivier Thomann CLA 2005-06-13 16:16:01 EDT
At least the indexOf(...) should be used to locate the name after the 'package'
keyword.
This might not support unicode, but this would at least be an improvement.
Comment 2 Olivier Thomann CLA 2005-06-13 16:22:26 EDT
Created attachment 22969 [details]
Possible fix

This fix doesn't handle unicode. I don't see how it is possible to handle
unicodes without using a scanner. And a scanner is pretty expensive. So this
could be a simple solution when no unicode are involved.
Comment 3 Dani Megert CLA 2005-06-14 04:23:05 EDT
>3) Create a file in this package that contains:
The file must be named 'package-info.java'

The fix is simple and makes sense. Given that a major focus for 3.1 is on J2SE
5.0 I approve this fix for 3.1.

Dirk?

Please see bug 99903 for a problem related to package-info range in JDT Core.
Comment 4 Dani Megert CLA 2005-06-14 04:34:04 EDT
Also note that I have a different fix since the proposed fix does not take into
account comments in front of the package declaration. The fix differs only by
using lastIndexOf("package") instead of indexOf("package"). Olivier do you agree
in this modification of your patch?
Comment 5 Olivier Thomann CLA 2005-06-14 08:24:29 EDT
Sure. This would indeed be better. The best solution would remain the use of a
scanner, but this might be a little expensive.
A scanner would scan for "package" as a keyword and then take the next "name"
(identifiers separated by '.'). This solution would handle unicodes.
Comment 6 Dirk Baeumer CLA 2005-06-14 12:03:29 EDT
+1.
Comment 7 Dani Megert CLA 2005-06-14 12:20:28 EDT
Released to HEAD. Reviewed by Markus.
Comment 8 Dani Megert CLA 2005-06-16 04:58:20 EDT
Verified in N20050616-0010.