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

Side by Side Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 481173002: When user renames 'prefix' in 'prefix.Class' she actually wants to rename ImportElement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak for test - reference ambiguous prefix name. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/correction/fix_internal.dart » ('j') | 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 analysis.server; 5 library analysis.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/file_system/file_system.dart'; 10 import 'package:analyzer/file_system/file_system.dart';
(...skipping 11 matching lines...) Expand all
22 import 'package:analyzer/src/generated/ast.dart'; 22 import 'package:analyzer/src/generated/ast.dart';
23 import 'package:analyzer/src/generated/engine.dart'; 23 import 'package:analyzer/src/generated/engine.dart';
24 import 'package:analyzer/src/generated/source.dart'; 24 import 'package:analyzer/src/generated/source.dart';
25 import 'package:analyzer/src/generated/sdk.dart'; 25 import 'package:analyzer/src/generated/sdk.dart';
26 import 'package:analyzer/src/generated/source_io.dart'; 26 import 'package:analyzer/src/generated/source_io.dart';
27 import 'package:analyzer/src/generated/java_engine.dart'; 27 import 'package:analyzer/src/generated/java_engine.dart';
28 import 'package:analysis_server/src/services/correction/change.dart'; 28 import 'package:analysis_server/src/services/correction/change.dart';
29 import 'package:analysis_server/src/services/index/index.dart'; 29 import 'package:analysis_server/src/services/index/index.dart';
30 import 'package:analysis_server/src/services/search/search_engine.dart'; 30 import 'package:analysis_server/src/services/search/search_engine.dart';
31 import 'package:analyzer/src/generated/element.dart'; 31 import 'package:analyzer/src/generated/element.dart';
32 import 'package:analysis_server/src/services/correction/namespace.dart';
32 33
33 34
34 class ServerContextManager extends ContextManager { 35 class ServerContextManager extends ContextManager {
35 final AnalysisServer analysisServer; 36 final AnalysisServer analysisServer;
36 37
37 /** 38 /**
38 * The default options used to create new analysis contexts. 39 * The default options used to create new analysis contexts.
39 */ 40 */
40 AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl(); 41 AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
41 42
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 * offset. 674 * offset.
674 * 675 *
675 * May be empty, but not `null`. 676 * May be empty, but not `null`.
676 */ 677 */
677 List<Element> getElementsAtOffset(String path, int offset) { 678 List<Element> getElementsAtOffset(String path, int offset) {
678 List<CompilationUnit> units = getResolvedCompilationUnits(path); 679 List<CompilationUnit> units = getResolvedCompilationUnits(path);
679 List<Element> elements = <Element>[]; 680 List<Element> elements = <Element>[];
680 for (CompilationUnit unit in units) { 681 for (CompilationUnit unit in units) {
681 AstNode node = new NodeLocator.con1(offset).searchWithin(unit); 682 AstNode node = new NodeLocator.con1(offset).searchWithin(unit);
682 Element element = ElementLocator.locateWithOffset(node, offset); 683 Element element = ElementLocator.locateWithOffset(node, offset);
684 if (node is SimpleIdentifier && element is PrefixElement) {
685 element = getImportElement(node);
686 }
683 if (element != null) { 687 if (element != null) {
684 elements.add(element); 688 elements.add(element);
685 } 689 }
686 } 690 }
687 return elements; 691 return elements;
688 } 692 }
689 693
690 /** 694 /**
691 * Returns a [Future] completing when [file] has been completely analyzed, in 695 * Returns a [Future] completing when [file] has been completely analyzed, in
692 * particular, all its errors have been computed. 696 * particular, all its errors have been computed.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 /** 835 /**
832 * An enumeration of the services provided by the server domain. 836 * An enumeration of the services provided by the server domain.
833 */ 837 */
834 class ServerService extends Enum2<ServerService> { 838 class ServerService extends Enum2<ServerService> {
835 static const ServerService STATUS = const ServerService('STATUS', 0); 839 static const ServerService STATUS = const ServerService('STATUS', 0);
836 840
837 static const List<ServerService> VALUES = const [STATUS]; 841 static const List<ServerService> VALUES = const [STATUS];
838 842
839 const ServerService(String name, int ordinal) : super(name, ordinal); 843 const ServerService(String name, int ordinal) : super(name, ordinal);
840 } 844 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/correction/fix_internal.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698