Skip to content

Commit

Permalink
SLCORE-1179 Synchronize and use C# Enterprise with SQ:Server 10.8+ wh…
Browse files Browse the repository at this point in the history
…en appropriate
  • Loading branch information
jblievremont committed Feb 14, 2025
1 parent 286cc07 commit 488dbfb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.sonarsource.sonarlint.core.repository.connection.ConnectionConfigurationRepository;
import org.sonarsource.sonarlint.core.rpc.protocol.backend.initialize.InitializeParams;
import org.sonarsource.sonarlint.core.rpc.protocol.backend.initialize.LanguageSpecificRequirements;
import org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer;
import org.sonarsource.sonarlint.core.serverconnection.StoredPlugin;
import org.sonarsource.sonarlint.core.storage.StorageService;
import org.springframework.context.event.EventListener;
Expand Down Expand Up @@ -152,7 +153,7 @@ private Set<Path> getPluginPathsForConnection(String connectionId) {
pluginsToLoadByKey.putAll(pluginsStorage.getStoredPluginPathsByKey());
pluginsToLoadByKey.putAll(getEmbeddedPluginPathsByKey(connectionId));
if (shouldUseEnterpriseCSharpAnalyzer(connectionId) && csharpSupport.csharpEnterprisePluginPath != null) {
pluginsToLoadByKey.put(SonarLanguage.CS.getPluginKey(), csharpSupport.csharpEnterprisePluginPath);
pluginsToLoadByKey.put(PluginsSynchronizer.CSHARP_ENTERPRISE_PLUGIN_ID, csharpSupport.csharpEnterprisePluginPath);
} else if (csharpSupport.csharpOssPluginPath != null) {
pluginsToLoadByKey.put(SonarLanguage.CS.getPluginKey(), csharpSupport.csharpOssPluginPath);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
public class PluginsSynchronizer {
public static final Version CUSTOM_SECRETS_MIN_SQ_VERSION = Version.create("10.4");
public static final Version ENTERPRISE_IAC_MIN_SQ_VERSION = Version.create("2025.1");
public static final String CSHARP_ENTERPRISE_PLUGIN_ID = "csharpenterprise";
private static final SonarLintLogger LOG = SonarLintLogger.get();

private final Set<String> sonarSourceDisabledPluginKeys;
Expand Down Expand Up @@ -105,7 +106,9 @@ private Optional<DownloadSkipReason> determineIfShouldSkipDownload(ServerPlugin
LOG.debug("[SYNC] Code analyzer '{}' is up-to-date. Skip downloading it.", serverPlugin.getKey());
return Optional.of(DownloadSkipReason.UP_TO_DATE);
}
if (!serverPlugin.isSonarLintSupported()) {
if (!serverPlugin.isSonarLintSupported() &&
// CSharp Enterprise is allowed even though it is not sonarLintSupported
!CSHARP_ENTERPRISE_PLUGIN_ID.equals(serverPlugin.getKey())) {
LOG.debug("[SYNC] Code analyzer '{}' does not support SonarLint. Skip downloading it.", serverPlugin.getKey());
return Optional.of(DownloadSkipReason.NOT_SONARLINT_SUPPORTED);
}
Expand Down

0 comments on commit 488dbfb

Please sign in to comment.