Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 500696

Summary: Quickfix for missing library in the .tern-project file doesn't close
Product: [ECD] Orion Reporter: Olivier Thomann <Olivier_Thomann>
Component: EditorAssignee: Project Inbox <orion.editor-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public
Version: 12.0   
Target Milestone: 13.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Olivier Thomann CLA 2016-09-01 12:55:49 EDT
Steps to reproduce:
1) clone https://hub.jazz.net/git/snorthov/space
2) open public/space.js
3) On the first line /*eslint-env browser */, there is a warning:
To work in the 'browser' environment, the 'browser' library must be running.
Add library to .tern-project file

Try the quickfix. It doesn't go away.

A consequence of this is that if you apply it multiple times, the "browser" library is added multiple times in the .tern-project file.
Comment 1 Olivier Thomann CLA 2016-09-01 12:56:20 EDT
You need to move the mouse to close the dialog shown for the quickfix.
Comment 2 Olivier Thomann CLA 2016-09-02 09:19:20 EDT
Michael, this issue is reported by Steve. I tried on orion.eclipse.org and I could reproduce the fact that the dialog doesn't close when the quickfix is invoked without moving the mouse.
Comment 3 Olivier Thomann CLA 2016-09-02 10:37:06 EDT
Created attachment 263936 [details]
Proposed patch

This patch makes sure that we don't add twice the same key in the libs array if the user clicks multiple times before the dialog closes (mouse move). Michael, if you see a good way to close the dialog, this might not be needed, otherwise this would prevent duplicate entries in the libs array.
Comment 4 Michael Rennie CLA 2016-09-06 10:28:06 EDT
(In reply to Olivier Thomann from comment #3)
> Created attachment 263936 [details]
> Proposed patch
> 
> This patch makes sure that we don't add twice the same key in the libs array
> if the user clicks multiple times before the dialog closes (mouse move).
> Michael, if you see a good way to close the dialog, this might not be
> needed, otherwise this would prevent duplicate entries in the libs array.

The dialog closing is done in the platform side of things: specifically in tooltip.js and hover.js. Perhaps there is an underlying exception that is causing the close to not happen?
Comment 5 Olivier Thomann CLA 2016-09-06 13:39:25 EDT
I am not sure if there is anything we can do. When you use the quickfix to remove an unused function, the tooltip is closed because the model of the current editor is changed.
In this case, the current file is not modified. So there is no "onSelection" event that will end up closing the tooltip. So any quickfix that doesn't "modify" the current editor might have the same issue.
In this case, the tooltip is closed on mouse move.

Moving to the editor component as this is where the closing should happen.
Comment 6 Curtis Windatt CLA 2016-10-17 16:08:26 EDT
Fixed with 496020

*** This bug has been marked as a duplicate of bug 496020 ***