Index: pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_core.dart |
diff --git a/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_core.dart b/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_core.dart |
index f737d028ba0878bb35162d06c6337fad93844a6d..904a7671c44a22778a9207f291fd7eca3ffea747 100644 |
--- a/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_core.dart |
+++ b/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_core.dart |
@@ -151,6 +151,22 @@ class EditBuilderImpl implements EditBuilder { |
} |
} |
+ @override |
+ void addSimpleLinkedEdit(String groupName, String text, |
+ {LinkedEditSuggestionKind kind, List<String> suggestions}) { |
+ addLinkedEdit(groupName, (LinkedEditBuilder builder) { |
+ builder.write(text); |
+ if (suggestions != null && kind != null) { |
scheglov
2017/06/07 15:39:11
It would be better to order kind != null && sugges
Brian Wilkerson
2017/06/07 16:07:19
Done
|
+ for (String suggestion in suggestions) { |
+ builder.addSuggestion(kind, suggestion); |
+ } |
+ } else if (suggestions != null || kind != null) { |
+ throw new ArgumentError( |
+ 'Either both kind and suggestions must be provided or neither.'); |
+ } |
+ }); |
+ } |
+ |
LinkedEditBuilderImpl createLinkedEditBuilder() { |
return new LinkedEditBuilderImpl(this); |
} |