| 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 computer.outline; | 5 library computer.outline; |
| 6 | 6 |
| 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/src/collections.dart'; | 8 import 'package:analysis_server/src/collections.dart'; |
| 9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart' as engine; | 10 import 'package:analyzer/src/generated/element.dart' as engine; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 Outline _newConstructorOutline(ConstructorDeclaration constructor) { | 192 Outline _newConstructorOutline(ConstructorDeclaration constructor) { |
| 193 Identifier returnType = constructor.returnType; | 193 Identifier returnType = constructor.returnType; |
| 194 String name = returnType.name; | 194 String name = returnType.name; |
| 195 int offset = returnType.offset; | 195 int offset = returnType.offset; |
| 196 int length = returnType.length; | 196 int length = returnType.length; |
| 197 SimpleIdentifier constructorNameNode = constructor.name; | 197 SimpleIdentifier constructorNameNode = constructor.name; |
| 198 bool isPrivate = false; | 198 bool isPrivate = false; |
| 199 if (constructorNameNode != null) { | 199 if (constructorNameNode != null) { |
| 200 String constructorName = constructorNameNode.name; | 200 String constructorName = constructorNameNode.name; |
| 201 isPrivate = Identifier.isPrivateName(constructorName); | 201 isPrivate = Identifier.isPrivateName(constructorName); |
| 202 name += '.${constructorName}'; | 202 name += '.$constructorName'; |
| 203 offset = constructorNameNode.offset; | 203 offset = constructorNameNode.offset; |
| 204 length = constructorNameNode.length; | 204 length = constructorNameNode.length; |
| 205 } | 205 } |
| 206 _SourceRegion sourceRegion = _getSourceRegion(constructor); | 206 _SourceRegion sourceRegion = _getSourceRegion(constructor); |
| 207 FormalParameterList parameters = constructor.parameters; | 207 FormalParameterList parameters = constructor.parameters; |
| 208 String parametersStr = parameters != null ? parameters.toSource() : ''; | 208 String parametersStr = parameters != null ? parameters.toSource() : ''; |
| 209 Element element = new Element( | 209 Element element = new Element( |
| 210 ElementKind.CONSTRUCTOR, | 210 ElementKind.CONSTRUCTOR, |
| 211 name, | 211 name, |
| 212 Element.makeFlags( | 212 Element.makeFlags( |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 } | 399 } |
| 400 | 400 |
| 401 /** | 401 /** |
| 402 * A range of characters. | 402 * A range of characters. |
| 403 */ | 403 */ |
| 404 class _SourceRegion { | 404 class _SourceRegion { |
| 405 final int length; | 405 final int length; |
| 406 final int offset; | 406 final int offset; |
| 407 _SourceRegion(this.offset, this.length); | 407 _SourceRegion(this.offset, this.length); |
| 408 } | 408 } |
| OLD | NEW |