-
Notifications
You must be signed in to change notification settings - Fork 227
Description
Hi.
According to the discussion, I transformed it into an issue. Attached you can find: i) Main.java a very brief example to reproduce the problem; simply start the application while in the editor, press ctrl+space multiple times (many times, to be able to see that there are actually many overlapped content assistants open - see figure1).
The problem looks to be at https://github.com/eclipse-platform/eclipse.platform.ui/blob/master/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java#L1248
Rationale
- condition 1241 is true only when the listener is armed and it is armed if and only if the widgettoken is acquired by the ContentAssistant (see code of addContentAssistListener)
- if the listener is installed, the ContentAssistant is displayed
- however, a second ContentAssistant cannot acquire the widgettoken and the execution gets to line 1248 and thus, the (nth) ContentAssistant is still displayed (?!?!). Instead of going to 1248, I would expect the execution to get to 1252 and hide the additional ContentAssist (actually, this looks to be the case earlier - see this blame view where hide() is executed when the listener/widgettoken cannot be acquired https://github.com/eclipse-platform/eclipse.platform.ui/blame/a1ac8bebc4317a8647163943422a9ed27907aedc/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java#L1225)
Discussed in #1184
Originally posted by petrufm October 2, 2023
Hi,
In file https://github.com/eclipse-platform/eclipse.platform.ui/blob/master/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java#L1248 I observed it would be possible to make visible a content assist without arming its CompletionProposalPopup (this) listener. Is this intended? Among others, multiple content assists may be made visible simultaneously.
Thanks.