Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[extension] Issues with Dart / Flutter extension #3999

Closed
sr229 opened this issue Jan 10, 2019 · 18 comments
Closed

[extension] Issues with Dart / Flutter extension #3999

sr229 opened this issue Jan 10, 2019 · 18 comments
Assignees
Labels
dart issues related to the dart language vscode issues related to VSCode compatibility

Comments

@sr229
Copy link

sr229 commented Jan 10, 2019

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.

Mirrored from Eclipse Che

@vince-fugnitto
Copy link
Member

@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

@akosyakov akosyakov added dart issues related to the dart language vscode issues related to VSCode compatibility labels Jul 5, 2019
@sr229
Copy link
Author

sr229 commented Jul 5, 2019

@vince-fugnitto we do have a VSCode-compatible API AFAIK so let's see how that bodes well

@akosyakov
Copy link
Member

@sr229 if you find issues, please dump your findings here. We will categorise and prioritise them.

@DanTup
Copy link
Contributor

DanTup commented Aug 5, 2019

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. (https://cdn.gitpod.io/theia/a5cf25c1928eb87662cf6cd1231f18f3/bundle.js:57:780940)

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):

  • WARN: Plugin contributes items to a menu with invalid identifier: debug/toolBar
  • WARN: Plugin contributes items to a menu with invalid identifier: view/title

@svenefftinge
Copy link
Contributor

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.

@DanTup
Copy link
Contributor

DanTup commented Aug 5, 2019

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:

https://github.com/Dart-Code/Dart-Code/blob/39bb09e78d8cdb1700152e1e7f419ef18619e272/package.json#L440

I think maybe the extension still is not activating correctly, maybe due to this:

TypeError: testTreeView.onDidChangeSelection is not a function

@svenefftinge
Copy link
Contributor

svenefftinge commented Aug 5, 2019

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!

@svenefftinge
Copy link
Contributor

Also, related flutter/flutter#32436

@DanTup
Copy link
Contributor

DanTup commented Aug 7, 2019

@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/[email protected]/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.

@akosyakov
Copy link
Member

Separate issues will be better. fs is a tree?

@DanTup
Copy link
Contributor

DanTup commented Aug 7, 2019

ft - the name has likely been munged by webpack, but the source is here:

https://github.com/Dart-Code/Dart-Code/blob/b8c0f6f138b31748822c0f4ff471ddfa277c7cfa/src/extension/extension.ts#L414

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!

@DanTup
Copy link
Contributor

DanTup commented Aug 7, 2019

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)?

@svenefftinge svenefftinge changed the title [Feature Request] Dart support [extension] Issues with Fart / Flutter extension Aug 12, 2019
@akosyakov akosyakov self-assigned this Aug 25, 2019
@akosyakov
Copy link
Member

@vince-fugnitto vince-fugnitto changed the title [extension] Issues with Fart / Flutter extension [extension] Issues with Dart / Flutter extension Aug 25, 2019
@akosyakov
Copy link
Member

Missing commands:

  • editor.action.triggerSuggest
  • revealFileInOS
  • vscode.executeCodeActionProvider
  • vscode.openFolder
  • workbench.action.showErrorsWarnings
  • workbench.extensions.installExtension

@akosyakov
Copy link
Member

Missing activation events:

  • onUri

@akosyakov
Copy link
Member

akosyakov commented Aug 26, 2019

@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
Copy link
Contributor

DanTup commented Aug 26, 2019

@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.

@svenefftinge
Copy link
Contributor

I think this has been resolved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dart issues related to the dart language vscode issues related to VSCode compatibility
Projects
None yet
Development

No branches or pull requests

5 participants