Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: pkg/analysis_server/test/services/completion/completion_test_util.dart

Issue 962243003: fix constructor suggestion element names (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/local_computer.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/local_computer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698