Skip to content

Commit

Permalink
Add comment on getCompletionRecords
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Mar 26, 2021
1 parent 54a6684 commit d33320a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/babel-traverse/src/path/family.ts
Expand Up @@ -231,6 +231,16 @@ function _getCompletionRecords(
return records;
}

/**
* Retrieve the completion records of a given path.
* Note: to ensure proper support on `break` statement, this method
* will manipulate the AST around the break statement. Do not call the method
* twice for the same path.
*
* @export
* @param {NodePath} this
* @returns {NodePath[]} Completion records
*/
export function getCompletionRecords(this: NodePath): NodePath[] {
const records = _getCompletionRecords(this, {
canHaveBreak: false,
Expand Down

0 comments on commit d33320a

Please sign in to comment.