mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
extract JavaCodeFragmentFactory out of PsiElementFactory; remove a number of unnecessary back and forth conversions between Project and PsiManager
This commit is contained in:
@@ -358,71 +358,6 @@ public interface PsiElementFactory extends PsiJavaParserFacade, JVMElementFactor
|
||||
*/
|
||||
@NotNull PsiDocTag createParamTag(@NotNull String parameterName, String description) throws IncorrectOperationException;
|
||||
|
||||
/**
|
||||
* Creates a Java expression code fragment from the text of the expression.
|
||||
*
|
||||
* @param text the text of the expression to create.
|
||||
* @param context the context for resolving references from the code fragment.
|
||||
* @param expectedType expected type of the expression (does not have any effect on creation
|
||||
* but can be accessed as {@link PsiExpressionCodeFragment#getExpectedType()}).
|
||||
* @param isPhysical whether the code fragment is created as a physical element
|
||||
* (see {@link PsiElement#isPhysical()}).
|
||||
* @return the created code fragment.
|
||||
*/
|
||||
@NotNull PsiExpressionCodeFragment createExpressionCodeFragment(@NotNull String text, PsiElement context, final PsiType expectedType, boolean isPhysical);
|
||||
|
||||
/**
|
||||
* Creates a Java code fragment from the text of a Java code block.
|
||||
*
|
||||
* @param text the text of the code block to create.
|
||||
* @param context the context for resolving references from the code fragment.
|
||||
* @param isPhysical whether the code fragment is created as a physical element
|
||||
* (see {@link PsiElement#isPhysical()}).
|
||||
* @return the created code fragment.
|
||||
*/
|
||||
@NotNull
|
||||
JavaCodeFragment createCodeBlockCodeFragment(@NotNull String text, PsiElement context, boolean isPhysical);
|
||||
|
||||
/**
|
||||
* Flag for {@linkplain #createTypeCodeFragment(String, PsiElement, boolean, int)} - allows void type.
|
||||
*/
|
||||
int ALLOW_VOID = 0x01;
|
||||
/**
|
||||
* Flag for {@linkplain #createTypeCodeFragment(String, PsiElement, boolean, int)} - allows type with ellipsis.
|
||||
*/
|
||||
int ALLOW_ELLIPSIS = 0x02;
|
||||
/**
|
||||
* Flag for {@linkplain #createTypeCodeFragment(String, PsiElement, boolean, int)} - allows disjunctive type.
|
||||
*/
|
||||
int ALLOW_DISJUNCTION = 0x02;
|
||||
|
||||
/**
|
||||
* Creates a Java type code fragment from the text of the name of a Java type (the name
|
||||
* of a primitive type, array type or class), with <code>void</code> and ellipsis
|
||||
* not treated as a valid type.
|
||||
*
|
||||
* @param text the text of the Java type to create.
|
||||
* @param context the context for resolving references from the code fragment.
|
||||
* @param isPhysical whether the code fragment is created as a physical element
|
||||
* (see {@link PsiElement#isPhysical()}).
|
||||
* @return the created code fragment.
|
||||
*/
|
||||
@NotNull PsiTypeCodeFragment createTypeCodeFragment(@NotNull String text, PsiElement context, boolean isPhysical);
|
||||
|
||||
/**
|
||||
* Creates a Java type code fragment from the text of the name of a Java type (the name
|
||||
* of a primitive type, array type or class).<br>
|
||||
* {@code void}, ellipsis and disjunctive types are optionally treated as valid ones.
|
||||
*
|
||||
* @param text the text of the Java type to create.
|
||||
* @param context the context for resolving references from the code fragment.
|
||||
* @param isPhysical whether the code fragment is created as a physical element
|
||||
* (see {@link PsiElement#isPhysical()}).
|
||||
* @param flags types allowed to present in text.
|
||||
* @return the created code fragment.
|
||||
*/
|
||||
@NotNull PsiTypeCodeFragment createTypeCodeFragment(@NotNull String text, PsiElement context, boolean isPhysical, int flags);
|
||||
|
||||
/**
|
||||
* Returns a synthetic Java class containing methods which are defined on Java arrays.
|
||||
*
|
||||
@@ -450,23 +385,6 @@ public interface PsiElementFactory extends PsiJavaParserFacade, JVMElementFactor
|
||||
*/
|
||||
@NotNull PsiPackageStatement createPackageStatement(@NotNull String name) throws IncorrectOperationException;
|
||||
|
||||
/**
|
||||
* Creates a Java reference code fragment from the text of a Java reference to a
|
||||
* package or class.
|
||||
*
|
||||
* @param text the text of the reference to create.
|
||||
* @param context the context for resolving the reference.
|
||||
* @param isPhysical whether the code fragment is created as a physical element
|
||||
* (see {@link PsiElement#isPhysical()}).
|
||||
* @param isClassesAccepted if true then classes as well as packages are accepted as
|
||||
* reference target, otherwise only packages are
|
||||
* @return the created reference fragment.
|
||||
*/
|
||||
@NotNull PsiJavaCodeReferenceCodeFragment createReferenceCodeFragment(@NotNull String text,
|
||||
PsiElement context,
|
||||
boolean isPhysical,
|
||||
boolean isClassesAccepted);
|
||||
|
||||
/**
|
||||
* Creates an <code>import static</code> statement for importing the specified member
|
||||
* from the specified class.
|
||||
|
||||
Reference in New Issue
Block a user