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

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

Issue 1048303003: suggest dynamic and void when defining new compilation unit members (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/keyword_computer.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 20f23bfa477688783b38e4b2fabf72f5c70818c3..5f5aacbbb69a691b2305eb1fefbde2dcf41938dd 100644
--- a/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/keyword_computer_test.dart
@@ -33,6 +33,47 @@ class KeywordComputerTest extends AbstractCompletionTest {
Keyword.VOID
];
+ static const List<Keyword> DECLARATION_KEYWORDS = const [
+ Keyword.ABSTRACT,
+ Keyword.CLASS,
+ Keyword.CONST,
+ Keyword.DYNAMIC,
+ Keyword.FINAL,
+ Keyword.TYPEDEF,
+ Keyword.VAR,
+ Keyword.VOID
+ ];
+
+ static const List<Keyword> DIRECTIVE_AND_DECLARATION_KEYWORDS = const [
+ Keyword.ABSTRACT,
+ Keyword.CLASS,
+ Keyword.CONST,
+ Keyword.DYNAMIC,
+ Keyword.EXPORT,
+ Keyword.FINAL,
+ Keyword.IMPORT,
+ Keyword.PART,
+ Keyword.TYPEDEF,
+ Keyword.VAR,
+ Keyword.VOID
+ ];
+
+ static const List<Keyword> DIRECTIVE_DECLARATION_AND_LIBRARY_KEYWORDS =
+ const [
+ Keyword.ABSTRACT,
+ Keyword.CLASS,
+ Keyword.CONST,
+ Keyword.DYNAMIC,
+ Keyword.EXPORT,
+ Keyword.FINAL,
+ Keyword.IMPORT,
+ Keyword.LIBRARY,
+ Keyword.PART,
+ Keyword.TYPEDEF,
+ Keyword.VAR,
+ Keyword.VOID
+ ];
+
static const List<Keyword> IN_BLOCK_IN_CLASS = const [
Keyword.ASSERT,
Keyword.CASE,
@@ -87,7 +128,7 @@ class KeywordComputerTest extends AbstractCompletionTest {
}
}
}
- };
+ }
if (expectedKeywords.any((k) => k is String)) {
StringBuffer msg = new StringBuffer();
msg.writeln('Expected set should be:');
@@ -114,7 +155,7 @@ class KeywordComputerTest extends AbstractCompletionTest {
expect(s.isDeprecated, equals(false));
expect(s.isPotential, equals(false));
}
- };
+ }
}
@override
@@ -125,59 +166,27 @@ class KeywordComputerTest extends AbstractCompletionTest {
test_after_class() {
addTestSource('class A {} ^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([
- Keyword.ABSTRACT,
- Keyword.CLASS,
- Keyword.CONST,
- Keyword.FINAL,
- Keyword.TYPEDEF,
- Keyword.VAR
- ], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
}
test_after_class2() {
addTestSource('class A {} c^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([
- Keyword.ABSTRACT,
- Keyword.CLASS,
- Keyword.CONST,
- Keyword.FINAL,
- Keyword.TYPEDEF,
- Keyword.VAR
- ], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
}
test_after_import() {
addTestSource('import foo; ^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([
- Keyword.ABSTRACT,
- Keyword.CLASS,
- Keyword.CONST,
- Keyword.EXPORT,
- Keyword.FINAL,
- Keyword.IMPORT,
- Keyword.PART,
- Keyword.TYPEDEF,
- Keyword.VAR
- ], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(
+ DIRECTIVE_AND_DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
}
test_after_import2() {
addTestSource('import foo; c^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([
- Keyword.ABSTRACT,
- Keyword.CLASS,
- Keyword.CONST,
- Keyword.EXPORT,
- Keyword.FINAL,
- Keyword.IMPORT,
- Keyword.PART,
- Keyword.TYPEDEF,
- Keyword.VAR
- ], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(
+ DIRECTIVE_AND_DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
}
test_before_import() {
@@ -331,18 +340,8 @@ class KeywordComputerTest extends AbstractCompletionTest {
test_empty() {
addTestSource('^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([
- Keyword.ABSTRACT,
- Keyword.CLASS,
- Keyword.CONST,
- Keyword.EXPORT,
- Keyword.FINAL,
- Keyword.IMPORT,
- Keyword.LIBRARY,
- Keyword.PART,
- Keyword.TYPEDEF,
- Keyword.VAR
- ], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(
+ DIRECTIVE_DECLARATION_AND_LIBRARY_KEYWORDS, DART_RELEVANCE_HIGH);
}
test_function_body_inClass_constructorInitializer() {
@@ -408,17 +407,8 @@ class A {
test_library() {
addTestSource('library foo;^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([
- Keyword.ABSTRACT,
- Keyword.CLASS,
- Keyword.CONST,
- Keyword.EXPORT,
- Keyword.FINAL,
- Keyword.IMPORT,
- Keyword.PART,
- Keyword.TYPEDEF,
- Keyword.VAR
- ], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(
+ DIRECTIVE_AND_DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
}
test_library_name() {
@@ -442,50 +432,22 @@ class A {
test_part_of() {
addTestSource('part of foo;^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([
- Keyword.ABSTRACT,
- Keyword.CLASS,
- Keyword.CONST,
- Keyword.EXPORT,
- Keyword.FINAL,
- Keyword.IMPORT,
- Keyword.PART,
- Keyword.TYPEDEF,
- Keyword.VAR
- ], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(
+ DIRECTIVE_AND_DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
}
test_partial_class() {
addTestSource('cl^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([
- Keyword.ABSTRACT,
- Keyword.CLASS,
- Keyword.CONST,
- Keyword.EXPORT,
- Keyword.FINAL,
- Keyword.IMPORT,
- Keyword.LIBRARY,
- Keyword.PART,
- Keyword.TYPEDEF,
- Keyword.VAR
- ], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(
+ DIRECTIVE_DECLARATION_AND_LIBRARY_KEYWORDS, DART_RELEVANCE_HIGH);
}
test_partial_class2() {
addTestSource('library a; cl^');
expect(computeFast(), isTrue);
- assertSuggestKeywords([
- Keyword.ABSTRACT,
- Keyword.CLASS,
- Keyword.CONST,
- Keyword.EXPORT,
- Keyword.FINAL,
- Keyword.IMPORT,
- Keyword.PART,
- Keyword.TYPEDEF,
- Keyword.VAR
- ], DART_RELEVANCE_HIGH);
+ assertSuggestKeywords(
+ DIRECTIVE_AND_DECLARATION_KEYWORDS, DART_RELEVANCE_HIGH);
}
void _appendKeywords(StringBuffer msg, Iterable<Keyword> keywords) {
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/keyword_computer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698