matthiasblaesing commented on a change in pull request #3655:
URL: https://github.com/apache/netbeans/pull/3655#discussion_r814165283



##########
File path: ide/lsp.client/src/org/netbeans/modules/lsp/client/LSPBindings.java
##########
@@ -269,6 +280,12 @@ private static LSPBindings buildBindings(ServerDescription 
inDescription, Projec
 
         for (LanguageServerProvider provider : 
MimeLookup.getLookup(mt).lookupAll(LanguageServerProvider.class)) {
             final Lookup lkp = prj != null ? Lookups.fixed(prj, mimeTypeInfo, 
restarter) : Lookups.fixed(mimeTypeInfo, restarter);
+            inDescription.mimeTypes = Collections.singleton(mt);
+            // If this is a MultiMimeLanguageServerProvider, then retrieve all 
+            // mime types handled by this server.
+            if (provider instanceof MultiMimeLanguageServerProvider) {
+                inDescription.mimeTypes = 
((MultiMimeLanguageServerProvider)provider).getMimeTypes();
+            }

Review comment:
       I would make a defensive copy in line 283, creating a new HashSet at 
that point from the core mimetype and adding the other mimetypes to that. Else 
the provider could change the backing set after the description was used for 
starting, causing an imbalance (yes not really realistic, but ...).




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

To unsubscribe, e-mail: [email protected]

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

Reply via email to