mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-21 14:37:45 +07:00
if there is a groovy script class, it should be valid
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@ public class GroovyScriptClass extends LightElement implements GrMemberOwner, Sy
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return myFile.isValid() && myFile.getTopStatements().length > 0;
|
||||
return myFile.isValid() && myFile.isScript();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+10
-6
@@ -18,13 +18,10 @@ package org.jetbrains.plugins.groovy.completion;
|
||||
|
||||
|
||||
import com.intellij.codeInsight.lookup.LookupElement
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
import com.intellij.psi.PsiFile
|
||||
import org.jetbrains.plugins.groovy.GroovyFileType
|
||||
import org.jetbrains.plugins.groovy.util.TestUtils
|
||||
|
||||
import org.jetbrains.plugins.groovy.GroovyFileType
|
||||
|
||||
/**
|
||||
/**
|
||||
* @author Maxim.Medvedev
|
||||
*/
|
||||
public class GroovyCompletionTest extends GroovyCompletionTestBase {
|
||||
@@ -395,5 +392,12 @@ format<caret>"""
|
||||
myFixture.type 'lan\n'
|
||||
myFixture.checkResult "import java.lang<caret>"
|
||||
}
|
||||
|
||||
|
||||
public void testInvalidScriptClass() {
|
||||
myFixture.addFileToProject("b.groovy", "//comment")
|
||||
myFixture.configureByText "a.groovy", "def b<caret>"
|
||||
myFixture.completeBasic()
|
||||
myFixture.checkResult "def b<caret>"
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user