Bug 510743

Summary: [content assist] Asynchronous content assist does not report errors to the user
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: TextAssignee: Mickael Istria <mistria>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: gautier.desaintmartinlacaze, julian.honnen, laeubi, Lars.Vogel, peter
Version: 4.7   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/89872
https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/89872
Whiteboard:
Bug Depends on:    
Bug Blocks: 251156    

Description Dani Megert CLA 2017-01-20 05:33:37 EST
I20170119-2000.

1. Change JavaSourceViewerConfiguration to use the asynchronous content assistant
2. Start a target workbench
3. Paste "class Test {m}" into the Package Explorer
4. Invoke content assist after m
==> Invalid thread access
==> no proposals, and no error dialog that informs the user

See "normal" content assistant on how it should look like.
Comment 1 Mickael Istria CLA 2017-01-20 06:31:13 EST
(In reply to Dani Megert from comment #0)
> ==> no proposals, and no error dialog that informs the user

At this point, I don't think an error dialog is the best way to render such error to user; moreover, such error should rather be perceived as a bug in the proposal computer than in the content assistant itself. That said, it's still worth reporting it.
What would you think about showing in the proposal list an error entry "Error computing some proposals, see log for details" ?
The benefit would be that it shows the feedback in its context rather than showing a pop-up, and doesn't "interrupt" the expected flow.
Comment 2 Dani Megert CLA 2017-01-20 07:58:15 EST
(In reply to Mickael Istria from comment #1)
> (In reply to Dani Megert from comment #0)
> > ==> no proposals, and no error dialog that informs the user
> 
> At this point, I don't think an error dialog is the best way to render such
> error to user; moreover, such error should rather be perceived as a bug in
> the proposal computer than in the content assistant itself. That said, it's
> still worth reporting it.

I think you did not read my comment 0 and look how it is done in the normal content assistant. Please do so before we continue to discuss.
Comment 3 Mickael Istria CLA 2017-01-22 03:44:35 EST
Sorry, I had the JDT completion processor error reporting in mind. I fully agree errors should be handled the same way for async (using ExceptionLoggingSafeRunnable and fLastErrorMessage). I'll try to have it patched for tomorrow build, but to be honest, I'm not that confident I'll manage to have it in time...

Whether to show it to user in the completion pop-up or not is another story.
Comment 4 Eclipse Genie CLA 2017-01-30 10:49:18 EST
New Gerrit change created: https://git.eclipse.org/r/89872
Comment 5 Mickael Istria CLA 2020-01-09 09:24:37 EST
*** Bug 558977 has been marked as a duplicate of this bug. ***
Comment 6 Christoph Laeubrich CLA 2021-01-21 09:16:52 EST
@Mickael: I also noticed that content assist processor seems to be blacklisted once the throw an exception is this intentional?
Comment 7 Mickael Istria CLA 2021-01-21 09:23:17 EST
(In reply to Christoph Laeubrich from comment #6)
> @Mickael: I also noticed that content assist processor seems to be
> blacklisted once the throw an exception is this intentional?

In JDT, it is intentional.
In general, I don't think it's intentional.
Comment 8 Christoph Laeubrich CLA 2021-01-21 09:28:02 EST
I'm currently adding content-assist for an editor that calls an external tool, if that tool fails the following happens:
- no content assist is shown, no error is show to the user
- my content assist processor seems to be never called again

I just can't tell if (async) contest assist itself is "dead" at that point or my processor gets black-listed somehow. If I reopen the editor everything is back to normal.