Skip to content

Commit 7272837

Browse files
Get rid of redundant init param about enabling hotspots
1 parent 8ad8979 commit 7272837

File tree

4 files changed

+1
-17
lines changed

4 files changed

+1
-17
lines changed

src/main/java/org/sonarsource/sonarlint/ls/SonarLintLanguageServer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@
124124
import org.sonarsource.sonarlint.ls.notebooks.NotebookDiagnosticPublisher;
125125
import org.sonarsource.sonarlint.ls.notebooks.OpenNotebooksCache;
126126
import org.sonarsource.sonarlint.ls.notebooks.VersionedOpenNotebook;
127-
import org.sonarsource.sonarlint.ls.progress.LSProgressMonitor;
128127
import org.sonarsource.sonarlint.ls.settings.SettingsManager;
129128
import org.sonarsource.sonarlint.ls.settings.WorkspaceFolderSettingsChangeListener;
130129
import org.sonarsource.sonarlint.ls.settings.WorkspaceSettingsChangeListener;
@@ -767,7 +766,6 @@ void provideBackendInitData(String productKey, String userAgent, String clientNo
767766

768767
params.setEmbeddedPluginPaths(new HashSet<>(analyzers));
769768
params.setConnectedModeEmbeddedPluginPathsByKey(getEmbeddedPluginsToPath());
770-
params.setEnableSecurityHotspots(true);
771769

772770
params.setEnabledLanguagesInStandaloneMode(EnabledLanguages.getStandaloneLanguages().stream()
773771
.map(l -> Language.valueOf(l.name())).collect(Collectors.toSet()));

src/main/java/org/sonarsource/sonarlint/ls/backend/BackendInitParams.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class BackendInitParams {
3636
private Map<String, Path> connectedModeEmbeddedPluginPathsByKey;
3737
private Set<Language> enabledLanguagesInStandaloneMode;
3838
private Set<Language> extraEnabledLanguagesInConnectedMode;
39-
private boolean enableSecurityHotspots;
4039
private List<SonarQubeConnectionConfigurationDto> sonarQubeConnections;
4140
private List<SonarCloudConnectionConfigurationDto> sonarCloudConnections;
4241
private String sonarlintUserHome;
@@ -94,14 +93,6 @@ public void setExtraEnabledLanguagesInConnectedMode(Set<Language> extraEnabledLa
9493
this.extraEnabledLanguagesInConnectedMode = extraEnabledLanguagesInConnectedMode;
9594
}
9695

97-
public boolean isEnableSecurityHotspots() {
98-
return enableSecurityHotspots;
99-
}
100-
101-
public void setEnableSecurityHotspots(boolean enableSecurityHotspots) {
102-
this.enableSecurityHotspots = enableSecurityHotspots;
103-
}
104-
10596
public List<SonarQubeConnectionConfigurationDto> getSonarQubeConnections() {
10697
return sonarQubeConnections;
10798
}

src/main/java/org/sonarsource/sonarlint/ls/backend/BackendServiceFacade.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,13 @@ private InitializeParams toInitParams(BackendInitParams initParams) {
196196
EnumSet<BackendCapability> getBackendCapabilities(BackendInitParams initParams) {
197197
var backendCapabilities = EnumSet.of(BackendCapability.SMART_NOTIFICATIONS, BackendCapability.PROJECT_SYNCHRONIZATION,
198198
BackendCapability.EMBEDDED_SERVER, BackendCapability.SERVER_SENT_EVENTS, BackendCapability.DATAFLOW_BUG_DETECTION,
199-
BackendCapability.FULL_SYNCHRONIZATION);
199+
BackendCapability.FULL_SYNCHRONIZATION, BackendCapability.SECURITY_HOTSPOTS);
200200
if (telemetry != null && telemetry.enabled()) {
201201
backendCapabilities.add(BackendCapability.TELEMETRY);
202202
}
203203
if (shouldEnableMonitoring()) {
204204
backendCapabilities.add(BackendCapability.MONITORING);
205205
}
206-
if (initParams.isEnableSecurityHotspots()) {
207-
backendCapabilities.add(BackendCapability.SECURITY_HOTSPOTS);
208-
}
209206
return backendCapabilities;
210207
}
211208

src/test/java/org/sonarsource/sonarlint/ls/backend/BackendServiceFacadeTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ void shouldComputeBackendCapabilities() {
106106
when(telemetryService.enabled()).thenReturn(false);
107107

108108
var backendInitParams = mock(BackendInitParams.class);
109-
when(backendInitParams.isEnableSecurityHotspots()).thenReturn(true);
110109
var backendCapabilities = underTest.getBackendCapabilities(backendInitParams);
111110

112111
assertThat(backendCapabilities)
@@ -135,7 +134,6 @@ void shouldComputeBackendCapabilities_withTelemetryAndMonitoring() {
135134
when(telemetryService.enabled()).thenReturn(true);
136135

137136
var backendInitParams = mock(BackendInitParams.class);
138-
when(backendInitParams.isEnableSecurityHotspots()).thenReturn(true);
139137
var backendCapabilities = underTest.getBackendCapabilities(backendInitParams);
140138

141139
assertThat(backendCapabilities)

0 commit comments

Comments
 (0)