-
Notifications
You must be signed in to change notification settings - Fork 326
Support for viewing and running Flutter documentation code samples #2968
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
Comments
I've opened Dart-Code/Dart-Code#1356 for the VS Code work. |
Besides being able to generate sample content from the new project wizard (which I expect could have a UI similar to the way we support stagehand templates), we should explore other ways to surface samples. Existing dartdoc support is a little basic so it's not obvious what we can do there without a bunch of work on the Dart Plugin, but we should consider it? For example, here's the "quick documentation" view for There could be a link or some kind of affordance to create a sample from the docs. (The question remains though if anyone would find it since I'm not sure how well used that view is...) @alexander-doroshko : do you have any analytics on how used the quick doc view is? |
My impression is Quick Documentation a little bit hard to discover by users new to IntelliJ. In contrast, VS Code shows Quick Documentation anytime the mouse cursor is on a class name or method name. I suspect we need to provide two entry points for running sample code in API docs: one from Flutter's API references on docs.flutter.io, and another one from within the IDE when the user checks documentation in the source code. For the latter, maybe the IDE can show a banner notification when the source file contains a runnable sample? |
For VS Code, if microsoft/vscode#65269 gets fixed, then rather than potentially spamming with banners, we could inject links into the hovers that say "Open sample in VS Code", that when clicked will spawn a new VS Code window that automatically downloads the sample ready to run. I think that could be a nice experience? |
Sounds good to me, @DanTup. |
I don't have analytics in hands right now. I think everyone uses it every day, don't you? ;) |
I tested out the VS Code protocol handler, and the rest of it works great. For ex. if Dart-Code/Dart-Code#1358 is landed, we can link to If we get the ability to enumerate the full list, I can also add in a command that lets you select one. |
Unfortunately, I don't think a protocol handler is straight-forward in IntelliJ (see e.g., https://youtrack.jetbrains.com/issue/IDEA-65879). Failing a one-click solution I suppose we could introduce an action that uses clipboard content and then the flow could be:
🤔 @alexander-doroshko: any thoughts or experience here?
A banner in IntelliJ I think this is a great idea. 👍 |
I don't think IDEA-65879 is directly related. Are you thinking about links handling in Quick Doc popup?
What does it technically mean? |
@alexander-doroshko: we're talking about support for url handling so that you could click a link, for example, in chrome (not quick docs) where you're browsing for example https://docs.flutter.io/flutter/material/IconButton-class.html and have a new project created in the IDE.
If you look at the IconButton class docs, you'll see: The Flutter |
As of #3143, MVP support is complete. Let's track ongoing polish in follow-up issues. Thanks all! 👍 |
Uh oh!
There was an error while loading. Please reload this page.
A meta-issue to track sample creation (e.g.,
flutter create -sample
) and execution from the IDE.Flutter
IDEA / IntelliJ
VSCode
The text was updated successfully, but these errors were encountered: