From 616e61f8f486e7fd8047a0c220ec889e08f603ab Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lievremont Date: Mon, 22 Apr 2024 16:22:31 +0200 Subject: [PATCH] Prepare release 3.5 (update sonarlint-core and parent-oss) --- pom.xml | 4 ++-- .../sonarlint/ls/backend/BackendServiceFacade.java | 11 +++++++++-- .../sonarlint/ls/clientapi/SonarLintVSCodeClient.java | 2 +- .../sonarlint/ls/folders/ModuleEventsProcessor.java | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index c0482304e..340b5dc1b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.sonarsource.parent parent - 71.0.0.1292 + 72.0.0.1405 org.sonarsource.sonarlint.ls @@ -24,7 +24,7 @@ 17 - 10.1.0.77680 + 10.1.0.77731 1.6.10 diff --git a/src/main/java/org/sonarsource/sonarlint/ls/backend/BackendServiceFacade.java b/src/main/java/org/sonarsource/sonarlint/ls/backend/BackendServiceFacade.java index 47b69934a..f4071e529 100644 --- a/src/main/java/org/sonarsource/sonarlint/ls/backend/BackendServiceFacade.java +++ b/src/main/java/org/sonarsource/sonarlint/ls/backend/BackendServiceFacade.java @@ -44,6 +44,7 @@ import org.sonarsource.sonarlint.core.rpc.protocol.backend.initialize.FeatureFlagsDto; import org.sonarsource.sonarlint.core.rpc.protocol.backend.initialize.HttpConfigurationDto; 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.rpc.protocol.backend.initialize.SonarCloudAlternativeEnvironmentDto; import org.sonarsource.sonarlint.core.rpc.protocol.backend.initialize.SslConfigurationDto; import org.sonarsource.sonarlint.core.rpc.protocol.backend.initialize.TelemetryClientConstantAttributesDto; @@ -136,8 +137,14 @@ private void initOnce(Map connections) { private InitializeParams toInitParams(BackendInitParams initParams) { var telemetryEnabled = telemetry != null && telemetry.enabled(); + var clientNodeJsPath = StringUtils.isEmpty(initParams.getClientNodePath()) ? null : Path.of(initParams.getClientNodePath()); + var languageSpecificRequirements = new LanguageSpecificRequirements( + clientNodeJsPath, + // Omnisharp requirements are set to null since analysis is still in process + null + ); return new InitializeParams( - new ClientConstantInfoDto("Visual Studio Code", initParams.getUserAgent()), + new ClientConstantInfoDto("Visual Studio Code", initParams.getUserAgent(), Integer.MIN_VALUE), new TelemetryClientConstantAttributesDto(initParams.getTelemetryProductKey(), telemetryInitParams.getProductName(), telemetryInitParams.getProductVersion(), @@ -158,7 +165,7 @@ private InitializeParams toInitParams(BackendInitParams initParams) { initParams.getSonarlintUserHome(), initParams.getStandaloneRuleConfigByKey(), initParams.isFocusOnNewCode(), - StringUtils.isEmpty(initParams.getClientNodePath()) ? null : Path.of(initParams.getClientNodePath()) + languageSpecificRequirements ); } diff --git a/src/main/java/org/sonarsource/sonarlint/ls/clientapi/SonarLintVSCodeClient.java b/src/main/java/org/sonarsource/sonarlint/ls/clientapi/SonarLintVSCodeClient.java index bd8b352f4..5f47a0cce 100644 --- a/src/main/java/org/sonarsource/sonarlint/ls/clientapi/SonarLintVSCodeClient.java +++ b/src/main/java/org/sonarsource/sonarlint/ls/clientapi/SonarLintVSCodeClient.java @@ -484,7 +484,7 @@ public List listFiles(String configScopeId) { .map(file -> { var filePath = Path.of(file.getFilePath()); return new ClientFileDto(filePath.toUri(), folderPath.relativize(filePath), configScopeId, null, StandardCharsets.UTF_8.name(), filePath, - file.getContent()); + file.getContent(), null); }) .toList(); }).join()) diff --git a/src/main/java/org/sonarsource/sonarlint/ls/folders/ModuleEventsProcessor.java b/src/main/java/org/sonarsource/sonarlint/ls/folders/ModuleEventsProcessor.java index 7fc7ae936..179d0a819 100644 --- a/src/main/java/org/sonarsource/sonarlint/ls/folders/ModuleEventsProcessor.java +++ b/src/main/java/org/sonarsource/sonarlint/ls/folders/ModuleEventsProcessor.java @@ -91,7 +91,7 @@ private void notifyBackend(List changes) { var relativePath = baseDir.relativize(fsPath); var folderUri = folder.getUri().toString(); var isTest = isTestFile(fileUri, settings); - addedOrChangedFiles.add(new ClientFileDto(fileUri, relativePath, folderUri, isTest, StandardCharsets.UTF_8.name(), fsPath, null)); + addedOrChangedFiles.add(new ClientFileDto(fileUri, relativePath, folderUri, isTest, StandardCharsets.UTF_8.name(), fsPath, null, null)); }); } });