Bug 90292 - [EditorMgmt] Default editor for unknown extensions
Summary: [EditorMgmt] Default editor for unknown extensions
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P4 enhancement with 3 votes (vote)
Target Milestone: 4.6 M5   Edit
Assignee: Mickael Istria CLA
QA Contact:
URL:
Whiteboard: RHT
Keywords: greatfix, noteworthy
: 142228 433296 (view as bug list)
Depends on: 486665 488285 488289
Blocks: 486648 480176 486635 486645 486647 486649 488090 488845
  Show dependency tree
 
Reported: 2005-04-05 09:38 EDT by Thomas Jacob CLA
Modified: 2018-06-08 07:00 EDT (History)
14 users (show)

See Also:
markus.kell.r: review-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Jacob CLA 2005-04-05 09:38:27 EDT
I suggest a configuration setting in General / File associations to set the 
editor to be used for unknown file types. Currently, the OS default editor is 
opened. I suggest:

Editor for unknown file types:
( ) Default system editor
( ) This editor: << List of editors >>
Comment 1 Michael Van Meekeren CLA 2006-04-21 13:19:03 EDT
Moving Dougs bugs
Comment 2 Susan McCourt CLA 2009-07-09 19:07:06 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 3 Boris Bokowski CLA 2009-11-17 13:06:39 EST
Remy is now responsible for watching the [EditorMgmt] component area.
Comment 4 Andrey Loskutov CLA 2015-04-01 10:19:11 EDT
We should also think if we can automatically recognize "text" or other content types via some magic [1] and so automatically open meaningful editors (e.g default text editor for all unknown "text" files). Not sure if IContentDescriber can be used here.

[1] http://en.wikipedia.org/wiki/Magic_number_%28programming%29
Comment 5 Mickael Istria CLA 2015-08-28 11:26:13 EDT
Similarly to what OS do in that case, when no obviously good editor is found, Eclipse could show a "Select Editor" UI (pop-up, or even an editor itself) that would allow user to select an existing editor and have a checkbox to opt-in remember association.
Comment 6 Doug Schaefer CLA 2015-11-16 11:30:40 EST
I like Andrey's suggestion, but I would take it a bit further. If we don't know what the content type is, we should default to the text editor, whether the file is text or not. That's essentially what happens when there is no System editor for the file type.

This is really important because I've seen competing IDE's register against files that should be opening up in Eclipse when you double click them. For example, Xcode registers for .sh files which are commonly bash scripts. It's pretty embarrassing when a user double clicks on a file and a competitor's IDE comes up.

I believe the reason we defaulted to System editor was to handle files that were managed by Windows applications. For example, double clicking xls files opened Excel. I'm not sure that's really a high runner use case any more, and I'm pretty sure it's lower than text files that don't have content types registered to them. At the very least, we still have the open System editor the user can use to open those files.

BTW, Kaloyan Raev from Zend has a plug-in up on the Marketplace that does just that.

https://marketplace.eclipse.org/content/default-text-editor
Comment 7 Mickael Istria CLA 2015-11-16 11:45:50 EST
Another approach would be to have an "unknown" symbolic content type in preferences, and to be able to associate it with editors. So user could customize the behaviour without new concepts, and extenders could also do the same.
Comment 8 Mickael Istria CLA 2015-11-30 14:19:59 EST
*** Bug 433296 has been marked as a duplicate of this bug. ***
Comment 9 Mickael Istria CLA 2015-12-14 13:35:32 EST
I'm experimenting around an extension point to plug strategies on how to handle unassociated file types. The default one would remain the current "System editor then Text", and I'll try 2 alternative extensions for "Let user select editor" and "Poll a remote suggestion/discovery service".
The choice between the strategy would be managed as a preference, that RCP providers could set via plugin_customization.ini and/or API; and that user could set via preference page.
Comment 10 Eclipse Genie CLA 2015-12-15 05:40:53 EST
New Gerrit change created: https://git.eclipse.org/r/62659
Comment 11 Mickael Istria CLA 2015-12-15 05:42:35 EST
(In reply to Mickael Istria from comment #9)
> I'm experimenting around an extension point to plug strategies on how to
> handle unassociated file types. The default one would remain the current
> "System editor then Text", and I'll try 2 alternative extensions for "Let
> user select editor" and "Poll a remote suggestion/discovery service".
> The choice between the strategy would be managed as a preference, that RCP
> providers could set via plugin_customization.ini and/or API; and that user
> could set via preference page.

See suggested patch: https://git.eclipse.org/r/#/c/62659/
It comes with 2 strategy:
* Default/current one: choose system editor or text editor
* Ask user via pop-up (shows same pop-up as open with)
Use can select the strategy to use in the File Association preference page; extenders can plug additional strategy and use regular preferences to enable one or the other as default.
Comment 13 Andrey Loskutov CLA 2015-12-24 14:38:25 EST
Thanks Mickael!
Comment 14 Kaloyan Raev CLA 2016-01-05 05:25:47 EST
Thanks Mickael!
I really like the solution.
I found a small issue while testing it - bug 485201.
Comment 15 Andrey Loskutov CLA 2016-01-05 05:33:34 EST
*** Bug 142228 has been marked as a duplicate of this bug. ***
Comment 16 Lars Vogel CLA 2016-01-05 05:42:23 EST
Thanks Mickael. Can you also upload a N&N entry?
Comment 17 Eclipse Genie CLA 2016-01-06 03:27:33 EST
New Gerrit change created: https://git.eclipse.org/r/63609
Comment 18 Eclipse Genie CLA 2016-01-06 03:28:11 EST
New Gerrit change created: https://git.eclipse.org/r/63610
Comment 21 Dani Megert CLA 2016-01-27 08:44:35 EST
There are a few
Comment 22 Markus Keller CLA 2016-01-27 12:56:56 EST
The implementation broke APIs, see bug 486665 comment 1. I'll probably remove the feature from the N&N until it's clear how the solution in M6 will look like.