lahodaj commented on code in PR #7548:
URL: https://github.com/apache/netbeans/pull/7548#discussion_r1679543180


##########
java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaErrorProvider.java:
##########
@@ -200,25 +202,55 @@ private static List<CodeAction> 
convertFixes(ErrorDescription err, Consumer<Exce
             }
         }
 
-        List<Fix> fixes = sortFixes(lfl.getFixes());
+        List<Fix> baseFixes = lfl.getFixes();
+
+        baseFixes = sortFixes(baseFixes);
+
+        List<Pair<Fix, Boolean>> fixesAndSubfixes = new ArrayList<>(); // true 
if main fix
+
+        for (Fix f : baseFixes){
+            fixesAndSubfixes.add(Pair.of(f, true));
+
+            try {
+                Class<?> controller = 
Class.forName("org.netbeans.modules.editor.hints.HintsControllerImpl",
+                                                    false,
+                                                    
ErrorDescription.class.getClassLoader());
+                Method getSubfixes = 
controller.getDeclaredMethod("getSubfixes", Fix.class);

Review Comment:
   `spi.editor.hints` only has SPI, which means something providers (that 
produce information) plug into, but that is not used to retrieve information. 
We could add an API package, with an API class, it just feels weird that the 
only method would be to get sub-fixes.
   
   But maybe we could add a default method to 
`org.netbeans.spi.editor.hints.Fix`, e.g. `getSubfixes()`. 
`org.netbeans.modules.editor.hints.borrowed.ListCompletionView` would then use 
`Fix.getSubfixes()` to get sub-fixes instead of the current code, so that `Fix` 
subclasses could provided sub-fixes using the new method as well. And 
`java.hints` could also call that method. That's not completely clear, but 
would seem acceptable.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to