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

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

Issue 1157283004: fix ENUM_CONSTANT suggestions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 6 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
« no previous file with comments | « pkg/analysis_server/test/protocol_server_test.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/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/protocol.dart' as protocol 10 import 'package:analysis_server/src/protocol.dart' as protocol
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 expect(suggestion.isDeprecated, isDeprecated); 560 expect(suggestion.isDeprecated, isDeprecated);
561 expect(suggestion.element.kind, protocol.ElementKind.ENUM); 561 expect(suggestion.element.kind, protocol.ElementKind.ENUM);
562 return suggestion; 562 return suggestion;
563 } 563 }
564 564
565 CompletionSuggestion assertSuggestEnumConst(String completion, 565 CompletionSuggestion assertSuggestEnumConst(String completion,
566 {bool isDeprecated: false}) { 566 {bool isDeprecated: false}) {
567 CompletionSuggestion suggestion = 567 CompletionSuggestion suggestion =
568 assertSuggest(completion, isDeprecated: isDeprecated); 568 assertSuggest(completion, isDeprecated: isDeprecated);
569 expect(suggestion.isDeprecated, isDeprecated); 569 expect(suggestion.isDeprecated, isDeprecated);
570 // TODO(danrubel) : Perhaps should be protocol.ElementKind.ENUM_CONST 570 expect(suggestion.element.kind, protocol.ElementKind.ENUM_CONSTANT);
571 // but element model represents them as FIELD
572 expect(suggestion.element.kind, protocol.ElementKind.FIELD);
573 return suggestion; 571 return suggestion;
574 } 572 }
575 573
576 CompletionSuggestion assertSuggestImportedClass(String name, 574 CompletionSuggestion assertSuggestImportedClass(String name,
577 {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION, 575 {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
578 int relevance: DART_RELEVANCE_DEFAULT, String importUri}) { 576 int relevance: DART_RELEVANCE_DEFAULT, String importUri}) {
579 return assertNotSuggested(name); 577 return assertNotSuggested(name);
580 } 578 }
581 579
582 CompletionSuggestion assertSuggestImportedConstructor(String name, 580 CompletionSuggestion assertSuggestImportedConstructor(String name,
(...skipping 3784 matching lines...) Expand 10 before | Expand all | Expand 10 after
4367 assertNotSuggested('bar2'); 4365 assertNotSuggested('bar2');
4368 assertNotSuggested('_B'); 4366 assertNotSuggested('_B');
4369 assertSuggestLocalClass('Y'); 4367 assertSuggestLocalClass('Y');
4370 assertSuggestLocalClass('C'); 4368 assertSuggestLocalClass('C');
4371 assertSuggestLocalVariable('f', null); 4369 assertSuggestLocalVariable('f', null);
4372 assertNotSuggested('x'); 4370 assertNotSuggested('x');
4373 assertNotSuggested('e'); 4371 assertNotSuggested('e');
4374 }); 4372 });
4375 } 4373 }
4376 } 4374 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/protocol_server_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698