OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 5 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
6 import 'package:analysis_server/src/services/completion/dart/override_contributo
r.dart'; | 6 import 'package:analysis_server/src/services/completion/dart/override_contributo
r.dart'; |
7 import 'package:analyzer_plugin/protocol/protocol_common.dart'; | 7 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
8 import 'package:test/test.dart'; | 8 import 'package:test/test.dart'; |
9 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 }'''); | 46 }'''); |
47 _assertOverride( | 47 _assertOverride( |
48 '''@override\n A suggested1(int x) {\n // TODO: implement suggested1
\n return null;\n }'''); | 48 '''@override\n A suggested1(int x) {\n // TODO: implement suggested1
\n return null;\n }'''); |
49 _assertOverride( | 49 _assertOverride( |
50 '''@override\n B suggested2(String y) {\n // TODO: implement suggest
ed2\n return null;\n }'''); | 50 '''@override\n B suggested2(String y) {\n // TODO: implement suggest
ed2\n return null;\n }'''); |
51 _assertOverride( | 51 _assertOverride( |
52 '''@override\n C suggested3([String z]) {\n // TODO: implement sugge
sted3\n return null;\n }'''); | 52 '''@override\n C suggested3([String z]) {\n // TODO: implement sugge
sted3\n return null;\n }'''); |
53 } | 53 } |
54 | 54 |
55 test_fromPart() async { | 55 test_fromPart() async { |
56 addSource( | 56 addSource('/myLib.dart', ''' |
57 '/myLib.dart', | |
58 ''' | |
59 library myLib; | 57 library myLib; |
60 part '$testFile' | 58 part '$testFile' |
61 part '/otherPart.dart' | 59 part '/otherPart.dart' |
62 class A { | 60 class A { |
63 A suggested1(int x) => null; | 61 A suggested1(int x) => null; |
64 B suggested2(String y) => null; | 62 B suggested2(String y) => null; |
65 } | 63 } |
66 '''); | 64 '''); |
67 addSource( | 65 addSource('/otherPart.dart', ''' |
68 '/otherPart.dart', | |
69 ''' | |
70 part of myLib; | 66 part of myLib; |
71 class B extends A { | 67 class B extends A { |
72 B suggested2(String y) => null; | 68 B suggested2(String y) => null; |
73 C suggested3([String z]) => null; | 69 C suggested3([String z]) => null; |
74 } | 70 } |
75 '''); | 71 '''); |
76 addTestSource(r''' | 72 addTestSource(r''' |
77 part of myLib; | 73 part of myLib; |
78 class C extends B { | 74 class C extends B { |
79 sugg^ | 75 sugg^ |
(...skipping 27 matching lines...) Expand all Loading... |
107 expect(cs.relevance, equals(DART_RELEVANCE_HIGH)); | 103 expect(cs.relevance, equals(DART_RELEVANCE_HIGH)); |
108 expect(cs.importUri, null); | 104 expect(cs.importUri, null); |
109 // expect(cs.selectionOffset, equals(completion.length)); | 105 // expect(cs.selectionOffset, equals(completion.length)); |
110 // expect(cs.selectionLength, equals(0)); | 106 // expect(cs.selectionLength, equals(0)); |
111 expect(cs.isDeprecated, isFalse); | 107 expect(cs.isDeprecated, isFalse); |
112 expect(cs.isPotential, isFalse); | 108 expect(cs.isPotential, isFalse); |
113 expect(cs.element, isNotNull); | 109 expect(cs.element, isNotNull); |
114 return cs; | 110 return cs; |
115 } | 111 } |
116 } | 112 } |
OLD | NEW |