Fix clang tool refactoring docs formatting.
Argh... whitespace!
BUG=none
[email protected]
Review URL: https://codereview.chromium.org/1592853003 .
Cr-Commit-Position: refs/heads/master@{#369903}
diff --git a/docs/clang_tool_refactoring.md b/docs/clang_tool_refactoring.md
index 2b6c617..3d9c9ed 100644
--- a/docs/clang_tool_refactoring.md
+++ b/docs/clang_tool_refactoring.md
@@ -118,7 +118,8 @@
```
Then run the actual tool:
-```
+
+```shell
tools/clang/scripts/run_tool.py <toolname> \
--generate-compdb
out/Debug <path 1> <path 2> ...
@@ -140,28 +141,33 @@
## Debugging
Dumping the AST for a file:
+
```shell
clang++ -cc1 -ast-dump foo.cc
```
Using `clang-query` to dynamically test matchers (requires checking out
and building [clang-tools-extras](https://github.com/llvm-mirror/clang-tools-extra)):
+
```shell
clang-query -p path/to/compdb base/memory/ref_counted.cc
```
`printf` debugging:
+
```c++
clang::Decl* decl = result.Nodes.getNodeAs<clang::Decl>("decl");
decl->dumpColor();
clang::Stmt* stmt = result.Nodes.getNodeAs<clang::Stmt>("stmt");
stmt->dumpColor();
```
+
By default, the script hides the output of the tool. The easiest way to change
that is to `return 1` from the `main()` function of the clang tool.
## Testing
Synposis:
+
```shell
test_tool.py <tool name>
```