diff options
author | Nico Weber <nicolasweber@gmx.de> | 2012-06-04 21:56:14 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2012-06-04 21:56:14 +0000 |
commit | 8003963a553e51cd03b850e8fa8a7af39c5324ef (patch) | |
tree | 511ef34c763a1c770244277601ed2d2df08b478f | |
parent | 328584e9eddf0ff388b0700b1e865ae046a30a9c (diff) |
Document how fixits on errors and warnings must behave.
Review and wording tweaks by Richard.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157953 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | docs/InternalsManual.html | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/InternalsManual.html b/docs/InternalsManual.html index bd6af8d6c1..1ae1968299 100644 --- a/docs/InternalsManual.html +++ b/docs/InternalsManual.html @@ -441,6 +441,19 @@ href="#DiagnosticClient">Other diagnostic clients</a> might choose to render the code differently (e.g., as markup inline) or even give the user the ability to automatically fix the problem.</p> +<p>Fix-it hints on errors and warnings need to obey these rules:</p> + +<ul> +<li>Since they are automatically applied if <code>-Xclang -fixit</code> +is passed to the driver, they should only be used when it's very likely they +match the user's intent.</li> +<li>Clang must recover from the error or warning as if the fix-it had been +applied.</li> +</ul> + +<p>If a fix-it can't obey these rules, put the fix-it on a note. Fix-its on +notes are not applied automatically.</p> + <p>All fix-it hints are described by the <code>FixItHint</code> class, instances of which should be attached to the diagnostic using the << operator in the same way that highlighted source ranges and |