File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -619,13 +619,7 @@ namespace ts {
619
619
// be parented by the container of the SyntaxList, not the SyntaxList itself.
620
620
// In order to find the list item index, we first need to locate SyntaxList itself and then search
621
621
// for the position of the relevant node (or comma).
622
- const syntaxList = forEach ( node . parent . getChildren ( ) , c => {
623
- // find syntax list that covers the span of the node
624
- if ( isSyntaxList ( c ) && c . pos <= node . pos && c . end >= node . end ) {
625
- return c ;
626
- }
627
- } ) ;
628
-
622
+ const syntaxList = find ( node . parent . getChildren ( ) , ( c ) : c is SyntaxList => isSyntaxList ( c ) && rangeContainsRange ( c , node ) ) ;
629
623
// Either we didn't find an appropriate list, or the list must contain us.
630
624
Debug . assert ( ! syntaxList || contains ( syntaxList . getChildren ( ) , node ) ) ;
631
625
return syntaxList ;
You can’t perform that action at this time.
0 commit comments