Bug 165773 - Incorrect relevance of content assist proposals
Summary: Incorrect relevance of content assist proposals
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-24 07:31 EST by Missing name CLA
Modified: 2022-12-18 14:56 EST (History)
1 user (show)

See Also:


Attachments
wrong relevance if incorrect case given (15.72 KB, image/png)
2006-11-24 07:43 EST, Missing name CLA
no flags Details
Correct proposal with correct case. (15.93 KB, image/png)
2006-11-24 07:44 EST, Missing name CLA
no flags Details
correct proposal for a shorter input (16.31 KB, image/png)
2006-11-24 07:47 EST, Missing name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2006-11-24 07:31:50 EST
The content assist proposals are ordered by relevance. The relevance ranking mechnism seems to be slightly incorrect. It does not display the most relevant local variable first, if the case is incorrect. Please see the attached screenshots.
Comment 1 Missing name CLA 2006-11-24 07:43:39 EST
Created attachment 54471 [details]
wrong relevance if incorrect case given

This screenshot shows the best match as second proposal, because a lower-case t is given instead of a capital T.
Comment 2 Missing name CLA 2006-11-24 07:44:38 EST
Created attachment 54472 [details]
Correct proposal with correct case.
Comment 3 Missing name CLA 2006-11-24 07:47:02 EST
Created attachment 54473 [details]
correct proposal for a shorter input

If no t is given the correct proposal is shown. If one now adds a lower-case t, the correct proposal stays on top.
Comment 4 Dani Megert CLA 2006-11-24 11:05:18 EST
I guess this is JDT Core relevance.
Comment 5 David Audel CLA 2006-11-27 03:31:34 EST
With test case of comment 1

The first type has the following relevance criterion.
- 'datat' is a prefix of the type name 'DataTransfertContextBase' if case is ignored
- the type doesn't need to be qualified (probably already imported)

Each other types have the following relevance criterion
- 'datat' is a prefix of the type name if case is ignored
- the type needs to be qualified (not imported)

The local variable reference has the following relevance criterion
- 'datat' is a prefix of the variable 'dataTransertService'name if case is ignored
- the name doesn't need to qualified (it's a local variable)

As you can see the first type and the local variable have currently the same relevance.

Why do you think that the local variable should be more relevant ?
- because it's a local variable ?
- because the first character is strictly equals to the prefix first character even if the other part of the name is equals by ignoring case ?
- another reason ?

Your test case show another problem.
DataTransertService type is probably already imported but it is shown as less relevant.
Comment 6 Missing name CLA 2006-11-28 03:46:05 EST
David, thank you for your response.

Yes, I think the local variable should be proposed first because it's local and I think more likely to be used. And yes, only one letter got the wrong case whereas for 'DataTransfertContextBase' two letters got wrong case.

To say it more general: If the input starts with a capital letter, I most likely want to use a class or interface name or a final static variable (something that normally starts with a capital letter). If the input starts with a lower case letter I most likely mean a local or instance variable (or something that starts with a lower case letter). Maybe it would be best to check the first character with strong equality and the remainder with ignoring case.

The DataTransferService, DataTransferServiceTest, DataTransferContextBase and DataTransferContextBaseTest are all defined in the same package (but in different source trees). 
Comment 7 Eclipse Genie CLA 2020-08-24 13:50:04 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 8 Missing name CLA 2020-12-01 12:52:09 EST
I haven't thought about this for like 14 years...

I just tested it: now the local variables are listed first, even if using wrong case. Then methods are offered, also when using wrong case. Only then classes are offered.

I like this (new) behaviour, hence this issue can be closed.
Comment 9 Eclipse Genie CLA 2022-12-18 14:56:23 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.