You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds CodeLens links for Flutter files that have {@tool dartpad snippets that open the interactive online samples:
It has some assumptions/caveats:
Only works for files inside (Flutter SDK)/packages/flutter/lib/src/material/app_bar.dart
Assumes the leaf-most folder name is the package (eg. in the above, "material") and that the name from the Outline node is the classname, and uses these in the URL as ${sample.libraryName}/${sample.className}-class.html
Always links to https://api.flutter.dev regardless of your Flutter branch/channel
Assumes there's an element with the ID #${sample.libraryName}.${sample.className}.1 at the correct location (this jumps down the page - if this assumption becomes invalid, you'll end up at the top of the docs page for that class)
@devoncarew I think these are the same for the IntelliJ version too (except the last one - though you might wish to add) but shout if anything seems wrong here.
DanTup
added
is enhancement
An enhancement or improvement that should be listed in release notes but is not a bug fix.
in flutter
Relates to running Flutter apps
in editor
Relates to code editing or language features
labels
Jan 24, 2020
I think these are the same for the IntelliJ version too (except the last one - though you might wish to add) but shout if anything seems wrong here.
Yup, this is what IntelliJ is doing (modulo the last item). I elected to not try and link to a specific anchor - it was unclear to me how stable that would be going forward. Linking to package+class seems stable (w/ the caveat that for most cases the user will need to scroll a bit to see the actual dartpad instance on the page).
DanTup
changed the title
Add CodeLens links for Flutter DatPad samples
Add CodeLens links for Flutter DartPad samples
Jan 24, 2020
I elected to not try and link to a specific anchor - it was unclear to me how stable that would be going forward
Yeah, I did consider leaving it out, but it seems fairly stable (they're used in the IDs for flutter create --sample and always ascend from 1) and if they change it just reverts to not scrolling anyway (there are no errors, it just doesn't scroll down anywhere). I also thought it felt a bit weird given the text on the code lens if we didn't scroll (since then it's just like "open API docs" and it might raise questions about why we only do it for some specific set of classes).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in editorRelates to code editing or language featuresin flutterRelates to running Flutter appsis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds CodeLens links for Flutter files that have
{@tool dartpadsnippets that open the interactive online samples:It has some assumptions/caveats:
(Flutter SDK)/packages/flutter/lib/src/material/app_bar.dartnamefrom theOutlinenode is the classname, and uses these in the URL as${sample.libraryName}/${sample.className}-class.htmlhttps://api.flutter.devregardless of your Flutter branch/channel#${sample.libraryName}.${sample.className}.1at the correct location (this jumps down the page - if this assumption becomes invalid, you'll end up at the top of the docs page for that class)@devoncarew I think these are the same for the IntelliJ version too (except the last one - though you might wish to add) but shout if anything seems wrong here.
Fixes #2151.