Community
Participate
Working Groups
Currently, association between an editor and a file content-type can only happen when defining the editor. However, it's possible that some editors can support additional content-types thanks to some 3rd party extension, in which case the 3rd party extension provider would like to associate the editor with the content-type without redefining it. The org.eclipse.ui.editors extension point (or another one if there is a better candidate, or a new one if it's better) could allow a root "contentTypeBinding" element which would just take as input a content-type and and editorId to store and use the association when resolving editor.
Tentative target 4.7.M3.
New Gerrit change created: https://git.eclipse.org/r/82258
@Dani: If possible, I'd really like it to be in M3. Can you please have a look?
As it's adding an element to an existing extension point in an existing bundle, this doesn't require change in documentation, does it?
New Gerrit change created: https://git.eclipse.org/r/83157
(In reply to Eclipse Genie from comment #5) > New Gerrit change created: https://git.eclipse.org/r/83157 This shows how it can be used (here in the org.eclipse.ui.genericeditor.example)
Gerrit change https://git.eclipse.org/r/82258 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=95aeacde052afc19cafdfa2bbf51b6df18102879
Gerrit change https://git.eclipse.org/r/83157 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=da54f96015b05dab151abff845f23306c368605c
Mickael, please update the N&N. Also use this opportunity to replace the screenshot of the code with the real code in the existing description.
(In reply to Mickael Istria from comment #3) > @Dani: If possible, I'd really like it to be in M3. Can you please have a > look? Giving me a bit more time than just 1.5 days would have been nice.
@Dani: Initial patch was submitted on Sept 30th and IIRC I added you as reviewer from this day. Maybe it wasn't clear, but when I add someone as reviewer on a bug, it means that I'm asking them for a review, and I start counting time from there. I'm sorry if this is not how you understood it, so I'll try to ping you simultaneously with the review request next time to make sure we're in on the same schedule.
New Gerrit change created: https://git.eclipse.org/r/83196
I'm marking it as resolved since all the necessary steps have been performed (extension, example, N&N). Feel free to reopen if there is something wrong enough there to requires a revert rather than a new bug report.
> Advertises that an existing editor is suitable to editor resource of an existing content-type. I'm not sure what language this is, but definitely not English.
.
I don't think a new element is required. It could be done with the existing attributes since most attributes are implies. Currently the new behavior violates the description of the extension point: "This extension point is used to add new editors "
(In reply to Mickael Istria from comment #11) > @Dani: Initial patch was submitted on Sept 30th and IIRC I added you as > reviewer from this day. Maybe it wasn't clear, but when I add someone as > reviewer on a bug, it means that I'm asking them for a review, and I start > counting time from there. I'm sorry if this is not how you understood it, so > I'll try to ping you simultaneously with the review request next time to > make sure we're in on the same schedule. Mickael, you have added 4 (four!) people to review the change: - Alexander Kurtakov - Dani Megert - Lars Vogel - Sopot Cela I am very busy, so, I usually wait for one of the others to add some review comments. But at the end it looks like you do not care about reviews and merge things even if you do not get a +1 or +2.
Gerrit change https://git.eclipse.org/r/83196 was merged to [master]. Commit: http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=7716ca71161d2ca6238dddd11dc1cdea225da7ec
(In reply to Dani Megert from comment #16) > I don't think a new element is required. It could be done with the existing > attributes since most attributes are implies. I take that back. It would be misleading. However, you probably also need the 'default' attribute. The description must be updated. It is no longer only to add new editors.
(In reply to Dani Megert from comment #19) > The description must be updated. It is no longer only to add new editors. Current description is http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/bundles/org.eclipse.ui/schema/editors.exsd#n9 and mentions the possibility to use it to define editor/content-type association. Or maybe you're referencing some other file or part of this file? > you probably also need the 'default' attribute. At the moment, I didn't need it: either the content-type already has an editor and there is no clear reason for the contribution to be allowed to define itself as default, or it doesn't have an editor and the associated one is the only one so it becomes default (only) one. However, I found a corner-case when a file has multiple content-types which is that the IDE.openEditor resolves against the deepest/most generic one, which is usually the opposite of what the user would expect IMO. However, that's something for another bugzilla that's not related to current one.
(In reply to Mickael Istria from comment #20) > (In reply to Dani Megert from comment #19) > > The description must be updated. It is no longer only to add new editors. > > Current description is > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/bundles/org.eclipse.ui/schema/editors.exsd#n9 > and mentions the possibility to use it to define editor/content-type > association. I would mention the two different cases more explicitly, because one also associates the new editor. The description should mention that one can contribute a new editor or bind an existing editor to a content type. See also comment 14.
(In reply to Dani Megert from comment #21) > I would mention the two different cases more explicitly, because one also > associates the new editor. The description should mention that one can > contribute a new editor or bind an existing editor to a content type. Ok, What about: """ This extension point is used to add new editors to the workbench or to associate already declared editors with resource content-types. An editor is a visual component within ... """ ? > see also comment #14 (In reply to Dani Megert from comment #14) >> Advertises that an existing editor is suitable to editor resource of an existing content-type. > I'm not sure what language this is, but definitely not English. Yeah, there is a grammatical issue there. What about """ Advertises that an existing editor is suitable to edit resources of an existing content-type """?
(In reply to Mickael Istria from comment #22) > (In reply to Dani Megert from comment #21) > Ok, What about: > """ > This extension point is used to add new editors to the > workbench or to associate already declared editors with resource > content-types. Content types are not related to resources, hence you should not use "resource" here. > > see also comment #14 > (In reply to Dani Megert from comment #14) > >> Advertises that an existing editor is suitable to editor resource of an existing content-type. > > I'm not sure what language this is, but definitely not English. > > Yeah, there is a grammatical issue there. > What about > """ Advertises that an existing editor is suitable to edit resources of an > existing content-type """? "Suitable" seems to weak. We really register the editor for that content type. Again, leave "resources" away.
Ok, here is another shot """ This extension point is used to add new editors to the workbench or to associate already declared editors with content-types.""" and """ Advertises that an existing editor is registered to edit some existing content-type."""
(In reply to Mickael Istria from comment #24) > Ok, here is another shot > """ This extension point is used to add new editors to the workbench or to > associate already declared editors with content-types.""" > and This extension point is used to add new editors to the workbench or to associate an already declared editor with a content-type. > """ Advertises that an existing editor is registered to edit some existing > content-type.""" Binds an existing editor to the given content-type.
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=76bc20340ec8feca95c80a1ff7c3bebeabffc454