| Summary: | Line hover has multiple same problems reported | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> |
| Component: | Editor | Assignee: | Mark Macdonald <mamacdon> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | gheorghe, mamacdon, Silenio_Quarti |
| Version: | 5.0 | Flags: | Silenio_Quarti:
review+
|
| Target Milestone: | 5.0 RC1 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Sounds related to bug 422867. The problem is that the editor's annotation hovers behave badly (appear at inappropriate times, repeat the same error many times) when you create an annotation whose range exceeds the EOL or EOF. The workaround was to range-check the problem offsets before sending them to the editor. In this case, we are probably allowing an out-of-range annotation to slip past. Ok, the problematic annotations here have this shape (where charCount is the number of characters in the file) > { start: charCount, > end: charCount > } When the editor attempts to get all annotations in the file, it does this: > annotationModel.getAnnotations(0, charCount); This does not return the problematic annotation, since `charCount` lies outside the range [0, charCount). So the editor never removes the annotation, and multiple such annotations tend to accumulate. They are shown when you hover over empty portions of the editor canvas. Mike just released a fix that I think prevents the JS validator from producing these problematic annotations. But I would like to fix the general case too. The fix is to allow getAnnotations() to be called without ranges, which returns everything http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=70e5d68 (In reply to Mark Macdonald from comment #2) Sorry, ignore the link in my previous comment. Here is the correct one http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=43895e0 The changes are fine. There might be a few other places we can use getAnnotations() instead of getAnnotations(0, charCount) (i.e actions.js). The comment above is mine. Thanks Silenio. pushed the commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=22d0851 Also changed a bunch of callers to use getAnnotations(): http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=2d5dd31 |
Consider the following snippet: /**jslint node: true */ require("mongo"). In the gutter there are two problems reported: 1."Require is not defined" 2."Missing semicolon" which is expected, but if you hover over the whitespace of the line - past the '.' - the popup shows a whole bunch of errors like: "Parse Error: unexpected end of input"