Bug 575032 - [content assist] no content assist on field, in block, before statement
Summary: [content assist] no content assist on field, in block, before statement
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.20   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 4.21 M3   Edit
Assignee: Stephan Herrmann CLA
QA Contact: Vikas Chandra CLA
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks: 574913
  Show dependency tree
 
Reported: 2021-07-26 07:00 EDT by Julian Honnen CLA
Modified: 2021-10-21 15:19 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Honnen CLA 2021-07-26 07:00:55 EDT
No content assist is offered in the following example:

public class Overwrite {

	void test(Test t) {
		Map<String, String> map = new HashMap<>();
		
		if (true) {
			t.counter.| // <<--
			map.put("", "");
		}
	}
	
	static class Test {
		AtomicInteger counter = new AtomicInteger();
	}
}

Issue doesn't occur without either the surrounding if (plain block works) or the following statement.

Tested in 
Version: 2021-09 (4.21)
Build id: I20210725-1800
Comment 1 Noopur Gupta CLA 2021-07-26 08:00:56 EDT
Moving to JDT Core for investigation.
Comment 2 Stephan Herrmann CLA 2021-07-31 15:55:28 EDT
Interestingly, whitespace matters here:

works:
		t.counter.|map.put("", "");
doesn't work:
		t.counter.| map.put("", "");
Comment 3 Stephan Herrmann CLA 2021-08-03 15:33:10 EDT
The fix for bug 574215 was incomplete, as it accounted only for a single prefix "p.|" not for more like "p.q.|".

I have a patch under test.
Comment 4 Stephan Herrmann CLA 2021-08-03 18:02:29 EDT
Fix has been approved by jenkins, but notifications are absent or slow here in bugzilla.

What's more: we seem to have lost some recent commits in git.

Linking to my message on cross-projects doesn't work either, because https://www.eclipse.org/lists/cross-project-issues-dev/index.html doesn't know that August has begun.
Comment 5 Stephan Herrmann CLA 2021-08-04 12:18:55 EDT
After restoring master history from my local copy, I could now merge the change, it's https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=6443fa1eee558369cd85281b7f623853cf6a469e

Let's see if we get any automatic linking from gerrit.
Comment 6 Manoj N Palat CLA 2021-08-19 02:53:20 EDT
Verified with Eclipse 4.21 M3 Version: 2021-09 (4.21) Build id: I20210818-1800
Comment 7 Stephan Herrmann CLA 2021-10-21 15:19:42 EDT
For posterity: this fix was superseded by part of the fix in bug 575631 (4.22 M2).