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 test.integration.analysis.highlights; | 5 library test.integration.analysis.highlights; |
6 | 6 |
7 import 'package:analysis_server/src/protocol.dart'; | 7 import 'package:analysis_server/src/protocol.dart'; |
8 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 8 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 /* Block comment */ | 42 /* Block comment */ |
43 } | 43 } |
44 | 44 |
45 static staticMethod() { | 45 static staticMethod() { |
46 } | 46 } |
47 | 47 |
48 get getter { | 48 get getter { |
49 } | 49 } |
50 | 50 |
51 set setter(int parameter) { | 51 set setter(int parameter) { |
52 print(parameter); | |
53 } | 52 } |
54 } | 53 } |
55 | 54 |
56 class Class2<TypeParameter> extends Class<TypeParameter> { | 55 class Class2<TypeParameter> extends Class<TypeParameter> { |
57 @override | 56 @override |
58 method() { | 57 method() { |
59 } | 58 } |
60 } | 59 } |
61 | 60 |
62 typedef functionType(); | 61 typedef functionType(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 'Map', | 111 'Map', |
113 'int' | 112 'int' |
114 ]); | 113 ]); |
115 check(HighlightRegionType.COMMENT_BLOCK, ['/* Block comment */']); | 114 check(HighlightRegionType.COMMENT_BLOCK, ['/* Block comment */']); |
116 check(HighlightRegionType.COMMENT_DOCUMENTATION, | 115 check(HighlightRegionType.COMMENT_DOCUMENTATION, |
117 ['/**\n * Doc comment\n */']); | 116 ['/**\n * Doc comment\n */']); |
118 check( | 117 check( |
119 HighlightRegionType.COMMENT_END_OF_LINE, ['// End of line comment']); | 118 HighlightRegionType.COMMENT_END_OF_LINE, ['// End of line comment']); |
120 check(HighlightRegionType.CONSTRUCTOR, ['constructor']); | 119 check(HighlightRegionType.CONSTRUCTOR, ['constructor']); |
121 check(HighlightRegionType.DIRECTIVE, ["import 'dart:async' as async;"]); | 120 check(HighlightRegionType.DIRECTIVE, ["import 'dart:async' as async;"]); |
122 check(HighlightRegionType.DYNAMIC_PARAMETER_DECLARATION, ['dynamicType']); | 121 check(HighlightRegionType.DYNAMIC_TYPE, ['dynamicType']); |
123 check(HighlightRegionType.INSTANCE_FIELD_DECLARATION, ['field']); | 122 check(HighlightRegionType.FIELD, ['field']); |
124 check(HighlightRegionType.INSTANCE_SETTER_REFERENCE, ['field']); | 123 check(HighlightRegionType.FIELD_STATIC, ['staticField']); |
125 check(HighlightRegionType.STATIC_FIELD_DECLARATION, ['staticField']); | 124 check(HighlightRegionType.FUNCTION, ['print']); |
126 check(HighlightRegionType.TOP_LEVEL_FUNCTION_REFERENCE, ['print']); | 125 check(HighlightRegionType.FUNCTION_DECLARATION, ['function']); |
127 check(HighlightRegionType.TOP_LEVEL_FUNCTION_DECLARATION, ['function']); | |
128 check(HighlightRegionType.FUNCTION_TYPE_ALIAS, ['functionType']); | 126 check(HighlightRegionType.FUNCTION_TYPE_ALIAS, ['functionType']); |
129 check(HighlightRegionType.INSTANCE_GETTER_DECLARATION, ['getter']); | 127 check(HighlightRegionType.GETTER_DECLARATION, ['getter']); |
130 check(HighlightRegionType.IDENTIFIER_DEFAULT, ['unresolvedIdentifier']); | 128 check(HighlightRegionType.IDENTIFIER_DEFAULT, ['unresolvedIdentifier']); |
131 check(HighlightRegionType.IMPORT_PREFIX, ['async']); | 129 check(HighlightRegionType.IMPORT_PREFIX, ['async']); |
132 check(HighlightRegionType.KEYWORD, ['class', 'true', 'return']); | 130 check(HighlightRegionType.KEYWORD, ['class', 'true', 'return']); |
133 check(HighlightRegionType.LITERAL_BOOLEAN, ['true']); | 131 check(HighlightRegionType.LITERAL_BOOLEAN, ['true']); |
134 check(HighlightRegionType.LITERAL_DOUBLE, ['1.0']); | 132 check(HighlightRegionType.LITERAL_DOUBLE, ['1.0']); |
135 check(HighlightRegionType.LITERAL_INTEGER, ['2', '42']); | 133 check(HighlightRegionType.LITERAL_INTEGER, ['2', '42']); |
136 check(HighlightRegionType.LITERAL_LIST, ['[]']); | 134 check(HighlightRegionType.LITERAL_LIST, ['[]']); |
137 check(HighlightRegionType.LITERAL_MAP, [ | 135 check(HighlightRegionType.LITERAL_MAP, [ |
138 '{1.0: [].toList()}', | 136 '{1.0: [].toList()}', |
139 '{2: local}' | 137 '{2: local}' |
140 ]); | 138 ]); |
141 check(HighlightRegionType.LITERAL_STRING, ["'dart:async'", "'string'"]); | 139 check(HighlightRegionType.LITERAL_STRING, ["'dart:async'", "'string'"]); |
| 140 check(HighlightRegionType.LOCAL_VARIABLE, ['local']); |
142 check(HighlightRegionType.LOCAL_VARIABLE_DECLARATION, ['local']); | 141 check(HighlightRegionType.LOCAL_VARIABLE_DECLARATION, ['local']); |
143 check(HighlightRegionType.LOCAL_VARIABLE_REFERENCE, ['local']); | 142 check(HighlightRegionType.METHOD, ['toList']); |
144 check(HighlightRegionType.INSTANCE_METHOD_REFERENCE, ['toList']); | 143 check(HighlightRegionType.METHOD_DECLARATION, ['method']); |
145 check(HighlightRegionType.INSTANCE_METHOD_DECLARATION, ['method']); | 144 check(HighlightRegionType.METHOD_DECLARATION_STATIC, ['staticMethod']); |
146 check(HighlightRegionType.STATIC_METHOD_DECLARATION, ['staticMethod']); | 145 check(HighlightRegionType.METHOD_STATIC, ['wait']); |
147 check(HighlightRegionType.STATIC_METHOD_REFERENCE, ['wait']); | 146 check(HighlightRegionType.PARAMETER, ['parameter']); |
148 check(HighlightRegionType.PARAMETER_DECLARATION, ['parameter']); | 147 check(HighlightRegionType.SETTER_DECLARATION, ['setter']); |
149 check(HighlightRegionType.PARAMETER_REFERENCE, ['parameter']); | 148 check(HighlightRegionType.TOP_LEVEL_VARIABLE, [ |
150 check(HighlightRegionType.INSTANCE_SETTER_DECLARATION, ['setter']); | 149 'override', |
151 check(HighlightRegionType.TOP_LEVEL_GETTER_REFERENCE, ['override']); | 150 'topLevelVariable' |
152 check(HighlightRegionType.TOP_LEVEL_VARIABLE_DECLARATION, | 151 ]); |
153 ['topLevelVariable']); | |
154 check(HighlightRegionType.TYPE_NAME_DYNAMIC, ['dynamic']); | 152 check(HighlightRegionType.TYPE_NAME_DYNAMIC, ['dynamic']); |
155 check(HighlightRegionType.TYPE_PARAMETER, ['TypeParameter']); | 153 check(HighlightRegionType.TYPE_PARAMETER, ['TypeParameter']); |
156 expect(highlights, isEmpty); | 154 expect(highlights, isEmpty); |
157 }); | 155 }); |
158 } | 156 } |
159 } | 157 } |
OLD | NEW |