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/exception/exception.dart'; | 9 import 'package:analyzer/exception/exception.dart'; |
10 import 'package:analyzer/src/dart/element/element.dart' show ElementImpl; | 10 import 'package:analyzer/src/dart/element/element.dart' show ElementImpl; |
(...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); | |
55 } | 54 } |
56 } | 55 } |
57 | 56 |
58 /** | 57 /** |
59 * Check whether [uri1] starts with (or 'is prefixed by') [uri2] by checking | 58 * Check whether [uri1] starts with (or 'is prefixed by') [uri2] by checking |
60 * path segments. | 59 * path segments. |
61 */ | 60 */ |
62 bool startsWith(Uri uri1, Uri uri2) { | 61 bool startsWith(Uri uri1, Uri uri2) { |
63 List<String> uri1Segments = uri1.pathSegments; | 62 List<String> uri1Segments = uri1.pathSegments; |
64 List<String> uri2Segments = uri2.pathSegments.toList(); | 63 List<String> uri2Segments = uri2.pathSegments.toList(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 final bool isOptional; | 104 final bool isOptional; |
106 | 105 |
107 /** | 106 /** |
108 * Initialize a newly created kind with the given state. | 107 * Initialize a newly created kind with the given state. |
109 * | 108 * |
110 * @param isOptional `true` if this is an optional parameter | 109 * @param isOptional `true` if this is an optional parameter |
111 */ | 110 */ |
112 const ParameterKind(String name, int ordinal, this.isOptional) | 111 const ParameterKind(String name, int ordinal, this.isOptional) |
113 : super(name, ordinal); | 112 : super(name, ordinal); |
114 } | 113 } |
OLD | NEW |