MarkdownHtmlPanelProvider (@NotNull MarkdownSettings settings) { final var providerInfo = settings.getPreviewPanelProviderInfo(); var provider = MarkdownHtmlPanelProvider.createFromInfo(providerInfo); if (provider.isAvailable() != MarkdownHtmlPanelProvider.AvailabilityInfo.AVAILABLE) { final var defaultProvider = MarkdownHtmlPanelProvider.createFromInfo(MarkdownSettings.getDefaultProviderInfo()); Messages.showMessageDialog( myHtmlPanelWrapper, MarkdownBundle.message("dialog.message.tried.to.use.preview.panel.provider", providerInfo.getName()), CommonBundle.getErrorTitle(), Messages.getErrorIcon() ); MarkdownSettings.getInstance(myProject).setPreviewPanelProviderInfo(defaultProvider.getProviderInfo()); provider = Objects.requireNonNull( ContainerUtil.find( MarkdownHtmlPanelProvider.getProviders(), p -> p.isAvailable() == MarkdownHtmlPanelProvider.AvailabilityInfo.AVAILABLE ) ); } myLastPanelProviderInfo = settings.getPreviewPanelProviderInfo(); return provider; }