Chromium Code Reviews| Index: pkg/analysis_server/lib/src/generated_protocol.dart |
| diff --git a/pkg/analysis_server/lib/src/generated_protocol.dart b/pkg/analysis_server/lib/src/generated_protocol.dart |
| index abf32c684e3bfbe0fcf8f5d16548eea8626d1627..4e7df5f1ed0c70d50f3bc88ffd476a19e41618c5 100644 |
| --- a/pkg/analysis_server/lib/src/generated_protocol.dart |
| +++ b/pkg/analysis_server/lib/src/generated_protocol.dart |
| @@ -6622,16 +6622,28 @@ class Location implements HasToJson { |
| } |
| /** |
| - * Construct based on an element from the analyzer engine. |
| + * Create a Location based on an [engine.Element]. |
| + */ |
| + factory Location.forElement(engine.Element element) => |
|
Paul Berry
2014/08/22 16:46:59
Can you help me understand the motivation for this
scheglov
2014/08/22 17:14:54
You're right.
I will rename these factories/functi
|
| + _locationForElement(element); |
| + |
| + /** |
| + * Create a Location based on an [engine.SearchMatch]. |
| + */ |
| + factory Location.forMatch(engine.SearchMatch match) => |
| + _locationForMatch(match); |
| + |
| + /** |
| + * Create a Location based on an [engine.AstNode]. |
| */ |
| - factory Location.fromElement(engine.Element element) => |
| - _locationFromElement(element); |
| + factory Location.forNode(engine.AstNode node) => |
| + _locationForNode(node); |
| /** |
| - * Create a Location based on an element and offset from the analyzer engine. |
| + * Create a Location based on an [engine.CompilationUnit]. |
| */ |
| - factory Location.fromOffset(engine.Element element, int offset, int length) => |
| - _locationFromOffset(element, offset, length); |
| + factory Location.forUnit(engine.CompilationUnit unit, engine.SourceRange range) => |
| + _locationForUnit(unit, range); |
| Map<String, dynamic> toJson() { |
| Map<String, dynamic> result = {}; |
| @@ -7583,6 +7595,12 @@ class RefactoringProblemSeverity { |
| throw jsonDecoder.mismatch(jsonPath, "RefactoringProblemSeverity"); |
| } |
| + /** |
| + * Returns the [RefactoringProblemSeverity] with the maximal severity. |
| + */ |
| + static RefactoringProblemSeverity max(RefactoringProblemSeverity a, RefactoringProblemSeverity b) => |
|
Brian Wilkerson
2014/08/22 16:32:17
I guess I wasn't clear. I think this should be an
scheglov
2014/08/22 16:43:02
Sometimes both "first" and "second" are null.
It
|
| + _maxRefactoringProblemSeverity(a, b); |
| + |
| @override |
| String toString() => "RefactoringProblemSeverity.$name"; |