Cleanup (better name for module ref. element)

This commit is contained in:
Roman Shevchenko
2016-07-19 12:32:33 +02:00
parent 3f7b89e37c
commit efc14fe563
9 changed files with 16 additions and 15 deletions
@@ -203,7 +203,7 @@ public abstract class AbstractJavaBlock extends AbstractBlock implements JavaBlo
InjectedLanguageUtil.hasInjections((PsiLanguageInjectionHost)child)) {
return new CommentWithInjectionBlock(child, wrap, alignment, indent, settings, javaSettings);
}
if (child instanceof LeafElement || childPsi instanceof PsiJavaModuleReference) {
if (child instanceof LeafElement || childPsi instanceof PsiJavaModuleReferenceElement) {
final LeafBlock block = new LeafBlock(child, wrap, alignment, actualIndent);
block.setStartOffset(startOffset);
return block;
@@ -391,7 +391,7 @@ public abstract class JavaElementVisitor extends PsiElementVisitor {
visitElement(module);
}
public void visitModuleReference(PsiJavaModuleReference moduleRef) {
public void visitModuleReference(PsiJavaModuleReferenceElement moduleRef) {
visitElement(moduleRef);
}
@@ -26,6 +26,7 @@ public interface PsiJavaModule extends NavigatablePsiElement {
String MODULE_INFO_CLASS = "module-info";
String MODULE_INFO_FILE = MODULE_INFO_CLASS + ".java";
@NotNull PsiJavaModuleReference getNameElement();
@NotNull
PsiJavaModuleReferenceElement getNameElement();
@NotNull String getModuleName();
}
@@ -22,6 +22,6 @@ import org.jetbrains.annotations.NotNull;
*
* @since 2016.3
*/
public interface PsiJavaModuleReference extends PsiElement {
public interface PsiJavaModuleReferenceElement extends PsiElement {
@NotNull String getReferenceText();
}
@@ -25,16 +25,16 @@ import com.intellij.psi.impl.source.tree.TreeElement;
import org.jetbrains.annotations.NotNull;
public class ClsJavaModuleImpl extends ClsRepositoryPsiElement<PsiJavaModuleStub> implements PsiJavaModule {
private PsiJavaModuleReference myReference;
private PsiJavaModuleReferenceElement myReference;
public ClsJavaModuleImpl(PsiJavaModuleStub stub) {
super(stub);
myReference = new ClsJavaModuleReferenceImpl(this, stub.getName());
myReference = new ClsJavaModuleReferenceElementImpl(this, stub.getName());
}
@NotNull
@Override
public PsiJavaModuleReference getNameElement() {
public PsiJavaModuleReferenceElement getNameElement() {
return myReference;
}
@@ -18,16 +18,16 @@ package com.intellij.psi.impl.compiled;
import com.intellij.psi.JavaElementVisitor;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.PsiJavaModuleReference;
import com.intellij.psi.PsiJavaModuleReferenceElement;
import com.intellij.psi.impl.source.tree.JavaElementType;
import com.intellij.psi.impl.source.tree.TreeElement;
import org.jetbrains.annotations.NotNull;
public class ClsJavaModuleReferenceImpl extends ClsElementImpl implements PsiJavaModuleReference {
public class ClsJavaModuleReferenceElementImpl extends ClsElementImpl implements PsiJavaModuleReferenceElement {
private final PsiElement myParent;
private final String myText;
public ClsJavaModuleReferenceImpl(PsiElement parent, String text) {
public ClsJavaModuleReferenceElementImpl(PsiElement parent, String text) {
myParent = parent;
myText = text;
}
@@ -35,8 +35,8 @@ public class PsiJavaModuleImpl extends JavaStubPsiElement<PsiJavaModuleStub> imp
@NotNull
@Override
public PsiJavaModuleReference getNameElement() {
return PsiTreeUtil.getRequiredChildOfType(this, PsiJavaModuleReference.class);
public PsiJavaModuleReferenceElement getNameElement() {
return PsiTreeUtil.getRequiredChildOfType(this, PsiJavaModuleReferenceElement.class);
}
@NotNull
@@ -20,8 +20,8 @@ import com.intellij.psi.impl.source.tree.CompositePsiElement;
import com.intellij.psi.impl.source.tree.JavaElementType;
import org.jetbrains.annotations.NotNull;
public class PsiJavaModuleReferenceImpl extends CompositePsiElement implements PsiJavaModuleReference {
public PsiJavaModuleReferenceImpl() {
public class PsiJavaModuleReferenceElementImpl extends CompositePsiElement implements PsiJavaModuleReferenceElement {
public PsiJavaModuleReferenceElementImpl() {
super(JavaElementType.MODULE_REFERENCE);
}
@@ -140,7 +140,7 @@ public interface JavaElementType {
IElementType ANNOTATION_ARRAY_INITIALIZER = new JavaCompositeElementType("ANNOTATION_ARRAY_INITIALIZER", PsiArrayInitializerMemberValueImpl.class);
IElementType RECEIVER_PARAMETER = new JavaCompositeElementType("RECEIVER", PsiReceiverParameterImpl.class);
IElementType MODULE_REFERENCE = new JavaCompositeElementType("MODULE_REFERENCE", PsiJavaModuleReferenceImpl.class);
IElementType MODULE_REFERENCE = new JavaCompositeElementType("MODULE_REFERENCE", PsiJavaModuleReferenceElementImpl.class);
IElementType REQUIRES_STATEMENT = new JavaCompositeElementType("REQUIRES_STATEMENT", PsiRequiresStatementImpl.class);
IElementType EXPORTS_STATEMENT = new JavaCompositeElementType("EXPORTS_STATEMENT", PsiExportsStatementImpl.class);
IElementType USES_STATEMENT = new JavaCompositeElementType("USES_STATEMENT", PsiUsesStatementImpl.class);