public int getImportInsertOffset ( SarlScript script ) { final ICompositeNode node = NodeModelUtils . findActualNodeFor ( script . getImportSection ( ) ) ; if ( node == null ) { final List < INode > children = NodeModelUtils . findNodesForFeature ( script , XtendPackage . eINSTANCE . getXtendFile_Package ( ) ) ; if ( children . isEmpty ( ) ) { return 0 ; } return children . get ( 0 ) . getEndOffset ( ) ; } return node . getEndOffset ( ) ; }
Replies the index where import declaration could be inserted into the given container .