Feedback on "closing labels" preview feature
See original GitHub issuev2.3.1 includes a preview feature enabled with the dart.previewFlutterCloseTagDecorations: true
setting. This adds “closing tag” decorations to the closing parens of constructor calls within build
methods.
This feature is behind a flag because it’s incomplete, has sub-optimal performance and may not work reliably. It is being shipped solely for feedback on the idea and may require analyzer work in order to support in a reliable way.
Please post your feedback below!
Known issues:
These are things that (probably) can’t be addressed without support from the analyzer.
- [Perf] Doesn’t scale well due to reliance on Outlines, Highlights and repeated
getHover
calls - Currently identifies
build
methods based on return type string (Widget
) - Only shows constructors, doesn’t show end of lists (children, actions)
Suggestions:
These are things that can be improved in the preview.
- Support
const
as well asnew
- Prefix with
//
instead of/
so looks a bit like a comment marking the end - Improve styling
- Fix flicker when typing quickly (or holding keys) caused by not being able relate analyzer notifications with document versions - just keep resetting a timeout and only update after there’s been no update for x milliseconds (where x > expected latency for the update)
- Show decorations in any Widget-returning method
- Don’t show annotations against characters other than
)
to mitigate out-of-sync notifications - Allow color to be customised rather than reusing an existing style
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:37 (24 by maintainers)
Top Results From Across the Web
Netlify Deploy Previews - Share, Review, & Gather Feedback ...
Netlify Deploy Previews give teams tools they need to effectively manage and collaborate on web projects. Get feedback, annotate, and comment - all...
Read more >Add, change, hide, or delete comments in a presentation
On the View tab, click Normal. On the Review tab, click Show Comments. View and reply to comments.
Read more >Cancel vs Close: Design to Distinguish the Difference
Save changes before closing a view, use text labels rather than an X icon, and provide a confirmation dialog before destructive actions.
Read more >Labeling Controls | Web Accessibility Initiative (WAI) - W3C
In general, placing labels above the form fields helps reduce horizontal scrolling for people with low vision and mobile device users. However, the...
Read more >Use the Preview pane in the Finder on Mac - Apple Support
Drag the separator line all the way to the right to close the Preview pane. Helpful? Yes No.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve shipped Dart Code v2.4.0. This includes an implementation of “closing tags” that uses the analysis server (you must be using at least
1.25.0-dev.11.0
which was released yesterday; flutter is also using it if you update).It’s still behind a flag (though there’s a new flag name
dart.previewClosingLabels
since it’s not flutter-specific - though the old flag still works) to get some more feedback (it now appears for all Dart!).Please try it out 😃
@dvdwasibi
I’ve added this (#408) for the “real” version (coming soon) though I’m hoping to get confirmation from MS that the way I did it is wonky and there’s a better way =)
It’ll be done by setting a theme colour named
dart.closingLabels
. It’ll default to the colour oftab.inactiveForeground
which is the one shown in my last screenshot above (and should have a similarly reasonable default for light themes).Colours are customised by adding
workbench.colorCustomizations
to your settings (or using a theme which has it; which is none!):