Search in sources :

Example 1 with SimplifiedClassNameResolver

use of ool.intellij.plugin.psi.reference.innerjs.SimplifiedClassNameResolver in project oxy-template-support-plugin by mutant-industries.

the class ParamSuggestionProvider method compute.

@Nullable
@Override
public Result<MacroParamSuggestionSet> compute() {
    MacroParamSuggestionSet macroParamSuggestions = getMacroParamSuggestions();
    Set<PsiElement> cacheDependencies = new HashSet<>();
    for (MacroParamDescriptor descriptor : macroParamSuggestions) {
        if (descriptor.getType() == null) {
            continue;
        }
        SimplifiedClassNameResolver simplifiedClassNameResolver = new SimplifiedClassNameResolver(macro.getContainingFile());
        descriptor.getType().accept(simplifiedClassNameResolver);
        cacheDependencies.addAll(simplifiedClassNameResolver.getResolvedClassList());
    }
    cacheDependencies.addAll(this.cacheDependencies);
    return Result.create(macroParamSuggestions, cacheDependencies);
}
Also used : MacroParamSuggestionSet(ool.intellij.plugin.psi.macro.param.MacroParamSuggestionSet) MacroParamDescriptor(ool.intellij.plugin.psi.macro.param.descriptor.MacroParamDescriptor) SimplifiedClassNameResolver(ool.intellij.plugin.psi.reference.innerjs.SimplifiedClassNameResolver) PsiElement(com.intellij.psi.PsiElement) HashSet(java.util.HashSet) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

PsiElement (com.intellij.psi.PsiElement)1 HashSet (java.util.HashSet)1 MacroParamSuggestionSet (ool.intellij.plugin.psi.macro.param.MacroParamSuggestionSet)1 MacroParamDescriptor (ool.intellij.plugin.psi.macro.param.descriptor.MacroParamDescriptor)1 SimplifiedClassNameResolver (ool.intellij.plugin.psi.reference.innerjs.SimplifiedClassNameResolver)1 Nullable (org.jetbrains.annotations.Nullable)1