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