Minor: add missing static imports for PsiPackage.JetPsiFactory
This commit is contained in:
@@ -22,6 +22,8 @@ import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.JetNodeType;
|
||||
|
||||
import static org.jetbrains.jet.lang.psi.PsiPackage.JetPsiFactory;
|
||||
|
||||
public abstract class JetExpressionImpl extends JetElementImpl implements JetExpression {
|
||||
public JetExpressionImpl(@NotNull ASTNode node) {
|
||||
super(node);
|
||||
@@ -46,7 +48,7 @@ public abstract class JetExpressionImpl extends JetElementImpl implements JetExp
|
||||
PsiElement parent = getParent();
|
||||
if (parent instanceof JetExpression && newElement instanceof JetExpression &&
|
||||
JetPsiUtil.areParenthesesNecessary((JetExpression) newElement, this, (JetExpression) parent)) {
|
||||
return super.replace(PsiPackage.JetPsiFactory(this).createExpression("(" + newElement.getText() + ")"));
|
||||
return super.replace(JetPsiFactory(this).createExpression("(" + newElement.getText() + ")"));
|
||||
}
|
||||
return super.replace(newElement);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ import com.intellij.psi.stubs.StubElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static org.jetbrains.jet.lang.psi.PsiPackage.JetPsiFactory;
|
||||
|
||||
public abstract class JetExpressionImplStub<T extends StubElement> extends JetElementImplStub<T> implements JetExpression {
|
||||
public JetExpressionImplStub(@NotNull T stub, @NotNull IStubElementType nodeType) {
|
||||
super(stub, nodeType);
|
||||
@@ -44,7 +46,7 @@ public abstract class JetExpressionImplStub<T extends StubElement> extends JetEl
|
||||
PsiElement parent = getParent();
|
||||
if (parent instanceof JetExpression && newElement instanceof JetExpression &&
|
||||
JetPsiUtil.areParenthesesNecessary((JetExpression) newElement, this, (JetExpression) parent)) {
|
||||
return super.replace(PsiPackage.JetPsiFactory(this).createExpression("(" + newElement.getText() + ")"));
|
||||
return super.replace(JetPsiFactory(this).createExpression("(" + newElement.getText() + ")"));
|
||||
}
|
||||
return super.replace(newElement);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lexer.JetTokens;
|
||||
|
||||
import static org.jetbrains.jet.lang.psi.PsiPackage.JetPsiFactory;
|
||||
|
||||
public class JetObjectDeclarationName extends JetExpressionImpl {
|
||||
public JetObjectDeclarationName(@NotNull ASTNode node) {
|
||||
super(node);
|
||||
@@ -49,7 +51,7 @@ public class JetObjectDeclarationName extends JetExpressionImpl {
|
||||
}
|
||||
|
||||
public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException {
|
||||
return getNameIdentifier().replace(PsiPackage.JetPsiFactory(this).createNameIdentifier(name));
|
||||
return getNameIdentifier().replace(JetPsiFactory(this).createNameIdentifier(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user