Dart-Code icon indicating copy to clipboard operation
Dart-Code copied to clipboard

Dart & Flutter extension for VS Code Web

Open nilsreichardt opened this issue 2 years ago • 6 comments

Description

GitHub announced yesterday the feature to switch quickly into a VS Code Web editor, when pressing '.'.

image

https://twitter.com/github/status/1425505817827151872

Dart & Flutter extension for VS Code Web

image

Unfortunately, the Dart and Flutter extension are not available for VS Code Web. I think there are currently some technical limitations (I think at the moment it's not possible to install the Dart or Flutter SDK).

The GitHub Engineering Team moved completely to GitHub Codespaces, so I think the cloud development is an interesting field, which will increase in the future (see https://github.blog/2021-08-11-githubs-engineering-team-moved-codespaces/).

nilsreichardt avatar Aug 12 '21 09:08 nilsreichardt

My guess is that this requires Virtual Workspaces which isn't currently supported (it requires support from the Dart Analysis Server and is unfortunately not a small job). @lszomoru - can you confirm if this is the case? Or are only UI extensions supported? I followed the Learn More link in the tooltip (which is hard to access but the description is very vague and doesn't help understand what an extension needs to do to support it).

However, the extension does work in a GitHub Codespace which is a little more involved to set up (although I'm not entirely sure why the difference) but has a real clone of the repository which the Dart Analysis Server can access on disk:

Screenshot 2021-08-12 at 15 28 09

DanTup avatar Aug 12 '21 14:08 DanTup

Adding @aeschli who should be able to provide the definitive answers to your question.

lszomoru avatar Aug 17 '21 13:08 lszomoru

We are working on the documentation to describe what is needed for extensions to run in a browser-only environment. There extensions are run in a web worker. Many restrictions apply, so instead of the main entry point you need to provider a browser entry point. No requires except vscode are supported. And yes, all resources are virtual.

aeschli avatar Aug 17 '21 14:08 aeschli

@aeschli thanks for the info! Are there going to be any pointers (for users) that the extensions would work in Codespaces? If users see the behaviour above they'll probably just assume they can't use Dart/Flutter on GitHub, even though with a few more clicks and a minute of waiting for a container, they could likely get the experience they were after.

@nilsreichardt since it's not possible to run all of the Dart tooling in the browser, this probably isn't going to be feasible. But if you use GitHub Codespaces things should (mostly) work there.

DanTup avatar Aug 24 '21 12:08 DanTup

Closing this as WontFix, because it's not something that could be supported without being able to run the Dart analysis server entirely in the browser (and I don't know of any plans to do that). In the meantime, Codespaces (which are backed by a real container) should work. We can re-open if things change. Thanks!

DanTup avatar Sep 02 '21 12:09 DanTup

Re-opening this as a place to collect 👍 's on this to gauge demand. If you're interested in this, please add a 👍 and perhaps a comment about the use cases you have in mind (and perhaps why GitHub Codespaces isn't a more suitable option).

This is not a commitment to working on this - supporting it would require significant work beyond this extension (such as being able to run the Dart SDK's analysis server in a browser).

DanTup avatar Nov 25 '21 10:11 DanTup

Hey, @DanTup. I'm happy to be a guinea pig on your instructions when you've got 'em.

csells avatar Mar 22 '23 15:03 csells

Hey @DanTup , here is my use case: I would like to use dart inlay hints when reviewing PRs on github (open github.dev editor with pressing '.' )

BazinC avatar Jun 29 '23 07:06 BazinC

My use case: it would be nice to develop Flutter apps on Android device with external controllers and monitor, without connecting to any remote development servers.

It's possible to run VS Code server on Android device and connect to it with browser and it means the only missed thing is supporting Flutter/Dart plugins.

ihorvitruk avatar Jul 13 '23 12:07 ihorvitruk