@@ -28,8 +28,27 @@ import 'model_utils.dart';
2828import 'package_meta.dart' show PackageMeta, FileContents;
2929import 'utils.dart' show stripComments;
3030
31+ Map <String , Map <String , List <Map <String , dynamic >>>> __crossdartJson;
32+
3133final Map <Class , List <Class >> _implementors = new Map ();
3234
35+ Map <String , Map <String , List <Map <String , dynamic >>>> get _crossdartJson {
36+ if (__crossdartJson == null ) {
37+ if (config != null ) {
38+ var crossdartFile =
39+ new File (p.join (config.inputDir.path, "crossdart.json" ));
40+ if (crossdartFile.existsSync ()) {
41+ __crossdartJson = JSON .decode (crossdartFile.readAsStringSync ());
42+ } else {
43+ __crossdartJson = {};
44+ }
45+ } else {
46+ __crossdartJson = {};
47+ }
48+ }
49+ return __crossdartJson;
50+ }
51+
3352int byName (Nameable a, Nameable b) =>
3453 compareAsciiLowerCaseNatural (a.name, b.name);
3554
@@ -666,7 +685,6 @@ abstract class Documentable {
666685 String get oneLineDoc;
667686}
668687
669- // TODO: how do we get rid of this class?
670688class Dynamic extends ModelElement {
671689 Dynamic (Element element, Library library) : super (element, library);
672690
@@ -1218,6 +1236,11 @@ class Method extends ModelElement
12181236
12191237 String get fileName => "${name }.html" ;
12201238
1239+ String get fullkind {
1240+ if (_method.isAbstract) return 'abstract $kind ' ;
1241+ return kind;
1242+ }
1243+
12211244 @override
12221245 String get href => '${library .dirName }/${enclosingElement .name }/${fileName }' ;
12231246
@@ -1249,7 +1272,6 @@ class Method extends ModelElement
12491272 MethodElement get _method => (element as MethodElement );
12501273}
12511274
1252- // TODO: rename this to Property
12531275abstract class ModelElement implements Comparable , Nameable , Documentable {
12541276 final Element element;
12551277 final Library library;
@@ -1953,24 +1975,6 @@ class Parameter extends ModelElement implements EnclosedElement {
19531975 String toString () => element.name;
19541976}
19551977
1956- Map <String , Map <String , List <Map <String , dynamic >>>> __crossdartJson;
1957- Map <String , Map <String , List <Map <String , dynamic >>>> get _crossdartJson {
1958- if (__crossdartJson == null ) {
1959- if (config != null ) {
1960- var crossdartFile =
1961- new File (p.join (config.inputDir.path, "crossdart.json" ));
1962- if (crossdartFile.existsSync ()) {
1963- __crossdartJson = JSON .decode (crossdartFile.readAsStringSync ());
1964- } else {
1965- __crossdartJson = {};
1966- }
1967- } else {
1968- __crossdartJson = {};
1969- }
1970- }
1971- return __crossdartJson;
1972- }
1973-
19741978abstract class SourceCodeMixin {
19751979 String _sourceCodeCache;
19761980 String get crossdartHtmlTag {
@@ -1987,10 +1991,6 @@ abstract class SourceCodeMixin {
19871991
19881992 Library get library;
19891993
1990- void clearSourceCodeCache () {
1991- _sourceCodeCache = null ;
1992- }
1993-
19941994 String get sourceCode {
19951995 if (_sourceCodeCache == null ) {
19961996 String contents = getFileContentsFor (element);
@@ -2027,27 +2027,6 @@ abstract class SourceCodeMixin {
20272027 return _sourceCodeCache;
20282028 }
20292029
2030- String get _crossdartUrl {
2031- if (_lineNumber != null && _crossdartPath != null ) {
2032- String url = "//www.crossdart.info/p/${_crossdartPath }.html" ;
2033- return "${url }#line-${_lineNumber }" ;
2034- } else {
2035- return null ;
2036- }
2037- }
2038-
2039- int get _lineNumber {
2040- var node = element.computeNode ();
2041- if (node is Declaration && (node as Declaration ).element != null ) {
2042- var element = (node as Declaration ).element;
2043- var lineNumber = lineNumberCache.lineNumber (
2044- element.source.fullName, element.nameOffset);
2045- return lineNumber + 1 ;
2046- } else {
2047- return null ;
2048- }
2049- }
2050-
20512030 String get _crossdartPath {
20522031 var node = element.computeNode ();
20532032 if (node is Declaration && (node as Declaration ).element != null ) {
@@ -2086,6 +2065,31 @@ abstract class SourceCodeMixin {
20862065 return null ;
20872066 }
20882067 }
2068+
2069+ String get _crossdartUrl {
2070+ if (_lineNumber != null && _crossdartPath != null ) {
2071+ String url = "//www.crossdart.info/p/${_crossdartPath }.html" ;
2072+ return "${url }#line-${_lineNumber }" ;
2073+ } else {
2074+ return null ;
2075+ }
2076+ }
2077+
2078+ int get _lineNumber {
2079+ var node = element.computeNode ();
2080+ if (node is Declaration && (node as Declaration ).element != null ) {
2081+ var element = (node as Declaration ).element;
2082+ var lineNumber = lineNumberCache.lineNumber (
2083+ element.source.fullName, element.nameOffset);
2084+ return lineNumber + 1 ;
2085+ } else {
2086+ return null ;
2087+ }
2088+ }
2089+
2090+ void clearSourceCodeCache () {
2091+ _sourceCodeCache = null ;
2092+ }
20892093}
20902094
20912095/// Top-level variables. But also picks up getters and setters?
0 commit comments