Issue 2341 in dart: Dart Editor - Problem-detection flaws; line-numbers doubled; and related.

已查看 1 次
跳至第一个未读帖子

da...@googlecode.com

未读,
2012年3月29日 01:08:412012/3/29
收件人 bu...@dartlang.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 2341 by mikeeber...@gmail.com: Dart Editor - Problem-detection
flaws; line-numbers doubled; and related.
http://code.google.com/p/dart/issues/detail?id=2341

Using Dart Editor Version 0.1.0.201203261048, Build 5845 on Windows7x64.

There are a few substantial issues with (Tools / Problems) list of reported
problems (errors/warnings) that makes this nearly impossible to get any
value from currently:

1) all reported source-code line numbers are off by a factor of 2. To get
proper line#, one must divide reported line# by 2 (and subtract 1 first if
odd); I presume others have noticed this.

2) If a source-code unit being analyzed for "problems" references
classes/methods defined in another source-file by way of, e.g.,
#import("another-source-file.dart", prefix:' library-prefix-here'), every
qualified reference (using that prefix) will show as an error, like:

* cannot resolve method .method-name-here
* no such type "library-prefix-here.class-name-here"
* New expression does not resolve to a constructor (when attempting to
intantiate library-prefix-here.class-name-here)

3) The editor's problem-analysis logic appears to be looking at the content
of *comments*, which leads to irrelevant "errors" being reported. It
matters not whether the comment format is single-line or multi-line (i.e.,
// or /*...*/)

da...@googlecode.com

未读,
2012年3月29日 01:32:482012/3/29
收件人 bu...@dartlang.org
Updates:
Status: Triaged
Labels: Area-Editor

Comment #1 on issue 2341 by devon...@google.com: Dart Editor -

Problem-detection flaws; line-numbers doubled; and related.
http://code.google.com/p/dart/issues/detail?id=2341

Regarding item 1, can you attach a simple project that demonstrates this
problem? We are testing on Windows, and have not seen this issue. My guess
is that it might be line ending related.

Similarly with #3, if you can attach a simple source file that demonstrates
the problem, this issue will be much easier for us to address. Thanks for
the feedback!

da...@googlecode.com

未读,
2012年3月29日 12:17:352012/3/29
收件人 bu...@dartlang.org

Comment #2 on issue 2341 by mikeeber...@gmail.com: Dart Editor -
Problem-detection flaws; line-numbers doubled; and related.
http://code.google.com/p/dart/issues/detail?id=2341

devoncarew,

re: #1:
I have attached a file (Common.dart), which may help you debug if it is
line-ending related issue.
I am using the Dart Editor *only* for bug-detection (trying to at least). I
am actually creating and editing my .dart files externally using
WebStorm/PHPStorm (JetBrains) since it much more productive for me and I am
migrating existing JavaScript to Dart.

I have used the Dart Editor "open folder" to select the directory in which
all my .dart files are.
If I create a brand new folder and place this one file (Common.dart) in
that directory and then open the Dart Editor, choose "open folder" (folder
containing that one file), a few seconds later the Dart Editor analysis has
finished and the "Problems" view shows:

(error) Cannot find referenced source: Widget.dart | Common.dart [line
27]
(warning) no such type "HTMLElement" | Common.dart [line 123]

But, those issues are *really* at lines 14 and 62 respectively. Line 14
refers to an import file not in this directory, and line 62 in my attached
file has a problem with HTMLElement (should be: HtmlElement);


re: #3: I agree with you... issues #1 and #3 are likely related. I hope
you figure out why I see these problems.


re: #2: that seems to be a problem of its own.

Hope that helps.

Attachments:
Common.dart 9.1 KB

da...@googlecode.com

未读,
2012年4月2日 19:05:522012/4/2
收件人 bu...@dartlang.org
Updates:
Owner: devon...@google.com

Comment #3 on issue 2341 by clayb...@google.com: Dart Editor -

Problem-detection flaws; line-numbers doubled; and related.
http://code.google.com/p/dart/issues/detail?id=2341

(No comment was entered for this change.)

da...@googlecode.com

未读,
2012年4月3日 13:34:172012/4/3
收件人 bu...@dartlang.org

Comment #4 on issue 2341 by devon...@google.com: Dart Editor -
Problem-detection flaws; line-numbers doubled; and related.
http://code.google.com/p/dart/issues/detail?id=2341

I split item 2 into it's own bug:
http://code.google.com/p/dart/issues/detail?id=2423.

I was able to reproduce the source lines off by a factor of two issue. It
is related to windows line endings, and I'll have a fix for that shortly.

I still see the problem where the error marker is lined up in the wrong
place in the file (separate from the line number that's reported). I think
it has to do with some of the special characters in use in this particular
file. Specifically, the long lines of separators on lines 2, 4, and 7. If I
remove these, the error marker positions line up correctly.

What tool did you use to create this file, and do you happen to know the
character encoding of it? Dart files all need to be UTF8 encoded; I think
that this file is using something like CP-1252, we're interpreting it as
UTF8, and that's throwing off the char offsets.

da...@googlecode.com

未读,
2012年4月3日 14:10:562012/4/3
收件人 bu...@dartlang.org

Comment #5 on issue 2341 by mikeeber...@gmail.com: Dart Editor -
Problem-detection flaws; line-numbers doubled; and related.
http://code.google.com/p/dart/issues/detail?id=2341

devoncarew,

re: tool used to create file... I am using WebStorm/PHPStorm (JetBrains) to
edit my .dart files. And, according to that program, it *is* saving files
as UTF-8. I further tested saving specifically as UTF-8 with PSPAD editor
and I still have same outcome: line numbers off by factor of 2. So, I am
not sure whether the encoding is fully to blame.

re: special-characters on lines 2,4,7... being within comment-blocks, I
would not think those characters would be parsed at all. Also, I think
they should be considered "valid" since they display perfectly fine under
UTF-8. If you click "View" common.dart (above, in comment#2), it opens a
browser window that displays that source-code file with those characters as
nice block-lines in the Chrome browser where the displayed HTML page meta
values are: http-equiv="Content-Type" content="text/html;
charset=UTF-8" ... so, does that not indicate they are "valid" UTF-8
characters? Seems like it should not matter to your Dart lexer or
whatever, but that is for you all to figure out.

Thanks for working on this.

da...@googlecode.com

未读,
2012年4月3日 14:15:022012/4/3
收件人 bu...@dartlang.org
Updates:
Status: Fixed

Comment #6 on issue 2341 by devon...@google.com: Dart Editor -

Problem-detection flaws; line-numbers doubled; and related.
http://code.google.com/p/dart/issues/detail?id=2341

OK, I found a place in our parser where we were reading the file in
assuming the platform default encoding instead of UTF8. W/ the patch
(http://codereview.chromium.org/9959103/) we can now handle your test file
properly. Thanks for the report!

This should be in the continuous build in a few minutes, or our next
integration build (~tomorrow sometime).

回复全部
回复作者
转发
0 个新帖子