This repository has been archived by the owner on Dec 4, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 71
Support node ranges and locations #89
Closed
mrennie opened this issue
Sep 24, 2014
· 1 comment
· May be fixed by Ramyromel/eslint-plugin-react#3
Closed
Support node ranges and locations #89
mrennie opened this issue
Sep 24, 2014
· 1 comment
· May be fixed by Ramyromel/eslint-plugin-react#3
Labels
Comments
This would be really useful, we'll definitely add this. |
not-an-aardvark
added a commit
that referenced
this issue
Apr 2, 2017
This adds a `range` option to the `parse` API. When enabled, each node has a [start, end] range property indicating its location in the comment. When computing the range with the `unwrap: true` option, the returned range needs to track indices in the original comment, not the unwrapped version. To implement that behavior, this commit updates the unwrapping logic to use a regular expression rather than a state machine. When converting an index, the parser and re-matches the original comment line-by-line, keeping track of the number of discarded "wrapping" characters.
not-an-aardvark
added a commit
that referenced
this issue
Nov 15, 2017
This adds a `range` option to the `parse` API. When enabled, each node has a [start, end] range property indicating its location in the comment. When computing the range with the `unwrap: true` option, the returned range needs to track indices in the original comment, not the unwrapped version. To implement that behavior, this commit updates the unwrapping logic to use a regular expression rather than a state machine. When converting an index, the parser and re-matches the original comment line-by-line, keeping track of the number of discarded "wrapping" characters.
tmcw
pushed a commit
to documentationjs/doctrine
that referenced
this issue
Apr 11, 2018
This adds a `range` option to the `parse` API. When enabled, each node has a [start, end] range property indicating its location in the comment. When computing the range with the `unwrap: true` option, the returned range needs to track indices in the original comment, not the unwrapped version. To implement that behavior, this commit updates the unwrapping logic to use a regular expression rather than a state machine. When converting an index, the parser and re-matches the original comment line-by-line, keeping track of the number of discarded "wrapping" characters.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
it would be very helpful if doctrine could support node ranges and locations. I imagine this would be the same infos that the Esprima parser provides, for example:
parsed with options
{loc:true, ranges:true}
would yield something like:The text was updated successfully, but these errors were encountered: