Well, at least I got an overflow icon for this question.
After much reverse engineering, I found a solution ... that is not documented .. Anywhere ..
Step number 1:
First you need to create a factory editor with all its calls and whistles - MSVS has an extension for it.
Step # 2: Then you need to create such a class
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] class ProvideFileExtensionMapping : RegistrationAttribute { private readonly string _name, _id, _editorGuid, _package; private readonly int _sortPriority; public ProvideFileExtensionMapping(string id, string name, object editorGuid, string package, int sortPriority) { _id = id; _name = name; if (editorGuid is Type) { _editorGuid = ((Type)editorGuid).GUID.ToString("B"); } else { _editorGuid = editorGuid.ToString(); } _package = package; _sortPriority = sortPriority; } public override void Register(RegistrationContext context) { using (Key mappingKey = context.CreateKey("FileExtensionMapping\\" + _id)) { mappingKey.SetValue("", _name); mappingKey.SetValue("DisplayName", _name); mappingKey.SetValue("EditorGuid", _editorGuid); mappingKey.SetValue("Package", _package); mappingKey.SetValue("SortPriority", _sortPriority); } } public override void Unregister(RegistrationAttribute.RegistrationContext context) { } }
Step 3: Then you need to add this class as an attribute to your factory editor (which you created in step 1):
[ProvideFileExtensionMapping("{E23E32ED-3467-4401-A364-1352666A3502}", "RText Editor", typeof(EditorFactory), GuidList.guidRTextEditorPluginEditorFactoryString, 100)] public sealed class EditorFactory : IVsEditorFactory, IDisposable{...}
What is it. Now you can see your editor in the list of editors in visual studio.
Your editor should be called when the file mapping is correct.
Hope this post saves a lot of time for someone else.