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

Unified Diff: pkg/analysis_server/lib/src/protocol.dart

Issue 537733002: Use typed RefactoringOptions in the Dart version of the protocol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/lib/src/protocol.dart
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
index 779c6ec3bdb9b1a6648729c118f28e822038753d..a6e701a30b42b32afc75f6bd1391f48be116150d 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -396,6 +396,27 @@ OverriddenMember _overriddenMemberFromEngine(engine.Element member) {
/**
+ * Create a [RefactoringOptions] corresponding the given [kind].
+ */
+RefactoringOptions _refactoringOptionsFromJson(JsonDecoder jsonDecoder,
+ String jsonPath, Object json, RefactoringKind kind) {
+ if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) {
+ return new ExtractLocalVariableOptions.fromJson(jsonDecoder, jsonPath, json);
+ }
+ if (kind == RefactoringKind.EXTRACT_METHOD) {
+ return new ExtractMethodOptions.fromJson(jsonDecoder, jsonPath, json);
+ }
+ if (kind == RefactoringKind.INLINE_METHOD) {
+ return new InlineMethodOptions.fromJson(jsonDecoder, jsonPath, json);
+ }
+ if (kind == RefactoringKind.RENAME) {
+ return new RenameOptions.fromJson(jsonDecoder, jsonPath, json);
+ }
+ return null;
+}
+
+
+/**
* Create a SearchResultKind based on a value from the search engine.
*/
SearchResultKind _searchResultKindFromEngine(engine.MatchKind kind) {

Powered by Google App Engine
This is Rietveld 408576698