This is an archive of the discontinued LLVM Phabricator instance.

[docs][refactor] Add a new tutorial that talks about how one can implement refactoring actions
Needs ReviewPublic

Authored by arphaman on Oct 17 2017, 5:38 PM.

Details

Summary

This patch adds a new tutorial to Clang's talks that walks through an example of a refactoring action and how it can be implemented in Clang.

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman created this revision.Oct 17 2017, 5:38 PM
hokein edited edge metadata.Oct 18 2017, 6:16 AM

Awesome, thanks for the very well-illustrated tutorial!

docs/RefactoringActionTutorial.rst
7

I'm a bit concerned about this. If we check in this doc before all features are implemented, it probably confuses users.

36

merge the two ifs into just one if?

96

It might be more sensible to provide a repository holding all source code of the sample, so that users can easily build and play around it.

122

s/describes/described

167

An out-of-scope comment: the new code after refactoring may not be equivalent to the original one because of operator precedence.

docs/RefactoringEngine.rst
21

s/a/at

JonasToth added inline comments.
docs/RefactoringActionTutorial.rst
90

Will there be functionality like add-new-check.py in clang-tidy? Maybe we could work on this to ease getting started.

JonasToth added inline comments.Nov 18 2017, 1:16 PM
docs/RefactoringActionTutorial.rst
236

i think the final after the colon should be public instead.

JonasToth added inline comments.Nov 19 2017, 4:08 AM
docs/RefactoringActionTutorial.rst
98–99

The includes are missing Tooling -> clang/Tooling/Refactoring/....

klimek added inline comments.Dec 6 2017, 7:20 AM
docs/RefactoringActionTutorial.rst
7

I'm not too concerned about this. The code is already there, so I believe more docs are better :)

41–42

This looks like an example that's a better fit for clang-tidy?
Perhaps a good example would be replacing all int x, int y parameters to an const Point& parameter or something like that?