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

Unified Diff: pkg/analysis_server/lib/src/plugin/result_converter.dart

Issue 2879273002: Make server use the common protocol classes (Closed)
Patch Set: Created 3 years, 7 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/plugin/result_converter.dart
diff --git a/pkg/analysis_server/lib/src/plugin/result_converter.dart b/pkg/analysis_server/lib/src/plugin/result_converter.dart
index fe470df6287288e51d981e30e69c8dbdb70a5de3..40a5d2b80351d074a15f8cf902ee4d434b519347 100644
--- a/pkg/analysis_server/lib/src/plugin/result_converter.dart
+++ b/pkg/analysis_server/lib/src/plugin/result_converter.dart
@@ -4,7 +4,7 @@
import 'package:analysis_server/protocol/protocol_generated.dart' as server;
import 'package:analysis_server/src/protocol/protocol_internal.dart' as server;
-import 'package:analyzer_plugin/protocol/protocol_common.dart' as plugin;
+import 'package:analyzer_plugin/protocol/protocol_common.dart';
import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
/**
@@ -18,18 +18,13 @@ class ResultConverter {
static final server.ResponseDecoder decoder =
new server.ResponseDecoder(null);
- server.AnalysisError convertAnalysisError(plugin.AnalysisError error) {
- return new server.AnalysisError.fromJson(decoder, '', error.toJson());
- }
-
server.AnalysisErrorFixes convertAnalysisErrorFixes(
plugin.AnalysisErrorFixes fixes) {
- List<server.SourceChange> changes = fixes.fixes
+ List<SourceChange> changes = fixes.fixes
.map((plugin.PrioritizedSourceChange change) =>
convertPrioritizedSourceChange(change))
.toList();
- return new server.AnalysisErrorFixes(convertAnalysisError(fixes.error),
- fixes: changes);
+ return new server.AnalysisErrorFixes(fixes.error, fixes: changes);
}
server.AnalysisNavigationParams convertAnalysisNavigationParams(
@@ -38,56 +33,14 @@ class ResultConverter {
decoder, '', params.toJson());
}
- server.CompletionSuggestion convertCompletionSuggestion(
- plugin.CompletionSuggestion suggestion) {
- return new server.CompletionSuggestion.fromJson(
- decoder, '', suggestion.toJson());
- }
-
server.EditGetRefactoringResult convertEditGetRefactoringResult(
- plugin.RefactoringKind kind, plugin.EditGetRefactoringResult result) {
+ RefactoringKind kind, plugin.EditGetRefactoringResult result) {
return new server.EditGetRefactoringResult.fromJson(
- new server.ResponseDecoder(convertRefactoringKind(kind)),
- '',
- result.toJson());
- }
-
- server.FoldingRegion convertFoldingRegion(plugin.FoldingRegion region) {
- return new server.FoldingRegion.fromJson(decoder, '', region.toJson());
- }
-
- server.HighlightRegion convertHighlightRegion(plugin.HighlightRegion region) {
- return new server.HighlightRegion.fromJson(decoder, '', region.toJson());
- }
-
- server.Occurrences convertOccurrences(plugin.Occurrences occurrences) {
- return new server.Occurrences.fromJson(decoder, '', occurrences.toJson());
- }
-
- server.Outline convertOutline(plugin.Outline outline) {
- return new server.Outline.fromJson(decoder, '', outline.toJson());
+ new server.ResponseDecoder(kind), '', result.toJson());
}
- server.SourceChange convertPrioritizedSourceChange(
+ SourceChange convertPrioritizedSourceChange(
plugin.PrioritizedSourceChange change) {
- return convertSourceChange(change.change);
- }
-
- server.RefactoringFeedback convertRefactoringFeedback(
- plugin.RefactoringKind kind, plugin.RefactoringFeedback feedback) {
- return new server.RefactoringFeedback.fromJson(
- new server.ResponseDecoder(convertRefactoringKind(kind)),
- '',
- feedback.toJson(),
- null);
- }
-
- server.RefactoringKind convertRefactoringKind(
- plugin.RefactoringKind feedback) {
- return new server.RefactoringKind.fromJson(decoder, '', feedback.toJson());
- }
-
- server.SourceChange convertSourceChange(plugin.SourceChange change) {
- return new server.SourceChange.fromJson(decoder, '', change.toJson());
+ return change.change;
}
}
« no previous file with comments | « pkg/analysis_server/lib/src/plugin/request_converter.dart ('k') | pkg/analysis_server/lib/src/plugin/result_merger.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698