class RenameOccurrences

Declaration

class RenameOccurrences : public SourceChangeRefactoringRule { /* full declaration omitted */ };

Description

A type of refactoring action rule that produces source replacements in the form of atomic changes. This action rule is typically used for local refactorings that replace source in a single AST unit.

Declared at: clang/include/clang/Tooling/Refactoring/Rename/RenamingAction.h:48

Inherits from: SourceChangeRefactoringRule

Member Variables

private const clang::NamedDecl* ND
private std::string NewName

Method Overview

  • private RenameOccurrences(const clang::NamedDecl * ND, std::string NewName)
  • private Expected<clang::tooling::AtomicChanges> createSourceReplacements(clang::tooling::RefactoringRuleContext & Context)
  • public static const clang::tooling::RefactoringDescriptor & describe()
  • public const clang::NamedDecl * getRenameDecl() const
  • public static Expected<clang::tooling::RenameOccurrences> initiate(clang::tooling::RefactoringRuleContext & Context, clang::SourceRange SelectionRange, std::string NewName)

Inherited from SourceChangeRefactoringRule:

Inherited from RefactoringActionRuleBase:

Methods

RenameOccurrences(const clang::NamedDecl* ND,
                  std::string NewName)

Declared at: clang/include/clang/Tooling/Refactoring/Rename/RenamingAction.h:59

Parameters

const clang::NamedDecl* ND
std::string NewName

Expected<clang::tooling::AtomicChanges>
createSourceReplacements(
    clang::tooling::RefactoringRuleContext&
        Context)

Declared at: clang/include/clang/Tooling/Refactoring/Rename/RenamingAction.h:63

Parameters

clang::tooling::RefactoringRuleContext& Context

static const clang::tooling::
    RefactoringDescriptor&
    describe()

Declared at: clang/include/clang/Tooling/Refactoring/Rename/RenamingAction.h:54

const clang::NamedDecl* getRenameDecl() const

Declared at: clang/include/clang/Tooling/Refactoring/Rename/RenamingAction.h:56

static Expected<clang::tooling::RenameOccurrences>
initiate(clang::tooling::RefactoringRuleContext&
             Context,
         clang::SourceRange SelectionRange,
         std::string NewName)

Declared at: clang/include/clang/Tooling/Refactoring/Rename/RenamingAction.h:50

Parameters

clang::tooling::RefactoringRuleContext& Context
clang::SourceRange SelectionRange
std::string NewName