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

Unified Diff: pkg/analysis_server/lib/src/protocol_server.dart

Issue 2225893003: Provide LINE_INFO from ResynthesizerResultProvider. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/package_bundle_reader.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/protocol_server.dart
diff --git a/pkg/analysis_server/lib/src/protocol_server.dart b/pkg/analysis_server/lib/src/protocol_server.dart
index 138c20f1ca65f25962d436027c0acd3079ef6b70..864f04fbf727641a2570214b840bb6c8766ba54e 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -17,6 +17,7 @@ import 'package:analyzer/source/error_processor.dart';
import 'package:analyzer/src/dart/ast/utilities.dart' as engine;
import 'package:analyzer/src/generated/engine.dart' as engine;
import 'package:analyzer/src/generated/error.dart' as engine;
+import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/source.dart' as engine;
import 'package:analyzer/src/generated/utilities_dart.dart' as engine;
@@ -254,15 +255,15 @@ Location _locationForArgs(engine.AnalysisContext context, engine.Source source,
engine.SourceRange range) {
int startLine = 0;
int startColumn = 0;
- {
- engine.LineInfo lineInfo = context.getLineInfo(source);
+ try {
+ engine.LineInfo lineInfo = context.computeLineInfo(source);
if (lineInfo != null) {
engine.LineInfo_Location offsetLocation =
lineInfo.getLocation(range.offset);
startLine = offsetLocation.lineNumber;
startColumn = offsetLocation.columnNumber;
}
- }
+ } on AnalysisException {}
return new Location(
source.fullName, range.offset, range.length, startLine, startColumn);
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/package_bundle_reader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698