| Summary: | [html][parser] Provide start, end ranges for nodes | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> |
| Component: | Client | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | curtis.windatt.public |
| Version: | 8.0 | ||
| Target Milestone: | 8.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Michael Rennie
Commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=38ff56eab8ebdd2524dbe7e2d57c20e361f0b8ae has 90% of the fix for this issue. Remaining work is: 1. correct the end range for enclosing nodes after the fact - currently the way the parser works when it writes out a node the 'found end' is not the end of the entire node (including children), but only means 'the tag end'. 2. improve the way the parser computes the state position for starts of nodes. Currently depending on the node kind it skips proceeding '<' and other punctuators, this should be made consistent and always include all punctuators in the range / position computations. 3. the attributes object attached to a node does not carry any location information. We should compute and attach the ranges to these as well - we need this to know if we are hovering over something interesting or not. All 3 issues fixed in: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=3a2ce144fe136f6bae9f838fb3ab67aaaa9f9cc7 The commit also includes an AST (DOM?) visitor for us to use when trying to find nodes, etc. The API for it is simple: Visitor.visit(ast, callback) where the callback is expected to be an object with a function 'visitNode'. Visiting can be short-circuited using Visitor.BREAK (immediately stop visiting) or Visitor.SKIP (skip all child nodes for the current node). All tests pass. |