Search in sources :

Example 1 with com.perl5.lang.perl.psi

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

the class PerlDelegatingLightNamedElement method setName.

@Override
public PsiElement setName(@NonNls @NotNull String newBaseName) throws IncorrectOperationException {
    // fixme should be in com.perl5.lang.perl.psi.utils.PerlPsiUtil.renameElement()
    PsiElement nameIdentifier = getNameIdentifier();
    ElementManipulator<PsiElement> manipulator = ElementManipulators.getManipulator(nameIdentifier);
    TextRange identifierRange = this instanceof PerlIdentifierRangeProvider ? ((PerlIdentifierRangeProvider) this).getRangeInIdentifier() : ElementManipulators.getValueTextRange(nameIdentifier);
    myNameIdentifier = manipulator.handleContentChange(nameIdentifier, identifierRange, newBaseName);
    myName = getNameComputation().fun(newBaseName);
    return this;
}
Also used : TextRange(com.intellij.openapi.util.TextRange) PerlIdentifierRangeProvider(com.perl5.lang.perl.parser.PerlIdentifierRangeProvider)

Aggregations

TextRange (com.intellij.openapi.util.TextRange)1 PerlIdentifierRangeProvider (com.perl5.lang.perl.parser.PerlIdentifierRangeProvider)1