Index: runtime/observatory/lib/src/elements/code_ref.dart |
diff --git a/runtime/observatory/lib/src/elements/code_ref.dart b/runtime/observatory/lib/src/elements/code_ref.dart |
index 488bebcc126b549753a49b9d91784e4c2a4a8239..88464de426d04d525db999f020ed31e18ff6873d 100644 |
--- a/runtime/observatory/lib/src/elements/code_ref.dart |
+++ b/runtime/observatory/lib/src/elements/code_ref.dart |
@@ -10,12 +10,25 @@ import 'package:observatory/service.dart'; |
@CustomTag('code-ref') |
class CodeRefElement extends ServiceRefElement { |
- @observable Code get code => ref; |
+ CodeRefElement.created() : super.created(); |
+ |
+ Code get code => ref; |
refChanged(oldValue) { |
super.refChanged(oldValue); |
- notifyPropertyChange(#code, 0, 1); |
+ _updateShadowDom(); |
} |
- CodeRefElement.created() : super.created(); |
+ void _updateShadowDom() { |
+ clearShadowRoot(); |
+ if (code == null) { |
+ return; |
+ } |
+ var name = (code.isOptimized ? '*' : '') + code.name; |
+ if (code.isDartCode) { |
+ insertLinkIntoShadowRoot(name, url, hoverText); |
+ } else { |
+ insertTextSpanIntoShadowRoot(name); |
+ } |
+ } |
} |