question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feedback on "closing labels" preview feature

See original GitHub issue

v2.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!

Flutter closing tag decorations

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 as new
  • 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:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:37 (24 by maintainers)

github_iconTop GitHub Comments

2reactions
DanTupcommented, Aug 18, 2017

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 😃

2reactions
DanTupcommented, Aug 12, 2017

@dvdwasibi

it would be nice to specify the style (color) of the closing tags.

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 of tab.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!):

"workbench.colorCustomizations": {
    "dart.closingLabels": "#ff0000"
}
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found