matthiasblaesing opened a new pull request #1996: Only register LSP based formatting if MimePath has language server URL: https://github.com/apache/netbeans/pull/1996 It was observed that XML formatting did not work after enabling LSP formatting. The problem was caused by the MimeLookup for application/xml that returned two ReformatTask.Factory implementations. One was the right factory, the other the Formatter provided by the LSP Client module. Instead of registering the ReformatTask.Factory of the LSP client module on the empty mime path, it is now dynamically registered by a MimeDataProvider (LspMimeDataProvider). That MimeDataProvider ensures that the lsp based formatter is only registered if a LanguageServerProvider is present on the targetted mime path. As an implementation note the LspMimeDataProvider is registered with a position, which ensures, that it is registered with higher priority than LegacyFormattersProvider which unconditionally registers a formatter. Having a higher priority (any position has higher priority than no position) ensures LspMimeDataProvider is queried first.
---------------------------------------------------------------- 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
