dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.84k stars 662 forks source link

Ability to install the extension in https://vscode.dev #7301

Open beyarkay opened 1 month ago

beyarkay commented 1 month ago

Hi there,

How difficult would it to add support that would allow users to "install" the extension on https://vscode.dev? I love the little online editor and would like to have more intelligent support if it's possible.

dibarbet commented 1 month ago

As far as I understand it, extensions running in vscode.dev must be able to run in the browser. Unfortunately, to get a fully working experience there are lots of issues to tackle. These include (but are definitely not limited to):

  1. The C# language server runs in C# on .NET. Running that in the browser means targeting webassembly which has some support in .NET, but is it good enough?
  2. We require other components like the .NET runtime and .NET SDK that is typically installed on the machine in order to launch the server and load projects against the right SDK. How does that work in the browser?
  3. What does it mean to build / run a project in the browser? Does all of the SDK/MSBuild need to support running in the browser?

One UX we've considered for this which sidesteps some of these issues is a version of the extension that uses pre-built project artifacts to power just the C# language server. This could give limited language feature support, but anything outside of simple .cs file editing and navigation would not work (for example, any changes to the .csproj, building, running, etc).

A year or two ago we experimented with that approach and successfully got a version of O# that could load a simple pre-built project. However the web assembly / dotnet support for web assembly was simply too slow at the time to be of any use for even limited language features.

All that to say - it's interesting to us, but it isn't something we're likely to tackle soon.