Community
Participate
Working Groups
This report may amount to a request for clarification of IEditorMatchingStrategy. I have an editor extension registered for XML extensions that has a matching strategy. If I click right on an XML file and select OpenWith..., my editor is still offered. If I select it, my matching strategy API is indeed called. In the case that is troubling me, it returns false -- and the platform proceeds to fire up my editor against the file anyway. Now, what my matching strategy is trying to do is to select amongst XML files by their root elements (some day, perhaps DTD ID's would be better). I suspect that things are working as intended. I think the documentation really needs some help in explaining what the exact behavior is supposed to be.
Passing to Nick to clarify.
Can you clarify your scenario and what the desired behaviour is (independent of which mechanisms are used)? IEditorMatchingStrategy is used for matching an editor input against existing editors. The default behaviour uses equals on the input, but IEditorMatchingStrategy lets you override that. It's not intended to veto the opening of an editor. This is generally used when the editor represents multiple files, and wants to match a file input matching any of them (e.g. the plugin manifest editor). For choosing different editors based on XML root element type, the mechanism to use is content types, not IEditorMatchingStrategy. See the section on Content Types in Help > Help Contents > Platform Plug-in Developer Guide > Runtime Overview >. See also the <contentBinding> element in the schema for the editors extension point (in the Reference section of the Developer Guide).
OK, I get it. Thanks. This was not clear from the documentation, at least to me. The doc left me thinking that the matching strategy was a refinement for the suffix matching properties in the extension point.
Changing the title accordingly. Please try the content types mechanism, and if there are still issues, please open separate reports.
I'm confident that the use of the correct mechanism will yield the desired results :-). As soon as I sort our my disagreement with the runtime/PDE on java.nio.charset.spi, I'll go try the content type.
Created attachment 31384 [details] Plugin with unit test that fails The unit test in here works 'outside' Eclipse and fails when run with the 'plugin junit'.
The attachment here was supposed to go with a different bug. Ignore it, please.
All's well.
Cleaning up bugs
Marking as INVALID since no fix was made.