Closed sr229 closed 5 years ago
@sr229 it'd be nice to see if the following VSCode extension works properly in Theia https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code
@vince-fugnitto we do have a VSCode-compatible API AFAIK so let's see how that bodes well
@sr229 if you find issues, please dump your findings here. We will categorise and prioritise them.
I work on the Dart/Flutter extensions for VS Code - I was just trying them out here to see how well they worked. I think the extensions may be failing to activate since the first thing I expect it to do is pop up and tell me it can't find a Dart SDK but it did not. We search PATH
for an SDK at activation and if we can't find one we'll prompt the user to locate it manually - but this did not happen.
There are some errors in the console which may be related:
ERROR Error: schema is invalid: data.properties['rust-client.channel'].type should be equal to one of the allowed values, data.properties['rust-client.channel'].type[1] should be equal to one of the allowed values, data.properties['rust-client.channel'].type should match some schema in anyOf
Error: Request 'exec' failed
at Proxy.
There were many other things I noticed didn't work - but I suspect they're all related to this (for ex. no code completion, no SDK version in the status bar, commands like "Dart: New Project" don't work).
FWIW, there are also these warnings - which I suspect are just bits you haven't implemented yet, but FYI Dart does use them (debug/toolBar to add a hot reload icon to the debug toolbar, and view/title for some options in the Flutter Outline view):
Hey @dantup, I looked into it and the latest version doesn't work the code-dart extension uses new yet unsupported API (ExtensionKind
).
I have setup the flutter_web repo using an older release that doesn't use that API:
https://github.com/svenefftinge/flutter_web
There are however many errors coming from the language server which seem wrong. Would be great if you can have a look and share any insights as I don't have experience in flutter/dart.
I think many of the errors come from not having run pub get
for each of the folders. It might be simpler to open only examples/hell_world
rather than opening all of the flutter_web code itself (though I'm not if that's possible here without making a new repo?).
I was trying to get pub-get-on-pubspec-changes to work, but it didn't seem to run. I tried to run the Dart: Capture Logs command to help debug, but that command doesn't seem to show up in the command palette - it has a context which should be set when the extension is activated:
I think maybe the extension still is not activating correctly, maybe due to this:
TypeError: testTreeView.onDidChangeSelection is not a function
I've changed the config so it opens on hello_world (see https://github.com/svenefftinge/flutter_web/blob/master/.gitpod.yml#L3)
We'll have a deeper look into the rough edges (e.g. i noticed weird editing issues) with your extension. And report our progress here. Thanks for trying!
Also, related https://github.com/flutter/flutter/issues/32436
@svenefftinge what's the best way to report issues when trying to use Dart/Flutter? Should I list them here, or open separate issues for each, or something else?
For ex., hit this one just now:
Uncaught (in promise) TypeError: ft.onDidChangeSelection is not a function
at e (/tmp/vscode-extensions/Dart-Code.dart-code@3.2.0-beta.3/extension/out/dist/extension.js:1)
at PluginManagerExtImpl.<anonymous> (/theia/node_modules/@theia/plugin-ext/lib/plugin/plugin-manager.js:375)
The objects are vscode.TreeView
instances that we're calling onDidChangeSelection
on.
Separate issues will be better. fs
is a tree?
ft
- the name has likely been munged by webpack, but the source is here:
Let me know if you want a separate issue for that one, and I'll open new issues for anything else like this I find. Thanks!
By the way - when I click Start -> Debug, nothing happens (even with a custom build with the treeview code commented out to avoid errors during activation). Is there any way to debug that (assuming it's expected to work)?
You can track progress in this branch: https://github.com/theia-ide/theia/tree/ak/flutter_support
Related issues:
Missing commands:
Missing activation events:
onUri
@DanTup Could you help me a bit please? I'm trying to understand what are expectations around onUri
activation event for Dart extension?
I'm going to stub onUri
activation event for now, that an extension does not get activated eagerly. It would be helpful to understand use cases around it in order to provide a proper implementation.
@DanTup Could you help me a bit please? I'm trying to understand what are expectations around
onUri
activation event for Dart extension?
Sorry for the delay, I missed this one. The onUri
activation is not actively used, so not a priority. It might also not make much sense in this context.
Essentially, VS Code allows extensions to publish URIs like vscode://extension-identifier/some/path
and when the user clicks them, their browser will delegate to the locally-installed VS Code, which will then activate extension-identifier
and invoke a URI handler registered with window.registerUriHandler()
.
I don't think not implementing this would be a problem, but should you wish to in future, you would probably end up with some link on your own domain that maps to the same (eg. https://gitpod.io/dart-code.flutter/flutter/sample/my.sample.id
) but I don't know how much sense that'd make (to open a workspace without a repo, for example).
The feature it was intended to support (which has not been linked up) was that we could have links on the website to "run this sample" that could spawn VS Code and have it automatically create the sample app (via flutter create
) and open it.
I think this has been resolved now.
Description
Dart is a language created by Google that is standardized under ECMA TC52. It has gained traction recently because of a recent development named Flutter.
There is a community LS for Dart support via a Dart Analysis Server Shim.