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

Unified Diff: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/AnalysisServer.java

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 | « no previous file | editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/FormatConsumer.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/AnalysisServer.java
diff --git a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/AnalysisServer.java b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/AnalysisServer.java
index 328c9bf4ccf37632f0d249a21688fe52defcd182..3b241ced1a69193d30e89c6a330a81020d815cf9 100644
--- a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/AnalysisServer.java
+++ b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/AnalysisServer.java
@@ -226,6 +226,20 @@ public interface AnalysisServer {
public void completion_getSuggestions(String file, int offset, GetSuggestionsConsumer consumer);
/**
+ * {@code edit.format}
+ *
+ * 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.
+ *
+ * @param file The file containing the code to be formatted.
+ * @param selectionOffset The offset of the current selection in the file.
+ * @param selectionLength The length of the current selection in the file.
+ */
+ public void edit_format(String file, int selectionOffset, int selectionLength, FormatConsumer consumer);
+
+ /**
* {@code edit.getAssists}
*
* Return the set of assists that are available at the given location. An assist is distinguished
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/FormatConsumer.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698