Java Code Examples for com.intellij.psi.PsiClass

The following are top voted examples for showing how to use com.intellij.psi.PsiClass. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: manifold-ij   File: ManTypeFinder.java   Source Code and License 6 votes vote down vote up
@Override
public PsiClass findClass( String fqn, GlobalSearchScope globalSearchScope )
{
  //System.out.println( "findClass() : " + fqn + " : " + globalSearchScope );

  if( DumbService.getInstance( globalSearchScope.getProject() ).isDumb() )
  {
    // skip processing during index rebuild
    return null;
  }

  List<ManModule> modules = findModules( globalSearchScope );

  for( ManModule m : modules )
  {
    PsiClass psiClass = ManifoldPsiClassCache.instance().getPsiClass( globalSearchScope, m, fqn );
    if( psiClass != null )
    {
      return psiClass;
    }
  }
  return null;
}
 
Example 2
Project: intellij-plugin   File: ToolsNode.java   Source Code and License 6 votes vote down vote up
protected MultiMap<PsiFile, ToolNode> computeChildren(PsiFile psiFile) {
    MultiMap<PsiFile, ToolNode> children = new MultiMap<>();
    Project project = getProject();
    if (project != null) {
        PsiClass toolInterface = JavaPsiFacade.getInstance(project).findClass(TOOL_INTERFACE, GlobalSearchScope.allScope(project));
        if (toolInterface != null) {
            ClassInheritorsSearch.search(toolInterface, GlobalSearchScope.allScope(project), true).forEach(psiClass -> {
                PsiFile containingFile = psiClass.getContainingFile();
                if (!isAbstract(psiClass)) {
                    children.putValue(containingFile, new ToolNode(this, psiClass));
                }
            });
        }
    }
    return children;
}
 
Example 3
Project: GitHub   File: FieldsDialog.java   Source Code and License 6 votes vote down vote up
public FieldsDialog(ConvertBridge.Operator operator, ClassEntity classEntity,
                    PsiElementFactory factory, PsiClass psiClass, PsiClass aClass, PsiFile file, Project project
        , String generateClassStr) {
    this.operator = operator;
    this.factory = factory;
    this.aClass = aClass;
    this.file = file;
    this.project = project;
    this.psiClass = psiClass;
    this.generateClassStr = generateClassStr;
    setContentPane(contentPane);
    setTitle("Virgo Model");
    getRootPane().setDefaultButton(buttonOK);
    this.setAlwaysOnTop(true);
    initListener(classEntity, generateClassStr);
}
 
Example 4
Project: manifold-ij   File: RenameResourceElementProcessor.java   Source Code and License 6 votes vote down vote up
@Override
public boolean canProcessElement( @NotNull PsiElement elem )
{
  PsiElement[] element = new PsiElement[]{elem};
  List<PsiElement> javaElems = findJavaElements( element );
  if( javaElems.isEmpty() )
  {
    return false;
  }

  for( PsiElement javaElem : javaElems )
  {
    if( !(javaElem instanceof PsiMethod) &&
        !(javaElem instanceof PsiField) &&
        !(javaElem instanceof PsiClass) )
    {
      return false;
    }
  }

  return true;
}
 
Example 5
Project: manifold-ij   File: ResourceToManifoldUtil.java   Source Code and License 6 votes vote down vote up
private static boolean isJavaElementForType( PsiModifierListOwner modifierListOwner, PsiClass psiClass )
{
  PsiAnnotation annotation = modifierListOwner.getModifierList().findAnnotation( TypeReference.class.getName() );
  if( annotation != null )
  {
    PsiNameValuePair[] attributes = annotation.getParameterList().getAttributes();
    for( PsiNameValuePair pair : attributes )
    {
      String fqn = pair.getLiteralValue();
      if( psiClass.getQualifiedName().contains( fqn ) )
      {
        return true;
      }
    }
  }
  return false;
}
 
Example 6
Project: manifold-ij   File: ManAugmentProvider.java   Source Code and License 6 votes vote down vote up
private PsiMethod makePsiMethod( AbstractSrcMethod method, PsiClass psiClass )
{
  PsiElementFactory elementFactory = JavaPsiFacade.getInstance( psiClass.getProject() ).getElementFactory();
  StringBuilder sb = new StringBuilder();
  method.render( sb, 0 );
  try
  {
    return elementFactory.createMethodFromText( sb.toString(), psiClass );
  }
  catch( IncorrectOperationException ioe )
  {
    // the text of the method does not conform to method grammar, probably being edited in an IJ editor,
    // ignore these since the editor provides error information
    return null;
  }
}
 
Example 7
Project: CodeGenerate   File: MainAction.java   Source Code and License 6 votes vote down vote up
public void actionPerformed(AnActionEvent event) {
        Project project = event.getData(PlatformDataKeys.PROJECT);
        Editor editor = event.getData(PlatformDataKeys.EDITOR);
        PsiFile mFile = PsiUtilBase.getPsiFileInEditor(editor, project);
        PsiClass psiClass = getTargetClass(editor, mFile);
        GridMain gridMain = new GridMain(psiClass,mFile,project);
        //DBConn dbConn = new DBConn(psiClass,mFile,project);
//        JsonDialog jsonD = new JsonDialog(psiClass, mFile, project);
//        jsonD.setClass(psiClass);
//        jsonD.setFile(mFile);
//        jsonD.setProject(project);
//        jsonD.setSize(600, 400);
//        jsonD.setLocationRelativeTo(null);
//        jsonD.setVisible(true);

    }
 
Example 8
Project: CustomLintRules   File: AutoPointPagerAdapterDetector.java   Source Code and License 6 votes vote down vote up
@Override
public void checkClass(JavaContext context, PsiClass node) {
    super.checkClass(context, node);

    JavaEvaluator evaluator = context.getEvaluator();
    if (evaluator.isAbstract(node)) {
        return;
    }

    boolean isFragmentPagerAdapter = evaluator.extendsClass(node, CLASS_FRAGMENT_PAGER_ADAPTER, false);
    if (isFragmentPagerAdapter) return;

    boolean isFragmentStatePagerAdapter = evaluator.extendsClass(node, CLASS_FRAGMENT_STATE_PAGER_ADAPTER, false);
    if (isFragmentStatePagerAdapter) return;

    boolean supportAutoPoint = evaluator.extendsClass(node, CLASS_AUTOPOINT_PAGER_ADAPTER, false);

    if (!supportAutoPoint) {
        context.report(ISSUE_PAGER_ADAPTER, node, context.getLocation(node),
                "Pager Adapter 必须实现DDPagerAdapter,否则不支持自动打点 class:" + node.getName());
    }
}
 
Example 9
Project: CustomLintRules   File: AutoPointPopWindowDetector.java   Source Code and License 6 votes vote down vote up
@Override
public void checkClass(JavaContext context, PsiClass node) {
    super.checkClass(context, node);

    JavaEvaluator evaluator = context.getEvaluator();
    if (evaluator.isAbstract(node)) {
        return;
    }

    boolean supportAutoPoint = evaluator.extendsClass(node, CLASS_AUTO_POINT_POP_WINDOW, false);

    if (!supportAutoPoint) {
        context.report(ISSUE_POP_WINDOW, node, context.getLocation(node),
                String.format("%s do not support auto point,should extends DDPopupWindow", node.toString()));
    }
}
 
Example 10
Project: CustomLintRules   File: AutoPointAlertDialogDetector.java   Source Code and License 6 votes vote down vote up
@Override
public void checkClass(JavaContext context, PsiClass node) {
    super.checkClass(context, node);

    JavaEvaluator evaluator = context.getEvaluator();
    if (evaluator.isAbstract(node)) {
        return;
    }

    boolean supportAutoPoint = evaluator.extendsClass(node, CLASS_AUTO_POINT_ALERT_DIALOG, false);

    if (!supportAutoPoint) {
        context.report(ISSUE_ALERT_DIALOG, node, context.getLocation(node),
                String.format("%s do not support auto point,should extends DDAlertDialog", node.toString()));
    }
}
 
Example 11
Project: CustomLintRules   File: AutoPointDialogDetector.java   Source Code and License 6 votes vote down vote up
@Override
public void checkClass(JavaContext context, PsiClass node) {
    super.checkClass(context, node);

    JavaEvaluator evaluator = context.getEvaluator();
    if (evaluator.isAbstract(node)) {
        return;
    }

    boolean autopoint_dialog = evaluator.extendsClass(node, CLASS_AUTO_POINT_DIALOG, false);
    boolean alert_dialog = evaluator.extendsClass(node, CLASS_ALERT_DIALOG, false);
    boolean alert_v7_dialog = evaluator.extendsClass(node, CLASS_ALERT_V7_DIALOG, false);

    if (!alert_v7_dialog && !alert_dialog && !autopoint_dialog) {
        context.report(ISSUE_DIALOG, node, context.getLocation(node),
                String.format("%s do not support auto point,should extends DDDialog", node.toString()));
    }
}
 
Example 12
Project: manifold-ij   File: ManAugmentProvider.java   Source Code and License 6 votes vote down vote up
private PsiElement findExtensionMethodNavigationElement( PsiClass extClass, PsiMethod plantedMethod )
{
  PsiMethod[] found = extClass.findMethodsByName( plantedMethod.getName(), false );
  outer:
  for( PsiMethod m : found )
  {
    PsiParameter[] extParams = m.getParameterList().getParameters();
    PsiParameter[] plantedParams = plantedMethod.getParameterList().getParameters();
    if( extParams.length - 1 == plantedParams.length )
    {
      for( int i = 1; i < extParams.length; i++ )
      {
        PsiParameter extParam = extParams[i];
        PsiParameter plantedParam = plantedParams[i - 1];
        PsiType extErased = TypeConversionUtil.erasure( extParam.getType() );
        PsiType plantedErased = TypeConversionUtil.erasure( plantedParam.getType() );
        if( !extErased.toString().equals( plantedErased.toString() ) )
        {
          continue outer;
        }
      }
      return m.getNavigationElement();
    }
  }
  return null;
}
 
Example 13
Project: intellij-plugin   File: ClassCompletionResolver.java   Source Code and License 6 votes vote down vote up
@Override
public Stream<LookupElementBuilder> resolveCompletions(String propertyName, PsiType psiType) {
    PsiType[] parameters = ((PsiClassReferenceType) psiType).getParameters();
    Stream<PsiClass> psiClassStream = null;
    if (parameters.length == 1 && parameters[0] instanceof PsiWildcardType) {
        PsiWildcardType psiWildcardType = ((PsiWildcardType) parameters[0]);
        if (psiWildcardType.isBounded()) {
            if (psiWildcardType.isExtends()) {
                psiClassStream = subClasses((PsiClassType) psiWildcardType.getExtendsBound()).stream();
            } else if (psiWildcardType.isSuper()) {
                psiClassStream = superClasses((PsiClassType) psiWildcardType.getSuperBound()).stream();
            }
        }
    }
    if (psiClassStream != null) {
        return psiClassStream.map(this::buildClassLookup).filter(Optional::isPresent).map(Optional::get);
    } else {
        return Stream.empty();
    }
}
 
Example 14
Project: manifold-ij   File: MoveTypeManifoldFileProcessor.java   Source Code and License 6 votes vote down vote up
@Nullable
@Override
public List<UsageInfo> findUsages( PsiFile psiFile, PsiDirectory newParent, boolean searchInComments, boolean searchInNonJavaFiles )
{
  Module mod = ModuleUtilCore.findModuleForPsiElement( psiFile );
  ManModule module = ManProject.getModule( mod );
  PsiClass psiClass = findPsiClass( psiFile );
  if( psiClass == null )
  {
    return Collections.emptyList();
  }

  Query<PsiReference> search = ReferencesSearch.search( psiClass, GlobalSearchScope.moduleWithDependenciesAndLibrariesScope( module.getIjModule() ) );
  List<UsageInfo> usages = new ArrayList<>();
  for( PsiReference ref: search.findAll() )
  {
    usages.add( new MoveRenameUsageInfo( ref.getElement(), ref, ref.getRangeInElement().getStartOffset(),
      ref.getRangeInElement().getEndOffset(), psiClass,
      ref.resolve() == null && !(ref instanceof PsiPolyVariantReference && ((PsiPolyVariantReference)ref).multiResolve( true ).length > 0) ) );
  }
  return usages;
}
 
Example 15
Project: manifold-ij   File: ExtensionMethodUsageSearcher.java   Source Code and License 5 votes vote down vote up
@NotNull
private String getExtendedFqn( PsiClass extensionClass )
{
  String fqn = extensionClass.getQualifiedName();
  int iExt = fqn.indexOf( ExtensionManifold.EXTENSIONS_PACKAGE + '.' );
  fqn = fqn.substring( iExt + ExtensionManifold.EXTENSIONS_PACKAGE.length() + 1 );
  fqn = fqn.substring( 0, fqn.lastIndexOf( '.' ) );
  return fqn;
}
 
Example 16
Project: GitHub   File: InvalidR2UsageDetector.java   Source Code and License 5 votes vote down vote up
@Override public JavaElementVisitor createPsiVisitor(final JavaContext context) {
  return new JavaElementVisitor() {
    @Override public void visitClass(PsiClass node) {
      node.accept(new R2UsageVisitor(context));
    }
  };
}
 
Example 17
Project: GitHub   File: WrongTimberUsageDetector.java   Source Code and License 5 votes vote down vote up
private static boolean isSubclassOf(JavaContext context, UExpression expression, Class<?> cls) {
  PsiType expressionType = expression.getExpressionType();
  if (expressionType instanceof PsiClassType) {
    PsiClassType classType = (PsiClassType) expressionType;
    PsiClass resolvedClass = classType.resolve();
    return context.getEvaluator().extendsClass(resolvedClass, cls.getName(), false);
  }
  return false;
}
 
Example 18
Project: data-mediator   File: PsiUtils.java   Source Code and License 5 votes vote down vote up
static boolean hasSelectable(PsiClass psiClass){
    PsiClassType[] listTypes = psiClass.getExtendsListTypes();
    for(PsiClassType type : listTypes){
        PsiClass superPsiClass = type.resolve();
        if (superPsiClass != null && NAME_SELECTABLE.equals(superPsiClass.getQualifiedName())) {
            return true;
        }
    }
    return false;
}
 
Example 19
Project: manifold-ij   File: TypeUtil.java   Source Code and License 5 votes vote down vote up
public static boolean isStructurallyAssignable_Laxed( PsiClass toType, PsiClass fromType, TypeVarToTypeMap inferenceMap, boolean structural )
{
  if( fromType == PsiType.NULL )
  {
    return true;
  }

  List<Pair<PsiMethod, PsiSubstitutor>> toMethods = toType.getAllMethodsAndTheirSubstitutors();

  inferenceMap.setStructural( true );

  for( Pair<PsiMethod, PsiSubstitutor> pair : toMethods )
  {
    PsiMethod toMi = pair.getFirst();
    if( isObjectMethod( toMi ) )
    {
      continue;
    }
    if( toMi.getContainingClass().getModifierList().findAnnotation( "manifold.ext.ExtensionMethod" ) != null )
    {
      continue;
    }
    if( toMi.hasModifierProperty( PsiModifier.DEFAULT ) || toMi.hasModifierProperty( PsiModifier.STATIC ) )
    {
      continue;
    }
    PsiMethod fromMi = findAssignableMethod( structural, fromType, toMi, inferenceMap );
    if( fromMi == null )
    {
      return false;
    }
  }
  return true;
}
 
Example 20
Project: manifold-ij   File: TypeUtil.java   Source Code and License 5 votes vote down vote up
private static PsiClass getBoundingType( PsiTypeParameter tp )
{
  PsiReferenceList extendsList = tp.getExtendsList();
  PsiClassType[] referencedTypes = extendsList.getReferencedTypes();
  if( referencedTypes.length > 0 )
  {
    return referencedTypes[0].resolve();
  }
  return ClassUtil.findPsiClass( tp.getManager(), Object.class.getName() );
}
 
Example 21
Project: manifold-ij   File: TypeUtil.java   Source Code and License 5 votes vote down vote up
private static PsiClass type( PsiType psiType )
{
  if( psiType instanceof PsiClassType )
  {
    return ((PsiClassType)psiType).resolve();
  }
  return null;
}
 
Example 22
Project: intellij-plugin   File: InterfaceNode.java   Source Code and License 5 votes vote down vote up
public InterfaceNode(SeedStackSimpleNode parent, PsiClass psiInterface) {
    super(parent);
    if (!psiInterface.isInterface()) {
        throw new IllegalArgumentException("PsiClass " + psiInterface + " is not an interface");
    }
    this.psiInterface = psiInterface;
    setIcon(getInterfaceIcon());
}
 
Example 23
Project: GitHub   File: Processor.java   Source Code and License 5 votes vote down vote up
protected void generateGetterAndSetter(PsiElementFactory factory, PsiClass cls, ClassEntity classEntity) {

        if (Config.getInstant().isFieldPrivateMode()) {
            for (FieldEntity field : classEntity.getFields()) {
                createGetAndSetMethod(factory, cls, field);
            }
        }
    }
 
Example 24
Project: manifold-ij   File: RenameTypeManifoldFileProcessor.java   Source Code and License 5 votes vote down vote up
@Nullable
private PsiClass findPsiClass( @NotNull PsiFileSystemItem element, ManModule module )
{
  String[] fqns = module.getTypesForFile( FileUtil.toIFile( module.getProject(), element.getVirtualFile() ) );
  PsiClass psiClass = null;
  for( String fqn: fqns )
  {
    psiClass = ManifoldPsiClassCache.instance().getPsiClass( GlobalSearchScope.moduleWithDependenciesAndLibrariesScope( module.getIjModule() ), module, fqn );
    if( psiClass != null )
    {
      break;
    }
  }
  return psiClass;
}
 
Example 25
Project: CodeGen   File: PsiUtil.java   Source Code and License 5 votes vote down vote up
/**
 * 获取当前焦点下的类
 * @param anActionEvent
 * @return
 */
public static PsiClass getPsiClass(AnActionEvent anActionEvent) {

    PsiFile psiFile = anActionEvent.getData(LangDataKeys.PSI_FILE);
    Editor editor = anActionEvent.getData(PlatformDataKeys.EDITOR);

    if (psiFile == null || editor == null) {
        return null;
    }

    int offset = editor.getCaretModel().getOffset();
    PsiElement element = psiFile.findElementAt(offset);

    return PsiTreeUtil.getParentOfType(element, PsiClass.class);
}
 
Example 26
Project: intellij-plugin   File: ToolNode.java   Source Code and License 5 votes vote down vote up
private String buildName(PsiClass psiClass) {
    String simpleName = psiClass.getName();
    if (simpleName != null) {
        return humanizeString(simpleName, "Tool");
    } else {
        throw new IllegalStateException("Tool PsiClass has no name");
    }
}
 
Example 27
Project: intellij-plugin   File: CoffigResolver.java   Source Code and License 5 votes vote down vote up
private Optional<PsiClass> toPsiClass(PsiType psiType) {
    if (psiType instanceof PsiClassType) {
        PsiClass psiClass = ((PsiClassType) psiType).resolve();
        if (psiClass != null && !psiClass.isEnum() && !directlyMappable.contains(psiClass.getQualifiedName())) {
            return Optional.of(psiClass);
        }
    }
    return Optional.empty();
}
 
Example 28
Project: GitHub   File: DataWriter.java   Source Code and License 5 votes vote down vote up
public DataWriter(PsiFile file, Project project, PsiClass cls) {
    super(project, file);
    factory = JavaPsiFacade.getElementFactory(project);
    this.file = file;
    this.project = project;
    this.cls = cls;
}
 
Example 29
Project: manifold-ij   File: StubBuilder.java   Source Code and License 5 votes vote down vote up
public SrcClass make( String fqn, ManModule module )
{
   JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance( module.getIjProject() );
   PsiClass psiClass = javaPsiFacade.findClass( fqn, GlobalSearchScope.moduleScope( module.getIjModule() ) );
   if( psiClass == null )
   {
     psiClass = javaPsiFacade.findClass( fqn, GlobalSearchScope.allScope( module.getIjProject() ) );
   }
  return makeSrcClass( fqn, psiClass, module );
}
 
Example 30
Project: intellij-plugin   File: ResourceNode.java   Source Code and License 5 votes vote down vote up
private PsiAnnotation getPathAnnotation(PsiClass pathAnnotationClass, @NotNull PsiModifierListOwner psiModifierListOwner) {
    return Optional.ofNullable(psiModifierListOwner.getModifierList())
            .map(PsiAnnotationOwner::getAnnotations)
            .map(Arrays::stream)
            .map(stream -> stream.filter(annotation -> Optional.ofNullable(annotation.getNameReferenceElement())
                    .map(PsiReference::resolve)
                    .map(psiElement -> psiElement == pathAnnotationClass)
                    .orElse(false)
            ))
            .flatMap(Stream::findFirst)
            .orElse(null);
}
 
Example 31
Project: intellij-plugin   File: CoffigResolver.java   Source Code and License 5 votes vote down vote up
@NotNull
private Match buildMatch(@NotNull String[] path, int lastIndex, PsiClass matchClass) {
    return new Match(
            context,
            matchClass,
            path[lastIndex - 1],
            String.join(".", Arrays.copyOfRange(path, 0, lastIndex)),
            String.join(".", Arrays.copyOfRange(path, lastIndex, path.length)));
}
 
Example 32
Project: manifold-ij   File: TypeUtil.java   Source Code and License 5 votes vote down vote up
public static boolean isStructurallyAssignable( PsiClass toType, PsiClass fromType, boolean structural )
{
  if( toType == null || fromType == null )
  {
    return false;
  }

  TypeVarToTypeMap inferenceMap = new TypeVarToTypeMap();
  return isStructurallyAssignable( toType, fromType, inferenceMap, structural );
}
 
Example 33
Project: CodeGenerate   File: JsonDialog.java   Source Code and License 5 votes vote down vote up
public JsonDialog(PsiClass cls, PsiFile file, Project project) throws HeadlessException {
    this.cls = cls;
    this.file = file;
    this.project = project;
    setContentPane(contentPane2);
    setTitle("GsonFormat");
    getRootPane().setDefaultButton(okButton);
    this.setAlwaysOnTop(true);
    initGeneratePanel(file);
    initListener();
    fa = this;
}
 
Example 34
Project: CodeGen   File: PsiUtil.java   Source Code and License 5 votes vote down vote up
/**
 * 类选择器
 * @param project
 * @param defaultClass
 * @return
 */
public static PsiClass chooseClass(Project project, PsiClass defaultClass) {
    TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project)
            .createProjectScopeChooser("Select a class", defaultClass);
    chooser.showDialog();
    return chooser.getSelected();
}
 
Example 35
Project: Android_Lint_SRP_Practice_Example   File: SharingGroupClassificationDetector.java   Source Code and License 5 votes vote down vote up
private static void checkedMethod(PsiClass clazz, PsiMethod method) {
    if (!DEBUG_DETAIL) return;

    System.out.println("step -> 3 class=" + clazz.getQualifiedName());
    System.out.println("checked method=" + method.getName());
    System.out.println();
}
 
Example 36
Project: manifold-ij   File: RenameTypeManifoldFileProcessor.java   Source Code and License 5 votes vote down vote up
private boolean isTopLevelClassDeclaration( PsiElement fakeElement )
{
  List<PsiElement> javaElems = ResourceToManifoldUtil.findJavaElementsFor( fakeElement );
  return javaElems.size() == 1 &&
         javaElems.get( 0 ) instanceof PsiClass &&
         ((PsiClass)javaElems.get( 0 )).getContainingClass() == null;
}
 
Example 37
Project: processing-idea   File: ProcessingRunConfigurationEditor.java   Source Code and License 5 votes vote down vote up
private void refreshSketchSelector(Module [] moduleSearchScope) {
    ApplicationManager.getApplication().runWriteAction(() -> {
        Query<PsiClass> classQuery =
                AllClassesSearch.search(ProcessingPluginUtil.INSTANCE.sketchesInModuleScope(moduleSearchScope), project);
        Collection<PsiClass> classesInModule = classQuery.findAll();

        for (PsiClass classInModule : classesInModule) {
            if (SketchClassFilter.isSketchClass(classInModule)) {
                sketchSelector.addItem(new SketchSelectorComboItem(classInModule));
            }
        }
    });
}
 
Example 38
Project: intellij-spring-assistant   File: PsiUtil.java   Source Code and License 5 votes vote down vote up
@NotNull
public static Map<String, PsiMember> findWritableProperties(@Nullable PsiClass psiClass) {
  if (psiClass != null) {
    return CachedValuesManager.getCachedValue(psiClass, () -> CachedValueProvider.Result
        .create(prepareWritableProperties(psiClass), JAVA_STRUCTURE_MODIFICATION_COUNT));
  }
  return Collections.emptyMap();
}
 
Example 39
Project: intellij-plugin   File: CoffigResolver.java   Source Code and License 5 votes vote down vote up
Match(Context context, PsiClass configClass, String name, String matchedPath, String unmatchedPath) {
    this.context = context;
    this.configClass = configClass;
    this.name = name;
    this.matchedPath = matchedPath;
    this.unmatchedPath = unmatchedPath;
    this.fullPath = matchedPath + (!matchedPath.isEmpty() && !unmatchedPath.isEmpty() ? "." : "") + unmatchedPath;
}
 
Example 40
Project: intellij-spring-assistant   File: PsiUtil.java   Source Code and License 5 votes vote down vote up
@Nullable
private static PsiType eraseFreeTypeParameters(@Nullable PsiType psiType,
    @Nullable PsiClass containingClass) {
  if (containingClass == null)
    return null;
  return JavaPsiFacade.getElementFactory(containingClass.getProject())
      .createRawSubstitutor(containingClass).substitute(psiType);
}