Wpf: XAML Editor for VSCode

Created on 21 Jan 2019  路  16Comments  路  Source: dotnet/wpf


I don't know if i'm here right with this request.

Like the title says it would be nice to have an xaml designer in vscode. As i think many people use dotnet core with vs code.

issue-type-enhancement

Most helpful comment

But honestly all WPF and WinForms developers I know use Visual Studio

To be fair, it is their only option.

there's no reason why you shouldn't use Visual Studio

Not everyone are Microsoft MVPs who gets Visual Studio for free :-) And before you mention the community edition:

An unlimited number of users within an organization can use Visual Studio Community for the following scenarios: in a classroom learning environment, for academic research, or for contributing to open source projects.
For all other usage scenarios:
In non-enterprise organizations, up to five users can use Visual Studio Community. In enterprise organizations (meaning those with >250 PCs or >$1 Million US Dollars in annual revenue), no use is permitted beyond the open source, academic research, and classroom learning environment scenarios described above.

VSCode is a cross-platform editor, WPF and WinForms are not cross-platform and won't be so with .NET Core 3

I don't get this argument. I can build iOS apps in VSCode, but that won't work on Windows or Linux, but only Mac. Why should WPF/WinForms be any different? No one is saying a plugin has to be crossplatform.

All 16 comments

Hi Mabenan,

I like the idea of a XAML editor in VS Code. But honestly all WPF and WinForms developers I know use Visual Studio. And as WPF and WinForms in .NET Core are still Windows-only UI stacks, there's no reason why you shouldn't use Visual Studio. But for cross-platform stuff it would make sense, yes. And for those who want to use VSCode for everything. :)

XAML in VSCode was already discussed a while back here: https://github.com/Microsoft/xaml-standard/issues/219 and at some other places like this one: https://forums.xamarin.com/discussion/39483/visual-studio-code-support

Take also a look at this brand new tool called XAML Studio: https://www.microsoft.com/p/xaml-studio/9ntls214tkmq. It's a UWP app that uses VS Code's code editor Monaco.

I like your idea and this issue, but I think currently Microsoft has a lot of work to do to move WPF and WinForms over to .NET Core 3. I think they won't be able to focus on a XAML editor for VSCode (others might even want to have a WinForms designer in VSCode. :)) VSCode is a cross-platform editor, WPF and WinForms are not cross-platform and won't be so with .NET Core 3. Main goal for now is: Bring WPF & WinForms to .NET Core 3 and make it work like a charm. That's why I think a XAML editor for VS Code has at least right now no priority, but maybe the Xamarin team investigates in VSCode support for XAML or maybe we see a cross-platform XAML-based UI-stack in the future that brings VSCode support.

But honestly all WPF and WinForms developers I know use Visual Studio

To be fair, it is their only option.

there's no reason why you shouldn't use Visual Studio

Not everyone are Microsoft MVPs who gets Visual Studio for free :-) And before you mention the community edition:

An unlimited number of users within an organization can use Visual Studio Community for the following scenarios: in a classroom learning environment, for academic research, or for contributing to open source projects.
For all other usage scenarios:
In non-enterprise organizations, up to five users can use Visual Studio Community. In enterprise organizations (meaning those with >250 PCs or >$1 Million US Dollars in annual revenue), no use is permitted beyond the open source, academic research, and classroom learning environment scenarios described above.

VSCode is a cross-platform editor, WPF and WinForms are not cross-platform and won't be so with .NET Core 3

I don't get this argument. I can build iOS apps in VSCode, but that won't work on Windows or Linux, but only Mac. Why should WPF/WinForms be any different? No one is saying a plugin has to be crossplatform.

I don't get this argument. I can build iOS apps in VSCode, but that won't work on Windows or Linux, but only Mac. Why should WPF/WinForms be any different? No one is saying a plugin has to be crossplatform.

Yep. My argument was meant like this: If you need a Windows machine, what's the point of using a cross-platform tool anyway? As I wrote, it makes sense for those who prefer VSCode over Visual Studio. And this is the argument that @Mabenan also wrote, which is ok. Fair point! A plugin would be great for those who want to do everything in VSCode.

But is this the only argument? I don't think that the license for the Community Edition is really an argument to create a plugin for VSCode. You should quote the details for individuals as well, as your quote only contains the license part for organizations:

For individuals
Any individual developer can use Visual Studio Community to create their own free or paid apps

So, I don't see a problem there. But yes, as said, I like @Mabenan idea and this issue. What I said: I'd like to have it, but I don't see it as a top priority. We should do a poll on twitter.

So because there's a license for individuals screw the Enterprise and especially government workers who can't get several thousand dollars approved? My point with the quote was to show not everyone can use it. That argument still stands.

@dotMorten Ok, now I got it what you mean. Yes, makes absolutely sense, that argument stands.

So we have:

  • VSCode is used by many .NET Core devs, so a VSCode XAML editor would be great to stay in the tool (and maybe not only for WPF, but even UWP and other XAML platforms)
  • Give workers in organizations a tool they can use that does not require a license, as it's hard to get licenses in some organizations
  • VSCode plugin would also have a positive effect on XAML in general, as it shows the investments to support XAML also for pure VSCode devs

I just think it's not the right time before the .NET Core 3 release. This is a thought, doesn't mean I'm right. Of course releasing .NET Core 3 and presenting a VSCode plugin would be great. :-)

I wonder how much effort it would be to bring XAML support in as a Windows-only Plugin. Could the VS Designer be re-used? Or would the XAML Editor that @michael-hawker has created as part of XAML Studio be an option and a point to start with? That one is Monaco based, so I guess we just need to feed it like michael does already.

Generally, WPF designer support is something that is handled by the VS team.

@DoRonMotter Is there a good place (VSFeedback?) for developers to suggest and upvote this sort of feature request for VS Code?

Perhaps start with a XAML text editor with autocompletion, error squiggles etc, and leave the design surface out for now. From my experience most people work with xaml this way anyway (winforms is another story and more or less useless without a design surface)

@rladuca VS Code is managed on GitHub, yes, you could open issues there. My team has already heard this feedback, but it's better to have an issue open with lots of support (馃憤).

Since I've been called out, I can't say I haven't thought about this scenario already. 馃槈 I haven't looked at testing WPF support for XAML Studio, but have thought about the UWP scenario and integrating XAML Studio as an external preview surface to VS Code as an editor.

Implementing IntelliSense would be they tricky bit. Even though I'm effectively using the same Monaco API, I'm using reflection at the moment to generate suggestions as there's no longer a generated XSD for UWP XAML (though maybe one still exists for WPF?). So, the biggest part of a plugin would be working out the auto-complete scenario. See this article for a tutorial on XSD Monaco based IntelliSense

Hooking it into an external process to render the preview (or report back errors) should be the easier part.

Wouldn't Omnisharp be the correct place for this, at least for XAML editor?
The C# extension for VS code is powered by Omnisharp and already supports Razor

I agree with @MarkusAmshove that is probably the right place for something like this to go. is there an associated issue over there that we can reference as a duplicate?

How about more universal solution like form server? Similar to language server?
If it possible, this allow to make any form builder: XAML, WPF, forms for Android, HTML builder,..

Closing this issue, an issue exists in VSCode repo:

https://github.com/microsoft/vscode/issues/60406

How does an existing (but closed) issue supercede an open one?

Please log a new issue there or ask the VSCode team to re-open the existing one. Thanks!

@Mabenan @adam-becker I filed https://github.com/OmniSharp/omnisharp-vscode/issues/3338 to (hopefully) get the ball rolling on this a bit.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pocki picture pocki  路  3Comments

imanushin picture imanushin  路  3Comments

Normandy picture Normandy  路  3Comments

Pzixel picture Pzixel  路  3Comments

poke picture poke  路  3Comments