| Summary: | [content assist] Substring completion breaks proposal sorting | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
| Component: | Text | Assignee: | Noopur Gupta <noopur_gupta> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | daniel_megert, Lars.Vogel, marcel.bruch, stephan.herrmann |
| Version: | 4.6 | ||
| Target Milestone: | 4.6 M5 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 487668 | ||
Just so this example doesn't get lost: (In reply to Stephan Herrmann from bug 481752 comment #9) > In I20151201-1100 which contains the fix from bug 481752 comment 8 I see the following > bad behavior: > > > I completely typed all of these characters: > > String.valueOf(currentMethod.selector).equals("foo") > > but completion changed this to > > String.copyValueOf(currentMethod.selector).contentEquals("foo") (In reply to Stephan Herrmann from bug 481752 comment #11) > Sorry if it wasn't clear. > > Let me split into steps: > > (1) Type: > String.valueOf > (2) Type: > ( > -> Completion inserts to become: > String.copyValueOf(|) > (3) Insert argument and continue typing until you have: > String.copyValueOf(currentMethod.selector).equals > (4) Type: > ( > -> Completion inserts to become: > String.copyValueOf(currentMethod.selector).contentEquals(|) > > In both cases it picked a proposal that is a worse match than what I had > typed up-to that point. > > Disclaimer: I didn't even look at the list of proposals, because I was > faster by just typing the 6 / 7 chars. Just ran into this with String#equals(..): - type "a string". => auto-assist opens proposals popup - type equ - press Enter => inserts contentEquals(..) What exactly has been fixed here? Using I20160125-0400 the scenario from comment 1 is still or again broken. Just try to *type* the following method: void test(char[] arg) { String.valueOf(arg).equals("foo"); } You can't! It gets: void test(char[] arg) { String.copyValueOf(arg).contentEquals("foo"); } (In reply to Stephan Herrmann from comment #4) > What exactly has been fixed here? > > Using I20160125-0400 the scenario from comment 1 is still or again broken. > Just try to *type* the following method: > > void test(char[] arg) { > String.valueOf(arg).equals("foo"); > } > > You can't! > It gets: > > void test(char[] arg) { > String.copyValueOf(arg).contentEquals("foo"); > } I cannot reproduce this using this build (without any other plug-ins): http://download.eclipse.org/eclipse/downloads/drops4/I20160125-2000/ Bug 483512 is closer to what you see, but even with 'Insert common prefixes automatically' enabled, I can't reproduce this. If you can still reproduce the problem with I20160125-2000 or newer, then please file a new bug with more detailed steps. (In reply to Dani Megert from comment #5) > Bug 483512 is closer to what you see, but even with 'Insert common prefixes > automatically' enabled, I can't reproduce this. Sorry, that bug is not related. (In reply to Dani Megert from comment #5) > (In reply to Stephan Herrmann from comment #4) > > What exactly has been fixed here? > > > > Using I20160125-0400 the scenario from comment 1 is still or again broken. > > Just try to *type* the following method: > > > > void test(char[] arg) { > > String.valueOf(arg).equals("foo"); > > } > > > > You can't! > > It gets: > > > > void test(char[] arg) { > > String.copyValueOf(arg).contentEquals("foo"); > > } > > I cannot reproduce this using this build (without any other plug-ins): > http://download.eclipse.org/eclipse/downloads/drops4/I20160125-2000/ When I re-opened the bug I was sure I used a pristine SDK, workspace, project everything. When re-testing today, I see proposals sorted as intended and all works fine. Sorry for the noise. Verified in eclipse-SDK-I20160126-0800-win32-x86_64. |
I20151201-1100 Invoke Content Assist after "s.", then type "st": String s = ""; s. When substring matches are enabled, the most relevant completions ("startWith") are not on top of the list any more. When you complete after "s.st", the proposals are sorted as expected. => Substring completions require Content Assist to re-compute the relevance of all proposals when the user continues typing. This is especially important when the proposal popup has been opened automatically by the auto-activation trigger on ".".