microsoft / VSExtensibility

A repo for upcoming changes to extensibility in Visual Studio, the new extensibility model, and language server protocol.
MIT License
365 stars 46 forks source link

Custom file type editors without a whole project system #282

Open jsaratoga opened 10 months ago

jsaratoga commented 10 months ago

I'm currently writing an extension that opens a custom editor in C# for my file extension. It was unbelievably painful using the existing APIs. The docs say it isn't even supported to write custom editors in c# anymore. I'm not looking to develop a project system. I simply want to add my own file types that work in existing C# projects. When the file is opened it opens in a custom editor and when it is saved, it generates some custom c# code and adds then to the project.
Think of how the Winforms designer works, you double-click a form, you get its editor, you make changes to controls and hit save, it generates code-behind. This needs to be a lot easier and I would love to see it added to the new extensibility model. Also, it seems impossible to set an icon on my custom file type without building a whole project system. It would be nice to see that fixed too.

tinaschrepfer commented 8 months ago

When you say custom editors, are you trying to see how you could implement a custom designer in the new extensibility model? If so, unfortunately we don't have that capability yet. But we'd love to learn more about what you envision for your custom designer.

POFerro commented 4 months ago

Hi :),

I have this issue also, in my case I have an editor for certain file extensions (xlsx files) that show a wpf custom control that allows for modifications to be made in a Visual way. Currently the editor is supported by a VSSDK extension that I would like to migrate to the new extensibility model. The way I envision it is having a factory that allow for the creation of the wpf custom control, based on the project item, and returns it as the content of the editor.

Best regards POFerro

jonmiller1 commented 3 months ago

Yes. In my current extension I have a custom file type that is usually backed by a JSON document when the user clicks on it, I have it open a custom designer, saving changes in the designer saves the file. It also kicks off a process that generates and adds custom code files to the project.

i-m-luke commented 2 weeks ago

I would also appreciate to be able to a create custom editor with the new framework. I'm developing an extension that will be used for modification of a specific XML files using UI. We could use a toolbar window but we would rather give our users the option to edit multiple of those files at once.