| 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.services.completion.util; | 5 library test.services.completion.util; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart' as protocol | 9 import 'package:analysis_server/src/protocol.dart' as protocol |
| 10 show Element, ElementKind; | 10 show Element, ElementKind; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 expect(element.returnType, isNull); | 199 expect(element.returnType, isNull); |
| 200 assertHasNoParameterInfo(cs); | 200 assertHasNoParameterInfo(cs); |
| 201 return cs; | 201 return cs; |
| 202 } | 202 } |
| 203 | 203 |
| 204 CompletionSuggestion assertSuggestConstructor(String name) { | 204 CompletionSuggestion assertSuggestConstructor(String name) { |
| 205 CompletionSuggestion cs = assertSuggest(name); | 205 CompletionSuggestion cs = assertSuggest(name); |
| 206 protocol.Element element = cs.element; | 206 protocol.Element element = cs.element; |
| 207 expect(element, isNotNull); | 207 expect(element, isNotNull); |
| 208 expect(element.kind, equals(protocol.ElementKind.CONSTRUCTOR)); | 208 expect(element.kind, equals(protocol.ElementKind.CONSTRUCTOR)); |
| 209 expect(element.name, name); | 209 int index = name.indexOf('.'); |
| 210 expect(element.name, index >= 0 ? name.substring(index + 1) : ''); |
| 210 return cs; | 211 return cs; |
| 211 } | 212 } |
| 212 | 213 |
| 213 CompletionSuggestion assertSuggestField(String name, String type, | 214 CompletionSuggestion assertSuggestField(String name, String type, |
| 214 {int relevance: DART_RELEVANCE_DEFAULT, | 215 {int relevance: DART_RELEVANCE_DEFAULT, |
| 215 CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION, | 216 CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION, |
| 216 bool isDeprecated: false}) { | 217 bool isDeprecated: false}) { |
| 217 CompletionSuggestion cs = assertSuggest(name, | 218 CompletionSuggestion cs = assertSuggest(name, |
| 218 csKind: kind, | 219 csKind: kind, |
| 219 relevance: relevance, | 220 relevance: relevance, |
| (...skipping 2835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3055 assertNotSuggested('bar2'); | 3056 assertNotSuggested('bar2'); |
| 3056 assertNotSuggested('_B'); | 3057 assertNotSuggested('_B'); |
| 3057 assertSuggestLocalClass('Y'); | 3058 assertSuggestLocalClass('Y'); |
| 3058 assertSuggestLocalClass('C'); | 3059 assertSuggestLocalClass('C'); |
| 3059 assertSuggestLocalVariable('f', null); | 3060 assertSuggestLocalVariable('f', null); |
| 3060 assertNotSuggested('x'); | 3061 assertNotSuggested('x'); |
| 3061 assertNotSuggested('e'); | 3062 assertNotSuggested('e'); |
| 3062 }); | 3063 }); |
| 3063 } | 3064 } |
| 3064 } | 3065 } |
| OLD | NEW |