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/10 10:26:59 UTC

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

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