Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: pkg/analysis_server/doc/api.html

Issue 809213003: Add format API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add handler hook and missed classes Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html><head> 1 <html><head>
2 <meta charset="UTF-8"> 2 <meta charset="UTF-8">
3 <title>Analysis Server API Specification</title> 3 <title>Analysis Server API Specification</title>
4 <style>body { 4 <style>body {
5 font-family: sans-serif, serif; 5 font-family: sans-serif, serif;
6 padding-left: 5%; 6 padding-left: 5%;
7 padding-right: 5%; 7 padding-right: 5%;
8 } 8 }
9 h1 { 9 h1 {
10 text-align: center; 10 text-align: center;
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 <h2 class="domain"><a name="domain_edit">Domain: edit</a></h2> 1409 <h2 class="domain"><a name="domain_edit">Domain: edit</a></h2>
1410 <p> 1410 <p>
1411 The edit domain contains commands related to edits that can be 1411 The edit domain contains commands related to edits that can be
1412 applied to the code. 1412 applied to the code.
1413 </p> 1413 </p>
1414 1414
1415 1415
1416 1416
1417 1417
1418 1418
1419 <h3>Requests</h3><dl><dt class="request">edit.getAssists</dt><dd><div class= "box"><pre>request: { 1419
1420 <h3>Requests</h3><dl><dt class="request">edit.format</dt><dd><div class="box "><pre>request: {
1421 "id": String
1422 "method": "edit.format"
1423 "params": {
1424 "<b>file</b>": <a href="#type_FilePath">FilePath</a>
1425 "<b>selectionOffset</b>": int
1426 "<b>selectionLength</b>": int
1427 }
1428 }</pre><br><pre>response: {
1429 "id": String
1430 "error": <span style="color:#999999">optional</span> <a href="#type_RequestErr or">RequestError</a>
1431 "result": {
1432 "<b>edits</b>": List&lt;<a href="#type_SourceEdit">SourceEdit</a>&gt;
1433 "<b>selectionOffset</b>": int
1434 "<b>selectionLength</b>": int
1435 }
1436 }</pre></div>
1437 <p>
1438 Format the contents of a single file. The currently selected region of
1439 text is passed in so that the selection can be preserved across the
1440 formatting operation. The updated selection will be as close to
1441 matching the original as possible, but whitespace at the beginning or
1442 end of the selected region will be ignored.
1443 </p>
1444
1445
1446 <h4>Parameters</h4><dl><dt class="field"><b><i>file ( <a href="#type_FileP ath">FilePath</a> )</i></b></dt><dd>
1447
1448 <p>
1449 The file containing the code to be formatted.
1450 </p>
1451 </dd><dt class="field"><b><i>selectionOffset ( int )</i></b></dt><dd>
1452
1453 <p>
1454 The offset of the current selection in the file.
1455 </p>
1456 </dd><dt class="field"><b><i>selectionLength ( int )</i></b></dt><dd>
1457
1458 <p>
1459 The length of the current selection in the file.
1460 </p>
1461 </dd></dl><h4>Returns</h4><dl><dt class="field"><b><i>edits ( List&lt; <a href="#type_SourceEdit">SourceEdit</a>&gt; )</i></b></dt><dd>
1462
1463 <p>
1464 The edit(s) to be applied in order to format the code. The list
1465 will be empty if the code was already formatted (there are no
1466 changes).
1467 </p>
1468 </dd><dt class="field"><b><i>selectionOffset ( int )</i></b></dt><dd>
1469
1470 <p>
1471 The offset of the selection after formatting the code.
1472 </p>
1473 </dd><dt class="field"><b><i>selectionLength ( int )</i></b></dt><dd>
1474
1475 <p>
1476 The length of the selection after formatting the code.
1477 </p>
1478 </dd></dl></dd><dt class="request">edit.getAssists</dt><dd><div class= "box"><pre>request: {
1420 "id": String 1479 "id": String
1421 "method": "edit.getAssists" 1480 "method": "edit.getAssists"
1422 "params": { 1481 "params": {
1423 "<b>file</b>": <a href="#type_FilePath">FilePath</a> 1482 "<b>file</b>": <a href="#type_FilePath">FilePath</a>
1424 "<b>offset</b>": int 1483 "<b>offset</b>": int
1425 "<b>length</b>": int 1484 "<b>length</b>": int
1426 } 1485 }
1427 }</pre><br><pre>response: { 1486 }</pre><br><pre>response: {
1428 "id": String 1487 "id": String
1429 "error": <span style="color:#999999">optional</span> <a href="#type_RequestErr or">RequestError</a> 1488 "error": <span style="color:#999999">optional</span> <a href="#type_RequestErr or">RequestError</a>
(...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after
3533 <p> 3592 <p>
3534 This section contains a list of all of the errors that are 3593 This section contains a list of all of the errors that are
3535 produced by the server and the data that is returned with each. 3594 produced by the server and the data that is returned with each.
3536 </p> 3595 </p>
3537 <p> 3596 <p>
3538 TBD 3597 TBD
3539 </p> 3598 </p>
3540 3599
3541 3600
3542 </body></html> 3601 </body></html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698