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

Unified Diff: pkg/analysis_server/lib/src/computer/computer_occurrences.dart

Issue 389413002: Use HasToJson when set Reponse/Notification parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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/computer/computer_occurrences.dart
diff --git a/pkg/analysis_server/lib/src/computer/computer_occurrences.dart b/pkg/analysis_server/lib/src/computer/computer_occurrences.dart
index 4e36665481caf32f8bccf713160ce7fe1ed298bc..35ebece9e9ad4ae9b05a73b3489729d977d2ea0f 100644
--- a/pkg/analysis_server/lib/src/computer/computer_occurrences.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_occurrences.dart
@@ -6,6 +6,7 @@ library computer.occurrences;
import 'dart:collection';
+import 'package:analysis_server/src/collections.dart';
import 'package:analysis_server/src/computer/element.dart';
import 'package:analysis_server/src/constants.dart';
import 'package:analyzer/src/generated/ast.dart';
@@ -26,7 +27,7 @@ class DartUnitOccurrencesComputer {
/**
* Returns the computed occurrences, not `null`.
*/
- List<Map<String, Object>> compute() {
+ List<Occurrences> compute() {
_unit.accept(new _DartUnitOccurrencesComputerVisitor(this));
List<Occurrences> occurrences = <Occurrences>[];
_elementsOffsets.forEach((engineElement, offsets) {
@@ -34,7 +35,7 @@ class DartUnitOccurrencesComputer {
int length = engineElement.displayName.length;
occurrences.add(new Occurrences(serverElement, offsets, length));
});
- return occurrences.map((occurrences) => occurrences.toJson()).toList();
+ return occurrences;
}
void _addOccurrence(engine.Element element, int offset) {
@@ -48,7 +49,7 @@ class DartUnitOccurrencesComputer {
}
-class Occurrences {
+class Occurrences implements HasToJson {
final Element element;
final List<int> offsets;
final int length;
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_hover.dart ('k') | pkg/analysis_server/lib/src/computer/computer_outline.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698