Bug 575591 - Autocomplete in Lambda with JUnit Assertion
Summary: Autocomplete in Lambda with JUnit Assertion
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.20   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.21 RC2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2021-08-24 07:54 EDT by Shawn Zernik CLA
Modified: 2021-09-19 17:43 EDT (History)
2 users (show)

See Also:


Attachments
Auto complete working. (148.29 KB, image/png)
2021-08-24 07:54 EDT, Shawn Zernik CLA
no flags Details
AfterAssert (91.39 KB, image/png)
2021-08-24 07:56 EDT, Shawn Zernik CLA
no flags Details
WithAssert (64.78 KB, image/png)
2021-08-24 07:56 EDT, Shawn Zernik CLA
no flags Details
BeforeAssert (148.29 KB, image/png)
2021-08-24 07:57 EDT, Shawn Zernik CLA
no flags Details
Java code. (479 bytes, application/octet-stream)
2021-08-24 07:58 EDT, Shawn Zernik CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn Zernik CLA 2021-08-24 07:54:10 EDT
Created attachment 287001 [details]
Auto complete working.

Autocomplete is not providing a list of options once an assertion has been added to the function.  The following works before adding the assertion.  See "BeforeAssert" image.

I then add the assertTrue().  See "WithAssert".

Now when I type user dot, auto complete does not recommend options, so I then type ctrl-space to get a list - empty. See "AfterAssert" image.

I noticed this when working on unit tests because I'm copying tests to make different variations, and they usually contain an assertion at the end.

I can work around by commenting out the assert, and everything works.
Comment 1 Shawn Zernik CLA 2021-08-24 07:56:01 EDT
Created attachment 287002 [details]
AfterAssert
Comment 2 Shawn Zernik CLA 2021-08-24 07:56:22 EDT
Created attachment 287003 [details]
WithAssert
Comment 3 Shawn Zernik CLA 2021-08-24 07:57:05 EDT
Created attachment 287004 [details]
BeforeAssert
Comment 4 Shawn Zernik CLA 2021-08-24 07:58:40 EDT
Created attachment 287005 [details]
Java code.
Comment 5 Shawn Zernik CLA 2021-08-24 07:59:53 EDT
I've simplified and used the variable passed to my lambda, someVar - and when I type the dot, nothing appears.  This eliminated my User class from the senario.
Comment 6 Andrey Loskutov CLA 2021-09-10 14:18:29 EDT
Please check with 4.21 RC2a if the bug was fixed, may be one of linked bugs to bug 574913 are related.
Comment 7 Holger Voormann CLA 2021-09-19 17:43:46 EDT
I can reproduce this issue in 4.20, but not anymore in 4.21 and in I20210917-1800.

Therefore, I close this bug as fixed.

Shawn, thanks for reporting. Please upgrade to Eclipse 2021-09 (4.21) to get this and other content assist fixes (see bug 574913).