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

Unified Diff: pkg/analysis_server/lib/src/services/correction/fix_internal.dart

Issue 2345773003: Use declared variables to select the correct configuration for resolution (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/status/ast_writer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/correction/fix_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index bb393dc311b0658549b86c9786b130f4be4e973c..ceadf3c79bc199d0ae181deab214c570b841a012 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -519,9 +519,10 @@ class FixProcessor {
}
void _addFix_addPartOfDirective() {
+ // TODO(brianwilkerson) Generalize this to allow other valid string literals.
if (node is SimpleStringLiteral && node.parent is PartDirective) {
PartDirective directive = node.parent;
- Source partSource = directive.source;
+ Source partSource = directive.uriSource;
CompilationUnit partUnit;
partUnit = context.getResolvedCompilationUnit2(partSource, partSource);
if (partUnit != null) {
@@ -1187,9 +1188,11 @@ class FixProcessor {
}
void _addFix_createImportUri() {
+ // TODO(brianwilkerson) Generalize this to allow other valid string literals.
+ // TODO(brianwilkerson) Support the case where the node's parent is a Configuration.
if (node is SimpleStringLiteral && node.parent is ImportDirective) {
ImportDirective importDirective = node.parent;
- Source source = importDirective.source;
+ Source source = importDirective.uriSource;
if (source != null) {
String file = source.fullName;
if (isAbsolute(file) && AnalysisEngine.isDartFileName(file)) {
@@ -1407,9 +1410,10 @@ class FixProcessor {
}
void _addFix_createPartUri() {
+ // TODO(brianwilkerson) Generalize this to allow other valid string literals.
if (node is SimpleStringLiteral && node.parent is PartDirective) {
PartDirective partDirective = node.parent;
- Source source = partDirective.source;
+ Source source = partDirective.uriSource;
if (source != null) {
String libName = unitLibraryElement.name;
SourceEdit edit = new SourceEdit(0, 0, 'part of $libName;$eol$eol');
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/status/ast_writer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698