Document how fixits on errors and warnings must behave.

Review and wording tweaks by Richard.

llvm-svn: 157953
This commit is contained in:
Nico Weber 2012-06-04 21:56:14 +00:00
parent 3f7c44a131
commit 4d2d33f3ba
1 changed files with 13 additions and 0 deletions

View File

@ -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
&lt;&lt; operator in the same way that highlighted source ranges and