Search in sources :

Example 21 with PerlVariableDeclarationElement

use of com.perl5.lang.perl.psi.PerlVariableDeclarationElement in project Perl5-IDEA by Camelcade.

the class MasonCoreUtil method fillVariablesList.

public static void fillVariablesList(PsiElement parent, List<PerlVariableDeclarationElement> targetList, List<VariableDescription> sourceList) {
    for (VariableDescription variableDescription : sourceList) {
        String variableType = variableDescription.variableType;
        if (StringUtil.isEmpty(variableType)) {
            variableType = null;
        }
        targetList.add(PerlImplicitVariableDeclaration.createGlobal(parent, variableDescription.variableName, variableType));
    }
}
Also used : VariableDescription(com.perl5.lang.mason2.idea.configuration.VariableDescription)

Aggregations

PsiElement (com.intellij.psi.PsiElement)12 PerlVariableDeclarationElement (com.perl5.lang.perl.psi.PerlVariableDeclarationElement)10 NotNull (org.jetbrains.annotations.NotNull)10 PerlVariable (com.perl5.lang.perl.psi.PerlVariable)6 PerlVariableType (com.perl5.lang.perl.psi.utils.PerlVariableType)6 PerlLexicalScope (com.perl5.lang.perl.psi.properties.PerlLexicalScope)5 Project (com.intellij.openapi.project.Project)4 CompletionResultSet (com.intellij.codeInsight.completion.CompletionResultSet)3 LookupElementBuilder (com.intellij.codeInsight.lookup.LookupElementBuilder)3 StringUtil (com.intellij.openapi.util.text.StringUtil)3 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)3 PerlExportDescriptor (com.perl5.lang.perl.extensions.packageprocessor.PerlExportDescriptor)3 com.perl5.lang.perl.psi (com.perl5.lang.perl.psi)3 PerlImplicitVariableDeclaration (com.perl5.lang.perl.psi.impl.PerlImplicitVariableDeclaration)3 LookupElement (com.intellij.codeInsight.lookup.LookupElement)2 PsiFile (com.intellij.psi.PsiFile)2 LeafPsiElement (com.intellij.psi.impl.source.tree.LeafPsiElement)2 PsiScopeProcessor (com.intellij.psi.scope.PsiScopeProcessor)2 PsiTreeUtil (com.intellij.psi.util.PsiTreeUtil)2 PerlIcons (com.perl5.PerlIcons)2