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
in editorRelates to code editing or language featuresis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
@devoncarew It'd be really nice to make this work - currently the dartdocs are HTML chunks that won't work here (it's very unlikely we'd ever be able to pull random CSS in to make this work).
Colours do something similar but they use images:
Is it likely we could do the same here? I don't know how the colour images were generated and whether we could do the same for these icons (or maybe they're already in a form that can be used directly). WDYT?
We generate the material icons and the color information from some scripts in the flutter/flutter-intellij repo. If the color info (or some generates icons) and the material design icons would be useful to you, we can generalize those scripts.
@devoncarew I was curious how you were handling this in IntelliJ, but I just installed it and I'm not sure it works either.
Here's help for colours - it includes the image:
And here's icon:
So in IntelliJ for icons you just see the text out of the HTML (but no icon). If the Flutter class dartdocs had image references (like colours) then these would display there.
The downside, is that the Icons page on the Flutter website would render a lot of images (whereas currently it uses the material icons loaded), but I guess it's already doing that for colours and I think help in the IDE is at least as important as help on the website.
Ah, we don't handle for tooltips, but we do show previews of the colors and material icons in the editor's gutter to the left. If you reference something like Icons.info_outline in your code you'll see an icon on the left.
Possibly we could do that in Code if we can get the right info, though I still think we should do something about tooltips (they look bad in both editors, but particularly in Code because the HTML gets rendered verbatim).
There's an open issue with Code about HTML in hovers not being supported (microsoft/vscode#40607) but I think even when (if) that gets fixed, it'll just become like IntelliJ's with text rendering instead of an icon. It feels a little weird to require custom CSS to render the docs correctly.
It's possible they'll break in future, but I don't think the missing image is any worse than a big chunk of HTML so we'll just update it if it does (though it seems unlikely those files will disappear IMO).
Currently it'll always show the white icon; it looks poor on the Light theme but I'll fix it up if/when microsoft/vscode#46940 gets addressed.
@ffeu I don't know if it's just you, but it does seem ok here:
Can you open a new issue include a screenshot, whether there are any errors in the console (Help -> Toggle Dev Tools) and also a log captured while you're viewing the help?
For VS Code, we rely on the documentation and perform a simple regex replace in order to get the icons to work in the tooltips, but there isn't enough info for this in the current ones.
I opened an issue in the Flutter repo about adding previews there (which we could then use to provide here). I don't know if there's a technical reason it isn't done or not (the Material one uses a font, I'm not sure if that's available in the site for Cupertino):
in editorRelates to code editing or language featuresis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
Activity
DanTup commentedon Mar 2, 2018
@devoncarew It'd be really nice to make this work - currently the dartdocs are HTML chunks that won't work here (it's very unlikely we'd ever be able to pull random CSS in to make this work).
Colours do something similar but they use images:
Is it likely we could do the same here? I don't know how the colour images were generated and whether we could do the same for these icons (or maybe they're already in a form that can be used directly). WDYT?
devoncarew commentedon Mar 6, 2018
We generate the material icons and the color information from some scripts in the flutter/flutter-intellij repo. If the color info (or some generates icons) and the material design icons would be useful to you, we can generalize those scripts.
DanTup commentedon Mar 7, 2018
@devoncarew I was curious how you were handling this in IntelliJ, but I just installed it and I'm not sure it works either.
Here's help for colours - it includes the image:
And here's icon:
So in IntelliJ for icons you just see the text out of the HTML (but no icon). If the Flutter class dartdocs had image references (like colours) then these would display there.
The downside, is that the Icons page on the Flutter website would render a lot of images (whereas currently it uses the material icons loaded), but I guess it's already doing that for colours and I think help in the IDE is at least as important as help on the website.
WDYT? Shall I raise @flutter?
devoncarew commentedon Mar 7, 2018
Ah, we don't handle for tooltips, but we do show previews of the colors and material icons in the editor's gutter to the left. If you reference something like
Icons.info_outlinein your code you'll see an icon on the left.DanTup commentedon Mar 7, 2018
Aha, gotcha :)
Possibly we could do that in Code if we can get the right info, though I still think we should do something about tooltips (they look bad in both editors, but particularly in Code because the HTML gets rendered verbatim).
There's an open issue with Code about HTML in hovers not being supported (microsoft/vscode#40607) but I think even when (if) that gets fixed, it'll just become like IntelliJ's with text rendering instead of an icon. It feels a little weird to require custom CSS to render the docs correctly.
WDYT?
DanTup commentedon Mar 29, 2018
I've made this work be regexing the HTML out for an image tag. I'm hot-linking for now to:
https://storage.googleapis.com/material-icons/external-assets/v4/icons/svg/ic_$1_white_36px.svg
It's possible they'll break in future, but I don't think the missing image is any worse than a big chunk of HTML so we'll just update it if it does (though it seems unlikely those files will disappear IMO).
Currently it'll always show the white icon; it looks poor on the Light theme but I'll fix it up if/when microsoft/vscode#46940 gets addressed.
Replace material icon markup in dartdocs with images
Replace material icon markup in dartdocs with images
Replace material icon markup in dartdocs with images
Replace material icon markup in dartdocs with images
ffeu commentedon Sep 18, 2018
@DanTup
Hi, I can no longer see the icons preview in VS Code. Is it just me?
DanTup commentedon Sep 18, 2018
@ffeu I don't know if it's just you, but it does seem ok here:
Can you open a new issue include a screenshot, whether there are any errors in the console (Help -> Toggle Dev Tools) and also a log captured while you're viewing the help?
Thanks!
3141bishwa commentedon Nov 18, 2019
Hi there. Is there any way to get preview working for Cupertino Icons too? Right now, it seems to work for Material Icons only.
Material Icon Preview

Cupertino Icon Preview

DanTup commentedon Nov 18, 2019
@3141bishwa it looks like the documentation for that class does not include previews, see:
https://api.flutter.dev/flutter/cupertino/CupertinoIcons-class.html
vs
https://api.flutter.dev/flutter/material/Icons-class.html
For VS Code, we rely on the documentation and perform a simple regex replace in order to get the icons to work in the tooltips, but there isn't enough info for this in the current ones.
I opened an issue in the Flutter repo about adding previews there (which we could then use to provide here). I don't know if there's a technical reason it isn't done or not (the Material one uses a font, I'm not sure if that's available in the site for Cupertino):
flutter/flutter#45097