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

Unified Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 2694403003: Add CompilationUnitElement.lineInfo and resynthesize it. (Closed)
Patch Set: Created 3 years, 10 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/analyzer/lib/src/task/dart.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index 32a8bf44c9c03941fb9ad3b50c48e055fe3d0192..5e57f8e700ea38e31889a091ccf72389e3c554e0 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -1037,6 +1037,11 @@ class BuildCompilationUnitElementTask extends SourceBasedAnalysisTask {
static const String PARSED_UNIT_INPUT_NAME = 'PARSED_UNIT_INPUT_NAME';
/**
+ * The name of the input whose value is the source line info.
+ */
+ static const String LINE_INFO_INPUT_NAME = 'LINE_INFO_INPUT_NAME';
+
+ /**
* The task descriptor describing this kind of task.
*/
static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
@@ -1068,6 +1073,7 @@ class BuildCompilationUnitElementTask extends SourceBasedAnalysisTask {
LibrarySpecificUnit librarySpecificUnit = target;
Source source = getRequiredSource();
CompilationUnit unit = getRequiredInput(PARSED_UNIT_INPUT_NAME);
+ LineInfo lineInfo = getRequiredInput(LINE_INFO_INPUT_NAME);
//
// Try to get the existing CompilationUnitElement.
//
@@ -1091,6 +1097,7 @@ class BuildCompilationUnitElementTask extends SourceBasedAnalysisTask {
CompilationUnitBuilder builder = new CompilationUnitBuilder();
element = builder.buildCompilationUnit(
source, unit, librarySpecificUnit.library);
+ (element as CompilationUnitElementImpl).lineInfo = lineInfo;
} else {
new DeclarationResolver().resolve(unit, element);
}
@@ -1118,7 +1125,8 @@ class BuildCompilationUnitElementTask extends SourceBasedAnalysisTask {
static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
LibrarySpecificUnit unit = target;
return <String, TaskInput>{
- PARSED_UNIT_INPUT_NAME: PARSED_UNIT.of(unit.unit, flushOnAccess: true)
+ PARSED_UNIT_INPUT_NAME: PARSED_UNIT.of(unit.unit, flushOnAccess: true),
+ LINE_INFO_INPUT_NAME: LINE_INFO.of(unit.unit)
};
}
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698