Custom editor for files of specific extension

Hi!
I would like to create a custom editor for files of a specific extension, let's say *.cco. The files are standard xml files. When the developer double-clicks on such a file the specific editor should open, instead of the standard XML editor of IDE.
Do you have any resource in mind that might help



Answer this question

Custom editor for files of specific extension

  • Christopher Crooker

    No, I have never looked at this one. Let me take a look...
    thanks a lot



  • Azathoth

    Hi Dimitris,

    I can only think that you haven't had a chance to look at the VSIP SDK (now renamed Visual Studio SDK for VS2005). Everything you need to know is pretty well documented there. Head over to http://msdn.microsoft.com/vstudio/extend/ and download the VSIP SDK (for VS.NET 2003) or Visual Studio 2005 SDK. The stuff you implement is actually binary compatible between the two versions, so I'm guessing it should also be pretty much source compatible (although I'm still compiling the VS2005 version of my product, a vi/vim emulation package, with VS.NET 2003).

    Summary of the method: implement an VsPackage, register a custom editor in the registry under "Editors", list the appropriate file extension in your editor's registry key, then implement the IVsEdFactory. When asked by the environment to instance the editor, you have many choices: you can implement your own completely custom editor, or you can host Visual Studio's core editor in your window, or you can have both... whatever you want.

    The first version of my product, ViEmu 1.0, was a custom editor that hosted the core editor. From 1.1 on, it hooks to all text views created within the environment - a bit less elegant, but it catered for better integration with other VS and third party features. If you are not editing regular C++, C#, etc... files you're probably better off implementing a custom editor.

    Best wishes,

      J

    -------------------------------------------------
    ViEmu - vi/vim emulation for Visual Studio
        http://www.ngedit.com/viemu.html


  • Custom editor for files of specific extension