Bug 514917 - [open type] Open Type dialog should ignore leading/trailing whitespace
Summary: [open type] Open Type dialog should ignore leading/trailing whitespace
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.7   Edit
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 520292 565866 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-04-07 05:34 EDT by Andreas Sewe CLA
Modified: 2020-08-07 01:51 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Sewe CLA 2017-04-07 05:34:15 EDT
When one copies and pastes class names from external sources (stack traces, build output, etc.), it is easy to accidentally include leading or trailing whitespace. It would be nice if the Open Type dialog would simply strip or ignore any leading and trailing whitespace, as it cannot occur in a type name anyway.
Comment 1 Dani Megert CLA 2017-04-07 06:53:27 EDT
Note that a trailing space has a meaning: it prevents the automatic prefix matching.

Did you try Navigate > Open from Clipboard (Ctrl+Shift+V)? This does what you want and even more. It can e.g. also open methods and understands stack trace entries, e.g.
MessageDialog.openConfirm(Shell, String, String)
Comment 2 Andreas Sewe CLA 2017-04-07 07:13:01 EDT
(In reply to Dani Megert from comment #1)
> Note that a trailing space has a meaning: it prevents the automatic prefix
> matching.

Didn't know that.

"Enter type name prefix or pattern (*, ?, or camel case)" doesn't communicate this. I have no idea how to rephrase this such that it does, unfortunately.

If JDT would use well-known anchor characters like ^ or $, a terse description along the lines of "*, ?, or camel case", which relies on the developer's experience with globs, might work, but $ is obviously a bad anchor character in Java code.

> Did you try Navigate > Open from Clipboard (Ctrl+Shift+V)? This does what
> you want and even more. It can e.g. also open methods and understands stack
> trace entries, e.g.
> MessageDialog.openConfirm(Shell, String, String)

No, I went straight for Open Type (Ctrl+Shift+T), as I knew I had copy and pasted a type name.
Comment 3 Dani Megert CLA 2018-04-17 08:31:55 EDT
*** Bug 520292 has been marked as a duplicate of this bug. ***
Comment 4 Noopur Gupta CLA 2020-08-07 01:51:15 EDT
*** Bug 565866 has been marked as a duplicate of this bug. ***