use of com.perl5.lang.perl.psi.impl.PerlBuiltInVariable in project Perl5-IDEA by Camelcade.
the class PerlVariableShadowingInspection method checkDeclaration.
@Override
public void checkDeclaration(ProblemsHolder holder, PerlVariableDeclarationElement variableDeclarationWrapper) {
PerlVariable variable = variableDeclarationWrapper.getVariable();
PsiElement declarationContainer = variableDeclarationWrapper.getParent();
if (variable != null && !(declarationContainer instanceof PsiPerlVariableDeclarationLocal)) {
PerlVariableDeclarationElement lexicalDeclaration = PerlResolveUtil.getLexicalDeclaration(variable);
if (lexicalDeclaration instanceof PerlBuiltInVariable) {
registerProblem(holder, variable, PerlBundle.message("perl.inspection.shadows.builtin", lexicalDeclaration.getVariable().getLineNumber()));
} else if (lexicalDeclaration instanceof PerlImplicitVariableDeclaration) {
registerProblem(holder, variable, PerlBundle.message("perl.inspection.shadows.implicit", lexicalDeclaration.getVariable().getLineNumber()));
} else if (lexicalDeclaration != null) {
registerProblem(holder, variable, PerlBundle.message("perl.inspection.shadows.other", lexicalDeclaration.getVariable().getLineNumber()));
}
}
}
Aggregations