private String getJavaDocCommentsBeforeNode ( GroovySourceAST t ) { String result = "" ; LineColumn thisLineCol = new LineColumn ( t . getLine ( ) , t . getColumn ( ) ) ; String text = sourceBuffer . getSnippet ( lastLineCol , thisLineCol ) ; if ( text != null ) { Matcher m = PREV_JAVADOC_COMMENT_PATTERN . matcher ( text ) ; if ( m . find ( ) ) { result = m . group ( 1 ) ; } } if ( isMajorType ( t ) ) { lastLineCol = thisLineCol ; } return result ; }
todo - If no comment before node then get comment from same node on parent class - ouch!