mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] consider keywords as valid parts of fqn while adjusting references (IDEA-134006)
This commit is contained in:
+4
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -964,7 +964,9 @@ public class PsiImplUtil {
|
||||
while (expr instanceof GrReferenceExpression) {
|
||||
final PsiElement nameElement = ((GrReferenceExpression)expr).getReferenceNameElement();
|
||||
if (((GrReferenceExpression)expr).getTypeArguments().length > 0) return false;
|
||||
if (nameElement == null || nameElement.getNode().getElementType() != GroovyTokenTypes.mIDENT) return false;
|
||||
if (nameElement == null || !TokenSets.CODE_REFERENCE_ELEMENT_NAME_TOKENS.contains(nameElement.getNode().getElementType())) {
|
||||
return false;
|
||||
}
|
||||
IElementType dotType = ((GrReferenceExpression)expr).getDotTokenType();
|
||||
if (dotType != null && dotType != GroovyTokenTypes.mDOT) return false;
|
||||
expr = ((GrReferenceExpression)expr).getQualifierExpression();
|
||||
|
||||
+29
@@ -316,4 +316,33 @@ print new Upper.Inner()
|
||||
''')
|
||||
}
|
||||
|
||||
void "test complete class within 'in' package"() {
|
||||
myFixture.with {
|
||||
addClass '''\
|
||||
package in.foo.com;
|
||||
public class Foooo {}
|
||||
'''
|
||||
configureByText '_.groovy', 'Fooo<caret>'
|
||||
complete CompletionType.BASIC
|
||||
type '\n'
|
||||
checkResult '''import in.foo.com.Foooo
|
||||
|
||||
Foooo<caret>'''
|
||||
}
|
||||
}
|
||||
|
||||
void "test complete class within 'def' package"() {
|
||||
myFixture.with {
|
||||
addClass '''\
|
||||
package def.foo.com;
|
||||
public class Foooo {}
|
||||
'''
|
||||
configureByText '_.groovy', 'Fooo<caret>'
|
||||
complete CompletionType.BASIC
|
||||
type '\n'
|
||||
checkResult '''import def.foo.com.Foooo
|
||||
|
||||
Foooo<caret>'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user