OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:html'; | 5 import 'dart:html'; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'package:observatory/models.dart' as M; | 7 import 'package:observatory/models.dart' as M; |
8 import 'package:observatory/src/elements/curly_block.dart'; | 8 import 'package:observatory/src/elements/curly_block.dart'; |
9 import 'package:observatory/src/elements/instance_ref.dart'; | 9 import 'package:observatory/src/elements/instance_ref.dart'; |
10 import 'package:observatory/src/elements/helpers/any_ref.dart'; | 10 import 'package:observatory/src/elements/helpers/any_ref.dart'; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 return const []; | 86 return const []; |
87 } | 87 } |
88 return _inbounds.elements.map(_createItem).toList(); | 88 return _inbounds.elements.map(_createItem).toList(); |
89 } | 89 } |
90 | 90 |
91 Element _createItem(M.InboundReference reference) { | 91 Element _createItem(M.InboundReference reference) { |
92 final content = <Element>[]; | 92 final content = <Element>[]; |
93 | 93 |
94 if (reference.parentField != null) { | 94 if (reference.parentField != null) { |
95 content.addAll([ | 95 content.addAll([ |
96 new SpanElement()..text = 'from ', | 96 new SpanElement()..text = 'referenced by ', |
97 anyRef(_isolate, reference.parentField, _instances, queue: _r.queue), | 97 anyRef(_isolate, reference.parentField, _instances, queue: _r.queue), |
98 new SpanElement()..text = ' of ' | 98 new SpanElement()..text = ' of ' |
99 ]); | 99 ]); |
100 } else if (reference.parentListIndex != null) { | 100 } else if (reference.parentListIndex != null) { |
101 content.add(new SpanElement() | 101 content.add(new SpanElement() |
102 ..text = 'from [ ${reference.parentListIndex} ] of '); | 102 ..text = 'referenced by [ ${reference.parentListIndex} ] of '); |
103 } else if (reference.parentWordOffset != null) { | 103 } else if (reference.parentWordOffset != null) { |
104 content.add(new SpanElement() | 104 content.add(new SpanElement() |
105 ..text = 'from word [ ${reference.parentWordOffset} ] of '); | 105 ..text = 'referenced by offset ${reference.parentWordOffset} of '); |
106 } | 106 } |
107 | 107 |
108 content.addAll([ | 108 content.addAll([ |
109 anyRef(_isolate, reference.source, _instances, queue: _r.queue), | 109 anyRef(_isolate, reference.source, _instances, queue: _r.queue), |
110 new SpanElement()..text = ' referenced by ', | |
111 new InboundReferencesElement( | 110 new InboundReferencesElement( |
112 _isolate, reference.source, _references, _instances, | 111 _isolate, reference.source, _references, _instances, |
113 queue: _r.queue) | 112 queue: _r.queue) |
114 ]); | 113 ]); |
115 | 114 |
116 return new DivElement() | 115 return new DivElement() |
117 ..classes = ['indent'] | 116 ..classes = ['indent'] |
118 ..children = content; | 117 ..children = content; |
119 } | 118 } |
120 } | 119 } |
OLD | NEW |