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

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

Issue 1050743003: replace request.node with request.target.containingNode in more situations (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/suggestion_builder.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;
11 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind; 11 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
12 import 'package:analysis_server/src/services/completion/common_usage_computer.da rt'; 12 import 'package:analysis_server/src/services/completion/common_usage_computer.da rt';
13 import 'package:analysis_server/src/services/completion/completion_manager.dart' ; 13 import 'package:analysis_server/src/services/completion/completion_manager.dart' ;
14 import 'package:analysis_server/src/services/completion/completion_target.dart';
14 import 'package:analysis_server/src/services/completion/dart_completion_cache.da rt'; 15 import 'package:analysis_server/src/services/completion/dart_completion_cache.da rt';
15 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart'; 16 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart';
16 import 'package:analysis_server/src/services/completion/imported_computer.dart'; 17 import 'package:analysis_server/src/services/completion/imported_computer.dart';
17 import 'package:analysis_server/src/services/completion/invocation_computer.dart '; 18 import 'package:analysis_server/src/services/completion/invocation_computer.dart ';
18 import 'package:analysis_server/src/services/index/index.dart'; 19 import 'package:analysis_server/src/services/index/index.dart';
19 import 'package:analysis_server/src/services/index/local_memory_index.dart'; 20 import 'package:analysis_server/src/services/index/local_memory_index.dart';
20 import 'package:analysis_server/src/services/search/search_engine_internal.dart' ; 21 import 'package:analysis_server/src/services/search/search_engine_internal.dart' ;
21 import 'package:analyzer/src/generated/ast.dart'; 22 import 'package:analyzer/src/generated/ast.dart';
22 import 'package:analyzer/src/generated/element.dart'; 23 import 'package:analyzer/src/generated/element.dart';
23 import 'package:analyzer/src/generated/engine.dart'; 24 import 'package:analyzer/src/generated/engine.dart';
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 List<Source> libSourceList = context.getLibrariesContaining(testSource); 515 List<Source> libSourceList = context.getLibrariesContaining(testSource);
515 if (libSourceList.length > 0) { 516 if (libSourceList.length > 0) {
516 LibraryElement library = context.getLibraryElement(libSourceList[0]); 517 LibraryElement library = context.getLibraryElement(libSourceList[0]);
517 if (library != null) { 518 if (library != null) {
518 CompilationUnit unit = 519 CompilationUnit unit =
519 context.getResolvedCompilationUnit(testSource, library); 520 context.getResolvedCompilationUnit(testSource, library);
520 if (unit != null) { 521 if (unit != null) {
521 request.unit = unit; 522 request.unit = unit;
522 request.node = 523 request.node =
523 new NodeLocator.con1(completionOffset).searchWithin(unit); 524 new NodeLocator.con1(completionOffset).searchWithin(unit);
525 request.target =
526 new CompletionTarget.forOffset(unit, completionOffset);
524 resolved = true; 527 resolved = true;
525 if (!fullAnalysis) { 528 if (!fullAnalysis) {
526 break; 529 break;
527 } 530 }
528 } 531 }
529 } 532 }
530 } 533 }
531 534
532 result = context.performAnalysisTask(); 535 result = context.performAnalysisTask();
533 } 536 }
(...skipping 3202 matching lines...) Expand 10 before | Expand all | Expand 10 after
3736 assertNotSuggested('bar2'); 3739 assertNotSuggested('bar2');
3737 assertNotSuggested('_B'); 3740 assertNotSuggested('_B');
3738 assertSuggestLocalClass('Y'); 3741 assertSuggestLocalClass('Y');
3739 assertSuggestLocalClass('C'); 3742 assertSuggestLocalClass('C');
3740 assertSuggestLocalVariable('f', null); 3743 assertSuggestLocalVariable('f', null);
3741 assertNotSuggested('x'); 3744 assertNotSuggested('x');
3742 assertNotSuggested('e'); 3745 assertNotSuggested('e');
3743 }); 3746 });
3744 } 3747 }
3745 } 3748 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698