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.

Colons in named parameters get replaced with equal signs occasioanally

See original GitHub issue

While editing code, the editor sometimes brakes previously valid code below the code being edited by replacing colons in parameter lists with equal signs. The editor also adds curly braces { … } automatically when it should not (there should not be curly braces in a conditional statement inside an array definition).

Sample result (the code defines widgets inside Column.children):

image

I don’t know how to reproduce this exactly, but most probably you have to make some heavy editing into an initially valid code which brakes the code on purpose temporarily. Then you will see also some unexpected automatic “fixes”. In this specific case I just copy/pasted a block of new code into the middle of an existing code and started editing it. This was expected to brake the existing code temporarily, but braking the parameter lists and adding invalid curly braces is of course not correct.

[√] Flutter (Channel stable, 2.10.4, on Microsoft Windows [Version 10.0.19043.1586], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.7) [√] Android Studio (version 2021.1) [√] VS Code (version 1.66.0) [√] Connected device (4 available) [√] HTTP Host Availability

Dart extension v3.36.0

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kinexcommented, Apr 22, 2022

@DanTup Ok, I’ll try to do it next time I see it. I’m working on a variety of projects and I’ve only been able to use Dart occasionally lately, but nonetheless, I’ve seen the problem a few times in the last few months.

0reactions
github-actions[bot]commented, May 13, 2022

This issue has been marked stale because it is tagged awaiting-info for 20 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Colon vs. equals - Discussion - Swift Forums
This is perhaps a bit nitpicky, but I've noticed that Swift sometimes uses colon to separate names and values, and sometimes uses equals....
Read more >
What does a double colon followed by an equals sign (::=)
It symbolizes 'symbol derivation rule' in Backus–Naur Form. Meaning that in: <symbol> ::= __expression__. nonterminal <symbol> consists of (is defined as, ...
Read more >
Why colons and not equals? | Sololearn: Learn to code for ...
In the expression int res = Area(w: 5, h: 8); , why colon and not equal symbol?
Read more >
Deconstructing Dart Constructors - Flutter Community - Medium
Colons, named parameters, asserts, factories… A constructor is used to ensure instances are created in a coherent state. This is the…
Read more >
Named parameters in C# - use of ":" or "=" - MSDN - Microsoft
With this grammar, it's impossible to tell the difference between a named parameter and an assignment if equals were used instead of colon....
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