Bug 67381 - [navigation] Improve Java word navigation
Summary: [navigation] Improve Java word navigation
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 67945 68454 107246 107500 367077 (view as bug list)
Depends on: 58098
Blocks:
  Show dependency tree
 
Reported: 2004-06-15 17:18 EDT by Max Gilead CLA
Modified: 2016-09-06 02:46 EDT (History)
11 users (show)

See Also:
noopur_gupta: review-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Gilead CLA 2004-06-15 17:18:57 EDT
Problem described in bug #58098 is not fixed for Linux/GTK - regardless of the
setting of 'Preferences > Java > Editor > Navigation > [x] Smart caret
positioning in Java names (...)" cursor is always positioned before of each part
of JAVA_CONSTANT_NAMES.

Bug #58098 was marked as fixed because I'm told that problem mentioned there is
solved on other platforms and I was asked to file separate bug for GTK only.

So, what I (as a user) think is wrong is that it's impossible to TURN OFF smart
cursor positioning in JAVA_CONSTANT_NAMES on Linux/GTK. Desired behavior is that
when moving with Ctrl+Left/Right cursor is positioned at the begin and the end
of JAVA_CONSTANT_NAME - nowhere inside it.
Comment 1 Dani Megert CLA 2004-06-16 03:14:38 EDT
OK - I now understand what you mean. We currently offer the following:

- option off: you get platform behavior (stops at non-word chars like _)
- option on:  you get smarter behavior where it stops at every word char start
and at word beginnigs inside composed identifiers

What you are asking for / expecting is to have another option which does not
stop at non-word chars inside Java identifiers.
Comment 2 Dani Megert CLA 2004-06-16 03:18:00 EDT
We should also improve the preference naming to better state that this affects
the word navigation commands.
Comment 3 Markus Keller CLA 2004-06-18 07:07:37 EDT
+1.
The option could be called "Smart word breaks (overrides platform behavior)"
with a sub-option "Word breaks inside identifiers".
Comment 4 Dani Megert CLA 2004-07-20 03:21:22 EDT
*** Bug 68454 has been marked as a duplicate of this bug. ***
Comment 5 Dani Megert CLA 2004-07-20 03:22:18 EDT
*** Bug 67945 has been marked as a duplicate of this bug. ***
Comment 6 Dani Megert CLA 2005-08-18 02:56:05 EDT
*** Bug 107246 has been marked as a duplicate of this bug. ***
Comment 7 Dani Megert CLA 2005-08-22 05:35:58 EDT
*** Bug 107500 has been marked as a duplicate of this bug. ***
Comment 8 Dani Megert CLA 2011-12-20 03:12:50 EST
*** Bug 367077 has been marked as a duplicate of this bug. ***
Comment 9 Fredrik Wendt CLA 2011-12-23 07:48:56 EST
Max (reporter of this bug) mentions Linux/GTK specific issues in the beginning ("it's impossible to TURN OFF smart cursor positioning in JAVA_CONSTANT_NAMES on Linux/GTK").

Dani then mentions the issue that I'm after: Eclipse should support proper navigation with both CamelCase and underscore_naming in Java identifiers. Currently (in Indigo and Helios) you have to choose either:
* Platform which works OK with underscore_naming.
* Java specific, which works perfect with camelCase but not at all with underscore_naming, except for CONSTANT_NAME_IDENTIFIERS.

I would prefer support for both camelCaseForProductionCode and test_method_names_that_describe_quite_a_lot_using_underscores_to_help_reading. Is this what this bug report is about?
Comment 10 Dani Megert CLA 2012-01-03 06:26:06 EST
> I would prefer support for both camelCaseForProductionCode and
> test_method_names_that_describe_quite_a_lot_using_underscores_to_help_reading.
> Is this what this bug report is about?

Yes.
Comment 11 Mike Kessler CLA 2014-06-13 17:06:54 EDT
Is there any update to this?  I would definitely appreciate this feature as it is common in most editors.
Comment 12 Marvin Fröhlich CLA 2016-03-15 09:43:08 EDT
Any update here? Would be very appreciated to have underscore navigation combined with camel case navigation.
Comment 13 Nanda Firdausi CLA 2016-09-01 03:32:57 EDT
I have a patch for this: https://git.eclipse.org/r/#/c/80170/

Could someone review it?
Comment 14 Lars Vogel CLA 2016-09-01 04:23:34 EDT
This would be a very nice enhancements. Noopur can you review this for M2?
Comment 15 Noopur Gupta CLA 2016-09-02 01:32:20 EDT
(In reply to Nanda Firdausi from comment #13)
> I have a patch for this: https://git.eclipse.org/r/#/c/80170/
> 
> Could someone review it?

This patch does not implement the behavior and the new option as mentioned in comment #1 and comment#3. 

It just provides the fix for comment #9. But the original problem from comment#0 is not fixed. 

Also, note that this is a common bug for improving Java word navigation and should fix all the problems reported in duplicate bugs as well like bug 67945, bug 107246 etc.
Comment 16 Nanda Firdausi CLA 2016-09-02 01:34:53 EDT
(In reply to Noopur Gupta from comment #15)
> (In reply to Nanda Firdausi from comment #13)
> > I have a patch for this: https://git.eclipse.org/r/#/c/80170/
> > 
> > Could someone review it?
> 
> This patch does not implement the behavior and the new option as mentioned
> in comment #1 and comment#3. 
> 
> It just provides the fix for comment #9. But the original problem from
> comment#0 is not fixed. 

Sure, I won't mark the bug fixed if I manage to submit the patch. But I think the patch is good as is, right?
> 
> Also, note that this is a common bug for improving Java word navigation and
> should fix all the problems reported in duplicate bugs as well like bug
> 67945, bug 107246 etc.
Comment 17 Noopur Gupta CLA 2016-09-02 01:40:31 EDT
(In reply to Nanda Firdausi from comment #16)
> > This patch does not implement the behavior and the new option as mentioned
> > in comment #1 and comment#3. 
> > 
> > It just provides the fix for comment #9. But the original problem from
> > comment#0 is not fixed. 
> 
> Sure, I won't mark the bug fixed if I manage to submit the patch. But I
> think the patch is good as is, right?
> > 
> > Also, note that this is a common bug for improving Java word navigation and
> > should fix all the problems reported in duplicate bugs as well like bug
> > 67945, bug 107246 etc.

I just used the patch to have a look at the functionality currently without looking into the code. It should add the new option and work correctly for all the reported problems first.
Comment 18 Lars Vogel CLA 2016-09-02 03:43:58 EDT
(In reply to Noopur Gupta from comment #17)
> I just used the patch to have a look at the functionality currently without
> looking into the code. It should add the new option and work correctly for
> all the reported problems first.

It is hard for new contributors to fix "aggregator" bugs. Maybe https://bugs.eclipse.org/bugs/show_bug.cgi?id=67381#c9 could be split out into a bug on which this bugs depend. I think it is a pretty isolated requirement and I do not see why this cannot not be fixed in isolation.
Comment 19 Nanda Firdausi CLA 2016-09-02 04:15:20 EDT
> It is hard for new contributors to fix "aggregator" bugs. Maybe
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=67381#c9 could be split out
> into a bug on which this bugs depend. I think it is a pretty isolated
> requirement and I do not see why this cannot not be fixed in isolation.

Yes, I don't know if there is any policy for contributor to always reference a bug for a patch and to always fix a bug as a whole in one patch. If yes, then I'll create a new bug for my patch.
Comment 20 Noopur Gupta CLA 2016-09-06 02:46:17 EDT
At least all the underscore related issues should be fixed at the same time. This would also require the new option from comment #3.

Other duplicate bugs like bug 67945 can be reopened to be fixed separately after this one is fixed for the underscore issues.