[groovy] ask stub if parameter is optional
authorDaniil Ovchinnikov <daniil.ovchinnikov@jetbrains.com>
Tue, 25 Oct 2016 15:54:56 +0000 (18:54 +0300)
committerDaniil Ovchinnikov <daniil.ovchinnikov@jetbrains.com>
Tue, 25 Oct 2016 17:22:41 +0000 (20:22 +0300)
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/params/GrParameterImpl.java

index f6e02416530b4a0be9823f7463f213677bea4cb3..a7eb095eecae551b6c4ff6e01f5ffa17f4c419e6 100644 (file)
@@ -124,7 +124,7 @@ public class GrParameterImpl extends GrVariableBaseImpl<GrParameterStub> impleme
   private boolean isMainMethodFirstUntypedParameter() {
     if (getTypeElementGroovy() != null) return false;
     if (!(getParent() instanceof GrParameterList)) return false;
-    if (getInitializerGroovy() != null) return false;
+    if (isOptional()) return false;
 
     GrParameterList parameterList = (GrParameterList)getParent();
     if (!(parameterList.getParent() instanceof GrMethod)) return false;