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

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

Issue 531153002: Clarify type names in analysis server API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/doc/api.html ('k') | pkg/analysis_server/lib/src/generated_protocol.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 edit.domain; 5 library edit.domain;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/constants.dart'; 10 import 'package:analysis_server/src/constants.dart';
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 // respond 91 // respond
92 return new EditGetAvailableRefactoringsResult(kinds).toResponse(request.id); 92 return new EditGetAvailableRefactoringsResult(kinds).toResponse(request.id);
93 } 93 }
94 94
95 Response getFixes(Request request) { 95 Response getFixes(Request request) {
96 var params = new EditGetFixesParams.fromRequest(request); 96 var params = new EditGetFixesParams.fromRequest(request);
97 String file = params.file; 97 String file = params.file;
98 int offset = params.offset; 98 int offset = params.offset;
99 // add fixes 99 // add fixes
100 List<ErrorFixes> errorFixesList = <ErrorFixes>[]; 100 List<AnalysisErrorFixes> errorFixesList = <AnalysisErrorFixes>[];
101 List<CompilationUnit> units = server.getResolvedCompilationUnits(file); 101 List<CompilationUnit> units = server.getResolvedCompilationUnits(file);
102 for (CompilationUnit unit in units) { 102 for (CompilationUnit unit in units) {
103 engine.AnalysisErrorInfo errorInfo = server.getErrors(file); 103 engine.AnalysisErrorInfo errorInfo = server.getErrors(file);
104 if (errorInfo != null) { 104 if (errorInfo != null) {
105 LineInfo lineInfo = errorInfo.lineInfo; 105 LineInfo lineInfo = errorInfo.lineInfo;
106 int requestLine = lineInfo.getLocation(offset).lineNumber; 106 int requestLine = lineInfo.getLocation(offset).lineNumber;
107 for (engine.AnalysisError error in errorInfo.errors) { 107 for (engine.AnalysisError error in errorInfo.errors) {
108 int errorLine = lineInfo.getLocation(error.offset).lineNumber; 108 int errorLine = lineInfo.getLocation(error.offset).lineNumber;
109 if (errorLine == requestLine) { 109 if (errorLine == requestLine) {
110 List<Fix> fixes = computeFixes(searchEngine, unit, error); 110 List<Fix> fixes = computeFixes(searchEngine, unit, error);
111 if (fixes.isNotEmpty) { 111 if (fixes.isNotEmpty) {
112 AnalysisError serverError = 112 AnalysisError serverError =
113 new AnalysisError.fromEngine(lineInfo, error); 113 new AnalysisError.fromEngine(lineInfo, error);
114 ErrorFixes errorFixes = new ErrorFixes(serverError); 114 AnalysisErrorFixes errorFixes = new AnalysisErrorFixes(serverError );
115 errorFixesList.add(errorFixes); 115 errorFixesList.add(errorFixes);
116 fixes.forEach((fix) { 116 fixes.forEach((fix) {
117 errorFixes.addFix(fix); 117 errorFixes.addFix(fix);
118 }); 118 });
119 } 119 }
120 } 120 }
121 } 121 }
122 } 122 }
123 } 123 }
124 // respond 124 // respond
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 if (refactoring is RenameRefactoring) { 314 if (refactoring is RenameRefactoring) {
315 RenameRefactoring renameRefactoring = refactoring; 315 RenameRefactoring renameRefactoring = refactoring;
316 RenameOptions renameOptions = 316 RenameOptions renameOptions =
317 new RenameOptions.fromRefactoringParams(params, request); 317 new RenameOptions.fromRefactoringParams(params, request);
318 renameRefactoring.newName = renameOptions.newName; 318 renameRefactoring.newName = renameOptions.newName;
319 return renameRefactoring.checkNewName(); 319 return renameRefactoring.checkNewName();
320 } 320 }
321 return new RefactoringStatus(); 321 return new RefactoringStatus();
322 } 322 }
323 } 323 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/doc/api.html ('k') | pkg/analysis_server/lib/src/generated_protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698