LineRange (GroovyPsiElement pivot) { if (pivot instanceof GrDocCommentOwner) { final GrDocComment comment = ((GrDocCommentOwner)pivot).getDocComment(); if (comment != null) { return new LineRange(comment, pivot); } } else if (pivot instanceof GrVariableDeclaration && pivot.getParent() instanceof GrTypeDefinitionBody) { GrVariable[] variables = ((GrVariableDeclaration)pivot).getVariables(); if (variables.length > 0) { GrVariable variable = variables[0]; if (variable instanceof GrField) { GrDocComment comment = ((GrField)variable).getDocComment(); if (comment != null) { return new LineRange(comment, pivot); } } } } return new LineRange(pivot); }