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 analyzer.src.generated.utilities_dart; | 5 library analyzer.src.generated.utilities_dart; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart' show AnnotatedNode, Comment; | 7 import 'package:analyzer/dart/ast/ast.dart' show AnnotatedNode, Comment; |
8 import 'package:analyzer/dart/ast/token.dart' show Token; | 8 import 'package:analyzer/dart/ast/token.dart' show Token; |
9 import 'package:analyzer/src/dart/element/element.dart' show ElementImpl; | 9 import 'package:analyzer/src/dart/element/element.dart' show ElementImpl; |
10 import 'package:analyzer/src/generated/java_core.dart'; | 10 import 'package:analyzer/src/generated/java_core.dart'; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 /** | 45 /** |
46 * If the given [node] has a documentation comment, remember its content | 46 * If the given [node] has a documentation comment, remember its content |
47 * and range into the given [element]. | 47 * and range into the given [element]. |
48 */ | 48 */ |
49 void setElementDocumentationComment(ElementImpl element, AnnotatedNode node) { | 49 void setElementDocumentationComment(ElementImpl element, AnnotatedNode node) { |
50 Comment comment = node.documentationComment; | 50 Comment comment = node.documentationComment; |
51 if (comment != null && comment.isDocumentation) { | 51 if (comment != null && comment.isDocumentation) { |
52 element.documentationComment = | 52 element.documentationComment = |
53 comment.tokens.map((Token t) => t.lexeme).join('\n'); | 53 comment.tokens.map((Token t) => t.lexeme).join('\n'); |
| 54 element.setDocRange(comment.offset, comment.length); |
54 } | 55 } |
55 } | 56 } |
56 | 57 |
57 /** | 58 /** |
58 * Check whether [uri1] starts with (or 'is prefixed by') [uri2] by checking | 59 * Check whether [uri1] starts with (or 'is prefixed by') [uri2] by checking |
59 * path segments. | 60 * path segments. |
60 */ | 61 */ |
61 bool startsWith(Uri uri1, Uri uri2) { | 62 bool startsWith(Uri uri1, Uri uri2) { |
62 List<String> uri1Segments = uri1.pathSegments; | 63 List<String> uri1Segments = uri1.pathSegments; |
63 List<String> uri2Segments = uri2.pathSegments.toList(); | 64 List<String> uri2Segments = uri2.pathSegments.toList(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 final bool isOptional; | 105 final bool isOptional; |
105 | 106 |
106 /** | 107 /** |
107 * Initialize a newly created kind with the given state. | 108 * Initialize a newly created kind with the given state. |
108 * | 109 * |
109 * @param isOptional `true` if this is an optional parameter | 110 * @param isOptional `true` if this is an optional parameter |
110 */ | 111 */ |
111 const ParameterKind(String name, int ordinal, this.isOptional) | 112 const ParameterKind(String name, int ordinal, this.isOptional) |
112 : super(name, ordinal); | 113 : super(name, ordinal); |
113 } | 114 } |
OLD | NEW |