-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mini-browser] fix 'Open Source' implementation #5223
Labels
mini-browser
issues related to the mini-browser
Comments
Investigation of #5110 |
fangnx
pushed a commit
to fangnx/theia
that referenced
this issue
May 23, 2019
…pen source" to work with image/pdf files Signed-off-by: fangnx <[email protected]>
fangnx
pushed a commit
to fangnx/theia
that referenced
this issue
May 23, 2019
…pen source" to work with image/pdf files Signed-off-by: fangnx <[email protected]>
1 task
fangnx
pushed a commit
to fangnx/theia
that referenced
this issue
May 23, 2019
…pen source" to work with image/pdf files Signed-off-by: fangnx <[email protected]>
fangnx
pushed a commit
to fangnx/theia
that referenced
this issue
May 27, 2019
…pen source" to work with image/pdf files Signed-off-by: fangnx <[email protected]>
fangnx
pushed a commit
to fangnx/theia
that referenced
this issue
May 27, 2019
…pen source" to work with image/pdf files Signed-off-by: fangnx <[email protected]>
fangnx
pushed a commit
to fangnx/theia
that referenced
this issue
May 28, 2019
…pen source" to work with image/pdf files Signed-off-by: fangnx <[email protected]>
fangnx
pushed a commit
to fangnx/theia
that referenced
this issue
May 29, 2019
…pen source" to work with image/pdf files Signed-off-by: fangnx <[email protected]>
fangnx
pushed a commit
to fangnx/theia
that referenced
this issue
May 29, 2019
…pen source" to work with image/pdf files Signed-off-by: fangnx <[email protected]>
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Currently, the implementation of the
mini-browser
openSource
may be flawed for certain file extensions.Here is the current implementation of the
openSource
.https://github.com/theia-ide/theia/blob/730afb49ffb4be2f1b839bfce364fa0e938034f6/packages/mini-browser/src/browser/mini-browser-open-handler.ts#L236-L243
The call
open
calls the followingopener-service
method:https://github.com/theia-ide/theia/blob/730afb49ffb4be2f1b839bfce364fa0e938034f6/packages/core/src/browser/opener-service.ts#L80-L83
Based on the implementation of
getOpener
, the handler returned has the highest priority.In the
mini-browser
we have both theOpen Preview
andOpen Source
toolbar items, used to open the uri in question in two different modes. The problem with theOpen Source
is that the highest handler is in fact thePreview
so clicking on it will do nothing for let's say an image calleda.jpg
. Instead, we should determine based on the list of all available open handlers, what the best open source handler would be or if it should always be the editor.If we take for example the case of an image file like
a.jpg
, the highest open handler would be thepreview
, but if we call theopenSource
based on its current implementation, we will also use thepreview
. In this case, we should get all open-handlers, and determine for the right context what the appropriate open-handler would be.The text was updated successfully, but these errors were encountered: