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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/doc/api.html
diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html
index fb5deb149067e993b5bb0976024ba71d70b38171..037bb8445dff74177d5c6ae7179e25118ce8822d 100644
--- a/pkg/analysis_server/doc/api.html
+++ b/pkg/analysis_server/doc/api.html
@@ -1416,7 +1416,66 @@ dt.typeDefinition {
- <h3>Requests</h3><dl><dt class="request">edit.getAssists</dt><dd><div class="box"><pre>request: {
+
+ <h3>Requests</h3><dl><dt class="request">edit.format</dt><dd><div class="box"><pre>request: {
+ "id": String
+ "method": "edit.format"
+ "params": {
+ "<b>file</b>": <a href="#type_FilePath">FilePath</a>
+ "<b>selectionOffset</b>": int
+ "<b>selectionLength</b>": int
+ }
+}</pre><br><pre>response: {
+ "id": String
+ "error": <span style="color:#999999">optional</span> <a href="#type_RequestError">RequestError</a>
+ "result": {
+ "<b>edits</b>": List&lt;<a href="#type_SourceEdit">SourceEdit</a>&gt;
+ "<b>selectionOffset</b>": int
+ "<b>selectionLength</b>": int
+ }
+}</pre></div>
+ <p>
+ Format the contents of a single file. The currently selected region of
+ text is passed in so that the selection can be preserved across the
+ formatting operation. The updated selection will be as close to
+ matching the original as possible, but whitespace at the beginning or
+ end of the selected region will be ignored.
+ </p>
+
+
+ <h4>Parameters</h4><dl><dt class="field"><b><i>file ( <a href="#type_FilePath">FilePath</a> )</i></b></dt><dd>
+
+ <p>
+ The file containing the code to be formatted.
+ </p>
+ </dd><dt class="field"><b><i>selectionOffset ( int )</i></b></dt><dd>
+
+ <p>
+ The offset of the current selection in the file.
+ </p>
+ </dd><dt class="field"><b><i>selectionLength ( int )</i></b></dt><dd>
+
+ <p>
+ The length of the current selection in the file.
+ </p>
+ </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>
+
+ <p>
+ The edit(s) to be applied in order to format the code. The list
+ will be empty if the code was already formatted (there are no
+ changes).
+ </p>
+ </dd><dt class="field"><b><i>selectionOffset ( int )</i></b></dt><dd>
+
+ <p>
+ The offset of the selection after formatting the code.
+ </p>
+ </dd><dt class="field"><b><i>selectionLength ( int )</i></b></dt><dd>
+
+ <p>
+ The length of the selection after formatting the code.
+ </p>
+ </dd></dl></dd><dt class="request">edit.getAssists</dt><dd><div class="box"><pre>request: {
"id": String
"method": "edit.getAssists"
"params": {

Powered by Google App Engine
This is Rietveld 408576698