1.0.1 • Published 9 years ago

atom-selection-ast v1.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

atom-selection-ast

npm.io npm.io npm.io npm.io

Test if an AST node is within the current selection in Atom.

Note that you'll need to enable loc values for your AST nodes when you're parsing.

Usage

NPM

test = selection(source)

Pass in the plaintext JavaScript source for your AST to prepare the module for searching.

test(astNode, selectionRanges)

Returns true if astNode is within one of selectionRanges, where selectionRanges is an array of Atom Range values.

License

MIT. See LICENSE.md for details.