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 2020/03/04 23:15:54 UTC
[GitHub] [netbeans] junichi11 commented on a change in pull request #1996:
Only register LSP based formatting if MimePath has language server
junichi11 commented on a change in pull request #1996: Only register LSP based formatting if MimePath has language server
URL: https://github.com/apache/netbeans/pull/1996#discussion_r387991446
##########
File path: ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/Formatter.java
##########
@@ -47,12 +45,18 @@
private static final Logger LOG = Logger.getLogger(Formatter.class.getName());
- @MimeRegistration(mimeType = "", service = ReformatTask.Factory.class)
public static class Factory implements ReformatTask.Factory {
@Override
public ReformatTask createTask(Context context) {
- return new Formatter(context);
+ FileObject file = NbEditorUtilities.getFileObject(context.document());
+ if (file != null) {
+ LSPBindings bindings = LSPBindings.getBindings(file);
+ if(bindings != null) {
Review comment:
Nitpick: missing whitespace after `if`
----------------------------------------------------------------
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
With regards,
Apache Git Services
---------------------------------------------------------------------
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