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:
[email protected]


With regards,
Apache Git Services

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