| Index: pkg/analysis_server/lib/src/services/correction/assist_internal.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
|
| index 8328e32ae3de52e1df2f8cd09ec7ed1635f5d44e..872663bacd44cd54c212f50d0d5720f60568bcb7 100644
|
| --- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
|
| +++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
|
| @@ -128,6 +128,7 @@ class AssistProcessor {
|
| await _addProposal_convertToBlockFunctionBody();
|
| await _addProposal_convertToExpressionFunctionBody();
|
| await _addProposal_convertFlutterChild();
|
| + await _addProposal_convertPartOfToUri();
|
| await _addProposal_convertToForIndexLoop();
|
| await _addProposal_convertToIsNot_onIs();
|
| await _addProposal_convertToIsNot_onNot();
|
| @@ -655,6 +656,23 @@ class AssistProcessor {
|
| _addAssistFromBuilder(changeBuilder, DartAssistKind.CONVERT_INTO_GETTER);
|
| }
|
|
|
| + Future<Null> _addProposal_convertPartOfToUri() async {
|
| + PartOfDirective directive =
|
| + node.getAncestor((node) => node is PartOfDirective);
|
| + if (directive == null || directive.libraryName == null) {
|
| + return;
|
| + }
|
| + String libraryPath = unitLibraryElement.source.fullName;
|
| + String partPath = unit.element.source.fullName;
|
| + String relativePath = relative(libraryPath, from: dirname(partPath));
|
| + SourceRange replacementRange = range.node(directive.libraryName);
|
| + DartChangeBuilder changeBuilder = new DartChangeBuilder(session);
|
| + await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
|
| + builder.addSimpleReplacement(replacementRange, "'$relativePath'");
|
| + });
|
| + _addAssistFromBuilder(changeBuilder, DartAssistKind.CONVERT_PART_OF_TO_URI);
|
| + }
|
| +
|
| Future<Null> _addProposal_convertToBlockFunctionBody() async {
|
| FunctionBody body = getEnclosingFunctionBody();
|
| // prepare expression body
|
|
|