greener gant scripts

This commit is contained in:
peter.gromov
2010-12-22 19:49:53 +03:00
parent 871a014e19
commit dcfc73f460
2 changed files with 3 additions and 1 deletions
@@ -43,6 +43,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrOpenBlock;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.branch.GrReturnStatement;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.*;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrAccessorMethod;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrBuilderMethod;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod;
import org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement;
import org.jetbrains.plugins.groovy.lang.psi.controlFlow.Instruction;
@@ -336,6 +337,7 @@ public class GroovyAssignabilityCheckInspection extends BaseInspection {
private boolean checkMethodApplicability(GroovyResolveResult methodResolveResult, GroovyPsiElement place) {
final PsiElement element = methodResolveResult.getElement();
if (!(element instanceof PsiMethod)) return true;
if (element instanceof GrBuilderMethod) return true;
final PsiMethod method = (PsiMethod)element;
PsiType[] argumentTypes = PsiUtil.getArgumentTypes(place, true);
@@ -164,10 +164,10 @@ target (default : '') {
myFixture.configureByText "a.gant", """
target (default : '') {
echo<warning descr="'echo' cannot be applied to '(java.io.FileInputStream)'">(new FileInputStream<warning descr="Ambiguous constructor call">()</warning>)</warning>
echo("hello2")
echo(message: 'Echo task.')
ant.fail('Failure reason')
ant.junit(fork:'yes') {}
}"""
myFixture.checkHighlighting(true, false, false)
}