Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8763367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:45:56+00:00 2026-06-13T15:45:56+00:00

I am in the process of writing a custom editor for visual studio. I

  • 0

I am in the process of writing a custom editor for visual studio. I have implemented some basic functionality for the new language e.g. syntax highlighting and I succesfully installed tha package by using the generated .vsix file. All works just nice, however my custom editor needs to be able to be associated with different file extensions.

I thought, mistakenly, that since I installed the editor it would appear under

Tools->Options..->Text Editor->File Extension->Editors list:

enter image description here

However it does not appear there. So the question is: how do you add a custom editor to this list?

Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T15:45:57+00:00Added an answer on June 13, 2026 at 3:45 pm

    Well at least I got the tumbleweed badge for this question.

    After a lot of reverse engineering I found the solution… which is not documented.. Anywhere..

    Step number 1:

    First you need to create an editor factory with all the bells and whistles it comes with – MSVS has an extension for it.

    Step number 2:
    Then you have 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 editor factory (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{...}
    

    That’s it. You should now be able to see your editor in the list of editors in visual studio.

    Your editor shall be invoked when the file mapping is right.

    Hopefully this post saves a lot of time for someone else..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm in the process of writing a small text-editor that is supposed to have
I have gone through the (painful) process of writing a custom template tag for
I am in the process of writing a custom component along with some custom
I am in the process of writing a custom event receiver. The basic flow
Let's say you had an external process writing files to some directory, and you
I am in the process of writing some validation code based on these assumptions:
I'm in the process of writing a jQuery plugin, and am getting into some
I'm in the process of writing a custom CMS solution for a client of
I'm in the process of writing a custom heatmap generator. I'm wondering what the
I'm in the process of writing a custom drop down button in silverlight. While

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.