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

Unified Diff: pkg/analyzer/test/src/summary/summarize_ast_test.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 | « pkg/analyzer/test/src/summary/resynthesize_ast_test.dart ('k') | pkg/analyzer_cli/lib/src/build_mode.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/summarize_ast_test.dart
diff --git a/pkg/analyzer/test/src/summary/summarize_ast_test.dart b/pkg/analyzer/test/src/summary/summarize_ast_test.dart
index 0a5b7408090a6c433df4ebf8025640a3d16ed97f..db71691e394fe28765cb3889773e7acf5ecb9a2b 100644
--- a/pkg/analyzer/test/src/summary/summarize_ast_test.dart
+++ b/pkg/analyzer/test/src/summary/summarize_ast_test.dart
@@ -10,7 +10,6 @@ import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/src/dart/scanner/reader.dart';
import 'package:analyzer/src/dart/scanner/scanner.dart';
import 'package:analyzer/src/generated/error.dart';
-import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/parser.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/summary/format.dart';
@@ -313,8 +312,7 @@ abstract class SummaryLinkerTest {
*/
Source addNamedSource(String filePath, String contents) {
CompilationUnit unit = _parseText(contents);
- List<int> lineStarts = StringUtilities.computeLineStarts(contents);
- UnlinkedUnitBuilder unlinkedUnit = serializeAstUnlinked(unit, lineStarts);
+ UnlinkedUnitBuilder unlinkedUnit = serializeAstUnlinked(unit);
_filesToLink.uriToUnit[absUri(filePath)] = unlinkedUnit;
// Tests using SummaryLinkerTest don't actually need the returned
// Source, so we can safely return `null`.
@@ -324,9 +322,7 @@ abstract class SummaryLinkerTest {
LinkerInputs createLinkerInputs(String text, {String path: '/test.dart'}) {
Uri testDartUri = Uri.parse(absUri(path));
CompilationUnit unit = _parseText(text);
- List<int> lineStarts = StringUtilities.computeLineStarts(text);
- UnlinkedUnitBuilder unlinkedDefiningUnit =
- serializeAstUnlinked(unit, lineStarts);
+ UnlinkedUnitBuilder unlinkedDefiningUnit = serializeAstUnlinked(unit);
_filesToLink.uriToUnit[testDartUri.toString()] = unlinkedDefiningUnit;
LinkerInputs linkerInputs = new LinkerInputs(
allowMissingFiles,
@@ -371,7 +367,9 @@ abstract class SummaryLinkerTest {
Token token = scanner.tokenize();
Parser parser = new Parser(null, AnalysisErrorListener.NULL_LISTENER);
parser.parseGenericMethods = true;
- return parser.parseCompilationUnit(token);
+ CompilationUnit unit = parser.parseCompilationUnit(token);
+ unit.lineInfo = new LineInfo(scanner.lineStarts);
+ return unit;
}
}
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_ast_test.dart ('k') | pkg/analyzer_cli/lib/src/build_mode.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698