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:
[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