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

Unified Diff: pkg/analysis_server/test/domain_completion_test.dart

Issue 1035623003: send completion notification even if offset beyond eof (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/dart_completion_manager.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/domain_completion_test.dart
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index b5947731262dc316b83aaeb76809029c17f96426..b2122ac09dc5c34729228c902c955ca87c186960 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -253,8 +253,13 @@ class CompletionTest extends AbstractAnalysisTest {
List<CompletionSuggestion> suggestions = [];
bool suggestionsDone = false;
- String addTestFile(String content) {
+ String addTestFile(String content, {offset}) {
completionOffset = content.indexOf('^');
+ if (offset != null) {
+ expect(completionOffset, -1, reason: 'cannot supply offset and ^');
+ completionOffset = offset;
+ return super.addTestFile(content);
+ }
expect(completionOffset, isNot(equals(-1)), reason: 'missing ^');
int nextOffset = content.indexOf('^', completionOffset + 1);
expect(nextOffset, equals(-1), reason: 'too many ^');
@@ -436,6 +441,16 @@ class CompletionTest extends AbstractAnalysisTest {
});
}
+ test_offset_past_eof() {
+ addTestFile('main() { }', offset: 300);
+ return getSuggestions().then((_) {
+ expect(replacementOffset, equals(300));
+ expect(replacementLength, equals(0));
+ expect(suggestionsDone, true);
+ expect(suggestions.length, 0);
+ });
+ }
+
test_overrides() {
addFile('/libA.dart', 'class A {m() {}}');
addTestFile('''
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698