How do I create a custom editor for VS2015?
Asked Answered
D

2

6

I'm attempting to build a visual studio extension. My project is created from the "VSIX Project" template.

According to the documentation there should be a template for a custom editor but I am not finding it and failing at googling it. Is there something I'm missing beyond the SDK or am I misreading the documentation?

https://msdn.microsoft.com/en-us/library/bb166460.aspx

To create a VSPackage using the Visual Studio Package template

1.Create a project with the Visual Studio Package template. For more information about using this template, see Creating an Extension with a Menu Command.

2.Select the Custom Editor option and click Next. The Editor Options page is displayed.

3.Type the name of your editor in the Editor Name box. Type the file extension that you want to be associated with your editor in the File Extension box. Your editor is available for files with this extension. The file extension is registered for Visual Studio only, not for Windows. Type the default file name for new documents created with your editor in the Default File Name box.

4.Click Finish to create your VSPackage in the folder that you specified.

Available Templates

Durrace answered 30/1, 2016 at 22:23 Comment(0)
A
5

The extensibility project templates were refactored into item templates in an effort to make the templates more usable. For example, you can add multiple items like commands, toolwindows etc to a single project.

That documentation is definitely outdated. I'd recommend using the Editor_With_Toolbox sample, or perhaps the WPFDesigner_XML sample (from the VS Extensibility Samples on GitHub), as a starting point for your project.

Athallia answered 6/2, 2016 at 3:32 Comment(2)
The Editor_With_Toolbox sample is horrible in that it takes it for serious to use a RichTextBox as the editor control. I'm having trouble using an IWpfTextView aka core editor for my extension, do you know any links about that? I wish the documentation on MS Docs wouldn't be so outdated about this.Plaid
Yea, is there any minimal example/old template? WPFDesigner_XML is also not ideal. I just would like to know how to place nude WPF window/view as an editor and it's hard to tell what is really needed and what is extra xml stuff...Devault
P
3

According to: https://msdn.microsoft.com/en-us/library/dn916149.aspx?f=255&MSPPError=-2147217396

It seems like the ability to create custom editors in any language but C++ was removed in VS2015.

I think the microsoft dokumentation, for these topics, is outdated.

Postmortem answered 4/2, 2016 at 12:41 Comment(2)
They only say the templates are not available not that you can't write them in other languages "The VSPackage project template no longer supports C# or Visual Basic projects. For more information, see Visual Studio SDK." and in almost 2019 it's still not updated.. :/Devault
2021 and I'm still waiting for a solution to this. I have a custom editor which is basically not a custom editor since it only applies classifications and some custom completion. You can't right click a file and 'open with' since there is no custom editor support. The documentation is very outdated.Bufordbug

© 2022 - 2024 — McMap. All rights reserved.