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

Unified Diff: pkg/analysis_server/test/services/completion/keyword_computer_test.dart

Issue 1057403003: fix keyword completion in class body (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/completion_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/completion/keyword_computer_test.dart
diff --git a/pkg/analysis_server/test/services/completion/keyword_computer_test.dart b/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
index 51610100e63844c5405c7de16658451f4ddc1b5d..20f23bfa477688783b38e4b2fabf72f5c70818c3 100644
--- a/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
@@ -20,6 +20,19 @@ main() {
@reflectiveTest
class KeywordComputerTest extends AbstractCompletionTest {
+ static const List<Keyword> CLASS_BODY_KEYWORDS = const [
+ Keyword.CONST,
+ Keyword.DYNAMIC,
+ Keyword.FACTORY,
+ Keyword.FINAL,
+ Keyword.GET,
+ Keyword.OPERATOR,
+ Keyword.SET,
+ Keyword.STATIC,
+ Keyword.VAR,
+ Keyword.VOID
+ ];
+
static const List<Keyword> IN_BLOCK_IN_CLASS = const [
Keyword.ASSERT,
Keyword.CASE,
@@ -178,13 +191,37 @@ class KeywordComputerTest extends AbstractCompletionTest {
], DART_RELEVANCE_HIGH);
}
- test_class4() {
+ test_class() {
addTestSource('class A e^ { }');
expect(computeFast(), isTrue);
assertSuggestKeywords(
[Keyword.EXTENDS, Keyword.IMPLEMENTS], DART_RELEVANCE_HIGH);
}
+ test_class_body() {
+ addTestSource('class A {^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS);
+ }
+
+ test_class_body_beginning() {
+ addTestSource('class A {^ var foo;}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS);
+ }
+
+ test_class_body_between() {
+ addTestSource('class A {var bar; ^ var foo;}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS);
+ }
+
+ test_class_body_end() {
+ addTestSource('class A {var foo; ^}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS);
+ }
+
test_class_extends() {
addTestSource('class A extends foo ^');
expect(computeFast(), isTrue);
@@ -368,23 +405,6 @@ class A {
assertSuggestKeywords(IN_BLOCK_NOT_IN_CLASS);
}
- test_in_class() {
- addTestSource('class A {^}');
- expect(computeFast(), isTrue);
- assertSuggestKeywords([
- Keyword.CONST,
- Keyword.DYNAMIC,
- Keyword.FACTORY,
- Keyword.FINAL,
- Keyword.GET,
- Keyword.OPERATOR,
- Keyword.SET,
- Keyword.STATIC,
- Keyword.VAR,
- Keyword.VOID
- ]);
- }
-
test_library() {
addTestSource('library foo;^');
expect(computeFast(), isTrue);
« no previous file with comments | « pkg/analysis_server/test/completion_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698