Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try-dart: positions for warnings are wrong #16142

Closed
kasperl opened this issue Jan 16, 2014 · 5 comments
Closed

try-dart: positions for warnings are wrong #16142

kasperl opened this issue Jan 16, 2014 · 5 comments
Assignees
Labels
type-enhancement A request for a change that isn't a bug

Comments

@kasperl
Copy link

kasperl commented Jan 16, 2014

http://r31889.try-dart-lang.appspot.com/

Typing in this code:


// Go ahead and modify this example.

var greeting = "Hello, World!";

// Prints a greeting.
void main() {
  // The [print] function displays a message in the "Console" box.
  // Try modifying the greeting above and watch the "Console" box change.
  String s = 42;
  print(greeting);
}


leads to the correct warning (int is not assignable to String), but the red warning marker covers everything from String s and forward (including the next lines).

@peter-ahe-google
Copy link
Contributor

The problem is that I grab the enclosing DOM node which might be larger than the token.

See addDiagnostic in editor.dart which has this TODO:

        // TODO(ahe): Don't highlight everything in the node. Find
        // the relevant token.


Added Accepted label.

@peter-ahe-google
Copy link
Contributor

A related problem is that EOF errors can be hard to see. I need to find a better way to present diagnostics.

Also, I've noticed issues when you have multiple diagnostics on the same line.


cc @lukechurch.

@peter-ahe-google
Copy link
Contributor

https://codereview.chromium.org/140933003/ fixes the immediate problem but not the general issue of small diagnostics.

@peter-ahe-google
Copy link
Contributor

I've updated http://r31889.try-dart-lang.appspot.com/ with this fix.

@peter-ahe-google
Copy link
Contributor

Removed Type-Defect label.
Added Type-Enhancement label.

@sethladd sethladd closed this as completed Jun 4, 2015
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants