OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library trydart.poi.scope_information_visitor; | 5 library trydart.poi.scope_information_visitor; |
6 | 6 |
7 import 'package:compiler/src/elements/modelx.dart' as modelx; | 7 import 'package:compiler/src/elements/modelx.dart' as modelx; |
8 | 8 |
9 import 'package:compiler/src/elements/modelx.dart' show | 9 import 'package:compiler/src/elements/modelx.dart' show |
10 CompilationUnitElementX, | 10 CompilationUnitElementX, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 buffer.write('\n'); | 67 buffer.write('\n'); |
68 indented; | 68 indented; |
69 serialize(member); | 69 serialize(member); |
70 isFirst = false; | 70 isFirst = false; |
71 } | 71 } |
72 serialize( | 72 serialize( |
73 e, | 73 e, |
74 // TODO(ahe): We omit the import scope if there is no current | 74 // TODO(ahe): We omit the import scope if there is no current |
75 // class. That's wrong. | 75 // class. That's wrong. |
76 omitEnclosing: ignoreImports || currentClass == null, | 76 omitEnclosing: ignoreImports || currentClass == null, |
77 name: e.getLibraryName(), | 77 name: e.libraryName, |
78 serializeEnclosing: () { | 78 serializeEnclosing: () { |
79 // The enclosing scope of a library is a scope which contains all the | 79 // The enclosing scope of a library is a scope which contains all the |
80 // imported names. | 80 // imported names. |
81 isFirst = true; | 81 isFirst = true; |
82 buffer.write('{\n'); | 82 buffer.write('{\n'); |
83 indentationLevel++; | 83 indentationLevel++; |
84 indented.write('"kind": "imports",\n'); | 84 indented.write('"kind": "imports",\n'); |
85 indented.write('"members": ['); | 85 indented.write('"members": ['); |
86 indentationLevel++; | 86 indentationLevel++; |
87 sortElements(importScope(e).importScope.values).forEach(forEach); | 87 sortElements(importScope(e).importScope.values).forEach(forEach); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 296 } |
297 return result; | 297 return result; |
298 } | 298 } |
299 } | 299 } |
300 | 300 |
301 modelx.ScopeX localScope(modelx.LibraryElementX element) => element.localScope; | 301 modelx.ScopeX localScope(modelx.LibraryElementX element) => element.localScope; |
302 | 302 |
303 modelx.ImportScope importScope(modelx.LibraryElementX element) { | 303 modelx.ImportScope importScope(modelx.LibraryElementX element) { |
304 return element.importScope; | 304 return element.importScope; |
305 } | 305 } |
OLD | NEW |