Bug 506804 - content assist substring matches should be sorted after prefix matches
Summary: content assist substring matches should be sorted after prefix matches
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: 3.25   Edit
Assignee: Julian Honnen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 502832 550862 551814 558644 565315 565843 567047 (view as bug list)
Depends on: 461809
Blocks:
  Show dependency tree
 
Reported: 2016-10-31 14:16 EDT by Sam Davis CLA
Modified: 2020-10-01 06:36 EDT (History)
18 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Davis CLA 2016-10-31 14:16:14 EDT
* type PlatformUI.g
* content assist lists PLUGIN_ID and RETURN_EMERGENCY_CLOSE as the first matches

I would expect getPreferenceStore to be the first result in this case, which it is if you actually hit ctrl+space. However when content assist is activated by typing . the matches are sorted differently than when using ctrl+space.

I am finding that having substring matches enabled makes content assist much less useful, because when typing the first letters of a method name, I get a bunch of irrelevant proposals and have to either type a lot of the method name before it gets sorted to the top or use the arrow keys to select it from way down the list of proposals.
Comment 1 Markus Keller CLA 2016-11-01 12:23:39 EDT
Which build?
Is Code Recommenders enabled (Prefs > Java > Editor > Content Assist > Advanced)?

Works fine for me in Eclipse SDK 4.7 (I20161101-0800) and 4.6.1 (M20160907-1200): getPreferenceStore() is always the first proposal after

		PlatformUI.g

If the result of the expression is assigned to a variable, then the relevance of proposals with a matching type is increased, and PLUGIN_ID comes first here: 

		String s = PlatformUI.g
Comment 2 Sam Davis CLA 2016-11-01 16:06:15 EDT
The build is Neon.1 (4.6.1), Build id: M20160907-1200. Code Recommenders is not installed. If I uncheck "Java Proposals (Task Focused)" and check "Java Proposals" this doesn't happen. But when cycling through the proposal kinds, the Task Focused proposals also don't have this problem. So I think it has something to do with the way the "default" proposal provider is ordering things.
Comment 3 Noopur Gupta CLA 2016-11-02 04:34:49 EDT
"Java Proposals (Task-Focused)" is provided by Mylyn and as mentioned, the problem does not happen when this is unchecked. Moving to Mylyn.
Comment 4 Sam Davis CLA 2016-11-02 18:00:11 EDT
"Java Proposals (Task-Focused)" works correctly. The problem is that the default proposal computer is not sorting things correctly. I wonder if this is related to bug 461809.

Moving back to JDT because I don't see how we can fix this in Mylyn. Note that "Java Proposals (Task-Focused)" is enabled by default in most distributions, so most JDT users will see this bug.
Comment 5 Markus Keller CLA 2016-11-03 07:04:51 EDT
Could be related to bug 488441. The default relevance constants for JDT proposals have been changed, and that could explain problems when Mylyn and JDT proposals are to be shown in the same list.
Comment 6 Sam Davis CLA 2016-11-03 14:07:22 EDT
I don't know, this happens even if the task-focused computer is the only one included in the default proposal list in preferences. Where are those relevance constants defined?
Comment 7 Markus Keller CLA 2016-11-07 09:29:25 EST
(In reply to Sam Davis from comment #6)
> I don't know, this happens even if the task-focused computer is the only one
> included in the default proposal list in preferences.

So it's a Mylyn-only problem as Noopur said in comment 3. Standalone JDT is fine, and if you think there's a problem in a JDT API, then you have to tell us where.

> Where are those
> relevance constants defined?

Bug 488441 comment 16 gives the commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=a9d318d978e4e9e6f3804e5aae1e81ed6e4a0136
Comment 8 Sam Davis CLA 2016-11-21 16:26:49 EST
Given that our lengthy investigation of bug 461809 did not result in a fix, I'm not optimistic the result here would be different. We will probably not have the time to dive into the JDT code base to find the bug in the default proposal computer's sorting, so I don't think this is going to be fixed any time soon.
Comment 9 Yanming Zhou CLA 2019-08-21 23:01:39 EDT
Any progress?
Comment 10 Stephan Herrmann CLA 2019-09-26 15:33:50 EDT
*** Bug 550862 has been marked as a duplicate of this bug. ***
Comment 11 Stephan Herrmann CLA 2019-09-26 15:41:12 EDT
(In reply to Sam Davis from comment #8)
> Given that our lengthy investigation of bug 461809 did not result in a fix,
> I'm not optimistic the result here would be different.

Are you saying this bug shares the same root cause with bug 461809? Sure, or just a guess?

As it stands this group of bugs is perceived as a major regression in the content assist provided by JDT.
Comment 12 Ed Merks CLA 2019-09-26 23:51:03 EDT
(In reply to Stephan Herrmann from comment #11)
> (In reply to Sam Davis from comment #8)
> > Given that our lengthy investigation of bug 461809 did not result in a fix,
> > I'm not optimistic the result here would be different.
> 
> Are you saying this bug shares the same root cause with bug 461809? Sure, or
> just a guess?
> 
> As it stands this group of bugs is perceived as a major regression in the
> content assist provided by JDT.

Indeed, I've been cursing this behavior and I assumed it to be a JDT regression. Exactly as described in 550862  I typed "map.put(" and it inserts something else that has "put" in it but not the simple obvious thing that I typed.  It's seriously beyond annoying.
Comment 13 Sam Davis CLA 2019-09-27 14:28:02 EDT
(In reply to comment #11)
> (In reply to Sam Davis from comment #8)
> > Given that our lengthy investigation of bug 461809 did not result in a fix,
> > I'm not optimistic the result here would be different.
> 
> Are you saying this bug shares the same root cause with bug 461809? Sure, or
> just a guess?

I do not know.
Comment 14 Stephan Herrmann CLA 2019-10-06 06:30:00 EDT
*** Bug 551814 has been marked as a duplicate of this bug. ***
Comment 15 Stephan Herrmann CLA 2019-12-27 17:05:01 EST
*** Bug 558644 has been marked as a duplicate of this bug. ***
Comment 16 Julian Honnen CLA 2020-04-29 02:39:58 EDT
*** Bug 502832 has been marked as a duplicate of this bug. ***
Comment 17 Eclipse Genie CLA 2020-08-06 02:42:27 EDT
New Gerrit change created: https://git.eclipse.org/r/c/mylyn/org.eclipse.mylyn.context/+/167329
Comment 18 Julian Honnen CLA 2020-08-06 02:48:21 EDT
*** Bug 565843 has been marked as a duplicate of this bug. ***
Comment 19 Eclipse Genie CLA 2020-08-07 02:28:27 EDT
New Gerrit change created: https://git.eclipse.org/r/c/mylyn/org.eclipse.mylyn.context/+/167375
Comment 21 Eclipse Genie CLA 2020-08-12 18:19:03 EDT
New Gerrit change created: https://git.eclipse.org/r/c/mylyn/org.eclipse.mylyn.context/+/166844
Comment 23 Vikas Chandra CLA 2020-09-22 07:28:55 EDT
*** Bug 567047 has been marked as a duplicate of this bug. ***
Comment 24 Julian Honnen CLA 2020-10-01 06:36:50 EDT
*** Bug 565315 has been marked as a duplicate of this bug. ***