| Index: pkg/analysis_server/lib/src/computer/element.dart
|
| diff --git a/pkg/analysis_server/lib/src/computer/element.dart b/pkg/analysis_server/lib/src/computer/element.dart
|
| index fb9943a1a804b2880ab78a65b7bc44770e3a5398..4ccca7f8c1fbf66bbb78863d6687676da2873343 100644
|
| --- a/pkg/analysis_server/lib/src/computer/element.dart
|
| +++ b/pkg/analysis_server/lib/src/computer/element.dart
|
| @@ -11,6 +11,14 @@ import 'package:analyzer/src/generated/utilities_dart.dart' as engine;
|
|
|
|
|
| /**
|
| + * Returns a JSON correponding to the given Engine element.
|
| + */
|
| +Map<String, Object> engineElementToJson(engine.Element element) {
|
| + return new Element.fromEngine(element).toJson();
|
| +}
|
| +
|
| +
|
| +/**
|
| * Information about an element.
|
| */
|
| class Element {
|
| @@ -354,6 +362,15 @@ class Location {
|
| startColumn);
|
| }
|
|
|
| + factory Location.fromJson(Map<String, Object> map) {
|
| + return new Location(
|
| + map[FILE],
|
| + map[OFFSET],
|
| + map[LENGTH],
|
| + map[START_LINE],
|
| + map[START_COLUMN]);
|
| + }
|
| +
|
| factory Location.fromOffset(engine.Element element, int offset, int length) {
|
| Source source = element.source;
|
| LineInfo lineInfo = element.context.getLineInfo(source);
|
| @@ -370,15 +387,6 @@ class Location {
|
| startColumn);
|
| }
|
|
|
| - factory Location.fromJson(Map<String, Object> map) {
|
| - return new Location(
|
| - map[FILE],
|
| - map[OFFSET],
|
| - map[LENGTH],
|
| - map[START_LINE],
|
| - map[START_COLUMN]);
|
| - }
|
| -
|
| Map<String, Object> toJson() {
|
| return {
|
| FILE: file,
|
|
|