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

Unified Diff: pkg/analysis_server/tool/spec/spec_input.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
« no previous file with comments | « pkg/analysis_server/test/integration/protocol_matchers.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/tool/spec/spec_input.html
diff --git a/pkg/analysis_server/tool/spec/spec_input.html b/pkg/analysis_server/tool/spec/spec_input.html
index e09c9e3e3678e48234b21677b71e9324ed658642..8d16874c3b3d8731e520110c4263b5a7f2122870 100644
--- a/pkg/analysis_server/tool/spec/spec_input.html
+++ b/pkg/analysis_server/tool/spec/spec_input.html
@@ -1216,6 +1216,67 @@
The edit domain contains commands related to edits that can be
applied to the code.
</p>
+ <request method="format">
+ <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>
+ <params>
+ <field name="file">
+ <ref>FilePath</ref>
+ <p>
+ The file containing the code to be formatted.
+ </p>
+ </field>
+ <field name="selectionOffset">
+ <ref>int</ref>
+ <p>
+ The offset of the current selection in the file.
+ </p>
+ </field>
+ <field name="selectionLength">
+ <ref>int</ref>
+ <p>
+ The length of the current selection in the file.
+ </p>
+ </field>
+ <!--
+ <field name="selectionOnly" optional="true">
+ <ref>bool</ref>
+ <p>
+ True if the code to be formatted should be limited to the selected
+ text (or the smallest portion of text that encloses the selected
+ text that can be formatted).
+ </p>
+ </field>
+ -->
+ </params>
+ <result>
+ <field name="edits">
+ <list><ref>SourceEdit</ref></list>
+ <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>
+ </field>
+ <field name="selectionOffset">
+ <ref>int</ref>
+ <p>
+ The offset of the selection after formatting the code.
+ </p>
+ </field>
+ <field name="selectionLength">
+ <ref>int</ref>
+ <p>
+ The length of the selection after formatting the code.
+ </p>
+ </field>
+ </result>
+ </request>
<request method="getAssists">
<p>
Return the set of assists that are available at the given
« no previous file with comments | « pkg/analysis_server/test/integration/protocol_matchers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698