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

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

Issue 454403003: local code completion suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge and address comments Created 6 years, 4 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 | « no previous file | pkg/analysis_services/lib/src/completion/dart_completion_manager.dart » ('j') | 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 e9c78637e45143414b60bdcefcecfa67f43ebd3d..f3339b6cfeef6c5e44936b0ef53c2f3cb93c05f9 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -113,7 +113,7 @@ class CompletionTest extends AbstractAnalysisTest {
handler = new CompletionDomainHandler(server);
}
- test_suggestions_html() {
+ test_html() {
testFile = '/project/web/test.html';
addTestFile('''
<html>^</html>
@@ -125,7 +125,7 @@ class CompletionTest extends AbstractAnalysisTest {
});
}
- test_suggestions_importedType() {
+ test_imports() {
addTestFile('''
import 'dart:html';
main() {^}
@@ -139,7 +139,19 @@ class CompletionTest extends AbstractAnalysisTest {
});
}
- test_suggestions_topLevel() {
+ test_locals() {
+ addTestFile('class A {var a; x() {var b;^}}');
+ return getSuggestions().then((_) {
+ expect(replacementOffset, equals(completionOffset));
+ expect(replacementLength, equals(0));
+ assertHasResult(CompletionSuggestionKind.CLASS, 'A');
+ assertHasResult(CompletionSuggestionKind.FIELD, 'a');
+ assertHasResult(CompletionSuggestionKind.VARIABLE, 'b');
+ assertHasResult(CompletionSuggestionKind.METHOD_NAME, 'x');
+ });
+ }
+
+ test_topLevel() {
addTestFile('''
typedef foo();
var test = '';
« no previous file with comments | « no previous file | pkg/analysis_services/lib/src/completion/dart_completion_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698