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

Unified Diff: pkg/analysis_server/tool/spec/codegen_dart_protocol.dart

Issue 462403005: Move Location factories and RefactoringProblemSeverity.max into the generated classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
diff --git a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
index f0bb61e8ae1c8a17083569d26613686c41e8987d..3c902792a272a319b592a6e132c38dcc641ae5cb 100644
--- a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
+++ b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
@@ -361,19 +361,32 @@ class CodegenProtocolVisitor extends HierarchicalApiVisitor with CodeGenerator {
return true;
case 'Location':
docComment([new dom.Text(
- 'Construct based on an element from the analyzer engine.')]);
- writeln('factory Location.fromElement(engine.Element element) =>');
- writeln(' _locationFromElement(element);');
+ 'Create a Location based on an [engine.Element].')]);
+ writeln('factory Location.forElement(engine.Element element) =>');
+ writeln(' _locationForElement(element);');
writeln();
- docComment([new dom.Text('Create a Location based on an element and offset from the analyzer engine.')]);
- writeln('factory Location.fromOffset(engine.Element element, int offset, int length) =>');
- writeln(' _locationFromOffset(element, offset, length);');
+ docComment([new dom.Text('Create a Location based on an [engine.SearchMatch].')]);
+ writeln('factory Location.forMatch(engine.SearchMatch match) =>');
+ writeln(' _locationForMatch(match);');
+ writeln();
+ docComment([new dom.Text('Create a Location based on an [engine.AstNode].')]);
+ writeln('factory Location.forNode(engine.AstNode node) =>');
+ writeln(' _locationForNode(node);');
+ writeln();
+ docComment([new dom.Text('Create a Location based on an [engine.CompilationUnit].')]);
+ writeln('factory Location.forUnit(engine.CompilationUnit unit, engine.SourceRange range) =>');
+ writeln(' _locationForUnit(unit, range);');
return true;
case 'OverriddenMember':
docComment([new dom.Text('Construct based on an element from the analyzer engine.')]);
writeln('factory OverriddenMember.fromEngine(engine.Element member) =>');
writeln(' _overriddenMemberFromEngine(member);');
return true;
+ case 'RefactoringProblemSeverity':
+ docComment([new dom.Text('Returns the [RefactoringProblemSeverity] with the maximal severity.')]);
+ writeln('static RefactoringProblemSeverity max(RefactoringProblemSeverity a, RefactoringProblemSeverity b) =>');
+ writeln(' _maxRefactoringProblemSeverity(a, b);');
+ return true;
case 'SearchResult':
docComment([new dom.Text('Construct based on a value from the search engine.')]);
writeln('factory SearchResult.fromMatch(engine.SearchMatch match) =>');

Powered by Google App Engine
This is Rietveld 408576698