node package manager

atom-selection-ast

atom-selection-ast

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.