You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/01/09 23:50:25 UTC

[GitHub] [netbeans] dbalek opened a new pull request #2660: LSP codeAction fixes.

dbalek opened a new pull request #2660:
URL: https://github.com/apache/netbeans/pull/2660


   - [GR-28621] Introduce Field & Constant replaces all occurrences in all classes in single .java file
   - [GR-28623]  IllegalStateException thrown from CreateOuterClassFix


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] dbalek merged pull request #2660: LSP codeAction fixes.

Posted by GitBox <gi...@apache.org>.
dbalek merged pull request #2660:
URL: https://github.com/apache/netbeans/pull/2660


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] sdedic commented on a change in pull request #2660: LSP codeAction fixes.

Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #2660:
URL: https://github.com/apache/netbeans/pull/2660#discussion_r554534757



##########
File path: java/java.hints/src/org/netbeans/modules/java/hints/errors/CreateClassFix.java
##########
@@ -320,9 +320,7 @@ public void run(final WorkingCopy working) throws IOException {
                         default: throw new IllegalStateException();
                     }
                     CompilationUnitTree cut = make.CompilationUnit(targetSourceRoot, packageName.replace('.', '/') + '/' + simpleName + ".java", Collections.<ImportTree>emptyList(), Collections.singletonList(source));
-                    ClassTree nue = createConstructor(working, new TreePath(new TreePath(cut), source));
                     working.rewrite(null, cut);
-                    working.rewrite(source, nue);

Review comment:
       Apologies, I don't quite follow this change - I thought it's desirable to generate a constructor (?). If the constructor is not wanted here, the `implement` method below (also generates one) may need to be modified as well.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] dbalek commented on a change in pull request #2660: LSP codeAction fixes.

Posted by GitBox <gi...@apache.org>.
dbalek commented on a change in pull request #2660:
URL: https://github.com/apache/netbeans/pull/2660#discussion_r554545954



##########
File path: java/java.hints/src/org/netbeans/modules/java/hints/errors/CreateClassFix.java
##########
@@ -320,9 +320,7 @@ public void run(final WorkingCopy working) throws IOException {
                         default: throw new IllegalStateException();
                     }
                     CompilationUnitTree cut = make.CompilationUnit(targetSourceRoot, packageName.replace('.', '/') + '/' + simpleName + ".java", Collections.<ImportTree>emptyList(), Collections.singletonList(source));
-                    ClassTree nue = createConstructor(working, new TreePath(new TreePath(cut), source));
                     working.rewrite(null, cut);
-                    working.rewrite(source, nue);

Review comment:
       The language server uses `getModificationResult()` to get changes that need to send back to LSP client as a response to codeAction request. These changes are applied at the client side. On the other hand, `implement` is used by ordinary NetBeans UI and uses createFromTemplate mechanism to create new outer class. But you are right - constructor should be generated even if called via LSP. Fixed.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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