docs: public static SuggestedFix renameVariable(
        VariableTree tree, final String replacement, VisitorState state) {
      String name = tree.getName().toString();
      int typeEndPos = state.getEndPosition(tree.getType());
      // handle implicit lambda parameter types
      int searchOffset = typeEndPos == -1 ? 0 : (typeEndPos - ((JCTree) tree).getStartPosition());
      int pos =
          ((JCTree) tree).getStartPosition()
              + state.getSourceForNode(tree).indexOf(name, searchOffset);
      final SuggestedFix.Builder fix =
          SuggestedFix.builder().replace(pos, pos + name.length(), replacement);
      final Symbol.VarSymbol sym = getSymbol(tree);
      ((JCTree) state.getPath().getCompilationUnit())
          .accept(
              new TreeScanner() {
                @Override
                public void visitIdent(JCTree.JCIdent tree) {
                  if (sym.equals(getSymbol(tree))) {
                    fix.replace(tree, replacement);
                  }
                }
  
                @Override
                public void visitSelect(JCTree.JCFieldAccess tree) {
                  if (sym.equals(getSymbol(tree))) {
                    fix.replace(
                        state.getEndPosition(tree.getExpression()),
                        state.getEndPosition(tree),
                        "." + replacement);
                  }
                  super.visitSelect(tree);
                }
              });
      return fix.build();
    }