| OLD | NEW |
| 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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 } | 825 } |
| 826 | 826 |
| 827 /** | 827 /** |
| 828 * Returns [Element]s of the given [nodes]. | 828 * Returns [Element]s of the given [nodes]. |
| 829 * | 829 * |
| 830 * May be empty if not resolved, but not `null`. | 830 * May be empty if not resolved, but not `null`. |
| 831 */ | 831 */ |
| 832 List<Element> getElementsOfNodes(List<AstNode> nodes, int offset) { | 832 List<Element> getElementsOfNodes(List<AstNode> nodes, int offset) { |
| 833 List<Element> elements = <Element>[]; | 833 List<Element> elements = <Element>[]; |
| 834 for (AstNode node in nodes) { | 834 for (AstNode node in nodes) { |
| 835 if (node is SimpleIdentifier && node.parent is LibraryIdentifier) { |
| 836 node = node.parent; |
| 837 } |
| 838 if (node is LibraryIdentifier) { |
| 839 node = node.parent; |
| 840 } |
| 835 Element element = ElementLocator.locateWithOffset(node, offset); | 841 Element element = ElementLocator.locateWithOffset(node, offset); |
| 836 if (node is SimpleIdentifier && element is PrefixElement) { | 842 if (node is SimpleIdentifier && element is PrefixElement) { |
| 837 element = getImportElement(node); | 843 element = getImportElement(node); |
| 838 } | 844 } |
| 839 if (element != null) { | 845 if (element != null) { |
| 840 elements.add(element); | 846 elements.add(element); |
| 841 } | 847 } |
| 842 } | 848 } |
| 843 return elements; | 849 return elements; |
| 844 } | 850 } |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 // send the notification | 960 // send the notification |
| 955 channel.sendNotification( | 961 channel.sendNotification( |
| 956 new ServerErrorParams( | 962 new ServerErrorParams( |
| 957 true, | 963 true, |
| 958 exceptionString, | 964 exceptionString, |
| 959 stackTraceString).toNotification()); | 965 stackTraceString).toNotification()); |
| 960 } | 966 } |
| 961 } | 967 } |
| 962 | 968 |
| 963 typedef void OptionUpdater(AnalysisOptionsImpl options); | 969 typedef void OptionUpdater(AnalysisOptionsImpl options); |
| OLD | NEW |