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

Side by Side Diff: pkg/analysis_server/test/services/completion/completion_test_util.dart

Issue 1099583002: fix NSM when computing field formal parameter in non-constructor arg list (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.services.completion.util; 5 library test.services.completion.util;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart' as protocol 9 import 'package:analysis_server/src/protocol.dart' as protocol
10 show Element, ElementKind; 10 show Element, ElementKind;
(...skipping 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after
2018 addSource('/testA.dart', 'class A { }'); 2018 addSource('/testA.dart', 'class A { }');
2019 addTestSource(''' 2019 addTestSource('''
2020 import "/testA.dart"; 2020 import "/testA.dart";
2021 class C {var ^}'''); 2021 class C {var ^}''');
2022 computeFast(); 2022 computeFast();
2023 return computeFull((bool result) { 2023 return computeFull((bool result) {
2024 assertNoSuggestions(); 2024 assertNoSuggestions();
2025 }); 2025 });
2026 } 2026 }
2027 2027
2028 test_FieldFormalParameter_in_non_constructor() {
2029 // SimpleIdentifer FieldFormalParameter FormalParameterList
2030 addTestSource('class A {B(this.^foo) {}}');
2031 return computeFull((bool result) {
2032 expect(request.replacementOffset, completionOffset);
2033 expect(request.replacementLength, 3);
2034 assertNoSuggestions();
2035 });
2036 }
2037
2028 test_ForEachStatement_body_typed() { 2038 test_ForEachStatement_body_typed() {
2029 // Block ForEachStatement 2039 // Block ForEachStatement
2030 addTestSource('main(args) {for (int foo in bar) {^}}'); 2040 addTestSource('main(args) {for (int foo in bar) {^}}');
2031 computeFast(); 2041 computeFast();
2032 return computeFull((bool result) { 2042 return computeFull((bool result) {
2033 expect(request.replacementOffset, completionOffset); 2043 expect(request.replacementOffset, completionOffset);
2034 expect(request.replacementLength, 0); 2044 expect(request.replacementLength, 0);
2035 assertSuggestParameter('args', null); 2045 assertSuggestParameter('args', null);
2036 assertSuggestLocalVariable('foo', 'int'); 2046 assertSuggestLocalVariable('foo', 'int');
2037 assertSuggestImportedClass('Object'); 2047 assertSuggestImportedClass('Object');
(...skipping 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after
3935 assertNotSuggested('bar2'); 3945 assertNotSuggested('bar2');
3936 assertNotSuggested('_B'); 3946 assertNotSuggested('_B');
3937 assertSuggestLocalClass('Y'); 3947 assertSuggestLocalClass('Y');
3938 assertSuggestLocalClass('C'); 3948 assertSuggestLocalClass('C');
3939 assertSuggestLocalVariable('f', null); 3949 assertSuggestLocalVariable('f', null);
3940 assertNotSuggested('x'); 3950 assertNotSuggested('x');
3941 assertNotSuggested('e'); 3951 assertNotSuggested('e');
3942 }); 3952 });
3943 } 3953 }
3944 } 3954 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698