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

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

Issue 1410893002: Disable completion in comment text. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
Index: pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart b/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
index 043e89c1c85c7f338ae8a5e693cf5b567b03afb8..4a2085f91b3fd1aceeddb2a2cccd30f703114654 100644
--- a/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
@@ -436,8 +436,7 @@ class KeywordContributorTest extends AbstractCompletionTest {
var keywords = <Keyword>[];
keywords.addAll(STMT_START_OUTSIDE_CLASS);
keywords.add(Keyword.RETHROW);
- assertSuggestKeywords(keywords,
- relevance: DART_RELEVANCE_KEYWORD);
+ assertSuggestKeywords(keywords, relevance: DART_RELEVANCE_KEYWORD);
}
test_class() {
@@ -1036,6 +1035,27 @@ class A {
expect(request.replacementLength, 3);
}
+ test_inComment_block() {
+ addTestSource('''
+main() {
+ /* text ^ */
+ print(42);
+}
+''');
+ expect(computeFast(), isTrue);
+ assertNoSuggestions();
+ }
+
+ test_inComment_endOfLine() {
+ addTestSource('''
+main() {
+ // text ^
+}
+''');
+ expect(computeFast(), isTrue);
+ assertNoSuggestions();
+ }
+
test_is_expression() {
addTestSource('main() {if (x is^)}');
expect(computeFast(), isTrue);

Powered by Google App Engine
This is Rietveld 408576698