| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/protocol/protocol_constants.dart'; | 8 import 'package:analysis_server/protocol/protocol_constants.dart'; |
| 9 import 'package:analysis_server/protocol/protocol_generated.dart'; | 9 import 'package:analysis_server/protocol/protocol_generated.dart'; |
| 10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; | 10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 @A() | 222 @A() |
| 223 main() { | 223 main() { |
| 224 } | 224 } |
| 225 '''); | 225 '''); |
| 226 await prepareNavigation(); | 226 await prepareNavigation(); |
| 227 assertHasRegionString('A()', 'A'.length); | 227 assertHasRegionString('A()', 'A'.length); |
| 228 assertHasTarget('A {'); | 228 assertHasTarget('A {'); |
| 229 } | 229 } |
| 230 | 230 |
| 231 test_annotationConstructor_importPrefix() async { | 231 test_annotationConstructor_importPrefix() async { |
| 232 addFile( | 232 addFile('$testFolder/my_annotation.dart', r''' |
| 233 '$testFolder/my_annotation.dart', | |
| 234 r''' | |
| 235 library an; | 233 library an; |
| 236 class MyAnnotation { | 234 class MyAnnotation { |
| 237 const MyAnnotation(); | 235 const MyAnnotation(); |
| 238 const MyAnnotation.named(); | 236 const MyAnnotation.named(); |
| 239 } | 237 } |
| 240 '''); | 238 '''); |
| 241 addTestFile(''' | 239 addTestFile(''' |
| 242 import 'my_annotation.dart' as man; | 240 import 'my_annotation.dart' as man; |
| 243 @man.MyAnnotation() | 241 @man.MyAnnotation() |
| 244 @man.MyAnnotation.named() | 242 @man.MyAnnotation.named() |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 @myan // ref | 297 @myan // ref |
| 300 main() { | 298 main() { |
| 301 } | 299 } |
| 302 '''); | 300 '''); |
| 303 await prepareNavigation(); | 301 await prepareNavigation(); |
| 304 assertHasRegion('myan // ref'); | 302 assertHasRegion('myan // ref'); |
| 305 assertHasTarget('myan = new Object();'); | 303 assertHasTarget('myan = new Object();'); |
| 306 } | 304 } |
| 307 | 305 |
| 308 test_annotationField_importPrefix() async { | 306 test_annotationField_importPrefix() async { |
| 309 addFile( | 307 addFile('$testFolder/mayn.dart', r''' |
| 310 '$testFolder/mayn.dart', | |
| 311 r''' | |
| 312 library an; | 308 library an; |
| 313 const myan = new Object(); | 309 const myan = new Object(); |
| 314 '''); | 310 '''); |
| 315 addTestFile(''' | 311 addTestFile(''' |
| 316 import 'mayn.dart' as man; | 312 import 'mayn.dart' as man; |
| 317 @man.myan // ref | 313 @man.myan // ref |
| 318 main() { | 314 main() { |
| 319 } | 315 } |
| 320 '''); | 316 '''); |
| 321 await prepareNavigation(); | 317 await prepareNavigation(); |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1026 } | 1022 } |
| 1027 | 1023 |
| 1028 test_var_topLevelVariable_single_notInferred() async { | 1024 test_var_topLevelVariable_single_notInferred() async { |
| 1029 addTestFile(''' | 1025 addTestFile(''' |
| 1030 var x; | 1026 var x; |
| 1031 '''); | 1027 '''); |
| 1032 await prepareNavigation(); | 1028 await prepareNavigation(); |
| 1033 assertNoRegionAt('var'); | 1029 assertNoRegionAt('var'); |
| 1034 } | 1030 } |
| 1035 } | 1031 } |
| OLD | NEW |