From e1d88c25aa149aacfa2ef926b7fa5e6a19155088 Mon Sep 17 00:00:00 2001 From: Sophio Japharidze Date: Wed, 28 Aug 2024 17:02:20 +0200 Subject: [PATCH] SLLS-221 make binding no-match error more helpful --- .../sonarlint/ls/clientapi/SonarLintVSCodeClient.java | 4 ++-- .../sonarlint/ls/clientapi/SonarLintVSCodeClientTests.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 940d04567..3e713723b 100644 --- a/src/main/java/org/sonarsource/sonarlint/ls/clientapi/SonarLintVSCodeClient.java +++ b/src/main/java/org/sonarsource/sonarlint/ls/clientapi/SonarLintVSCodeClient.java @@ -311,8 +311,8 @@ public AssistBindingResponse assistBinding(AssistBindingParams params, SonarLint @Override public void noBindingSuggestionFound(String projectKey) { var messageRequestParams = new ShowMessageRequestParams(); - messageRequestParams.setMessage("SonarLint couldn't match SonarQube project '" + projectKey + "' to any of the currently " + - "open workspace folders. Please open your project in VSCode and try again."); + messageRequestParams.setMessage("SonarLint couldn't match the server project '" + projectKey + "' to any of the currently " + + "open workspace folders. Please make sure the project is open in the workspace, or try configuring the binding manually."); messageRequestParams.setType(MessageType.Error); var learnMoreAction = new MessageActionItem("Learn more"); messageRequestParams.setActions(List.of(learnMoreAction)); diff --git a/src/test/java/org/sonarsource/sonarlint/ls/clientapi/SonarLintVSCodeClientTests.java b/src/test/java/org/sonarsource/sonarlint/ls/clientapi/SonarLintVSCodeClientTests.java index 632a1c074..93fa975bd 100644 --- a/src/test/java/org/sonarsource/sonarlint/ls/clientapi/SonarLintVSCodeClientTests.java +++ b/src/test/java/org/sonarsource/sonarlint/ls/clientapi/SonarLintVSCodeClientTests.java @@ -526,7 +526,7 @@ void testNoBindingSuggestionFound() { var projectKey = "projectKey"; var messageRequestParams = new ShowMessageRequestParams(); - messageRequestParams.setMessage("SonarLint couldn't match SonarQube project '" + projectKey + "' to any of the currently open workspace folders. Please open your project in VSCode and try again."); + messageRequestParams.setMessage("SonarLint couldn't match the server project '" + projectKey + "' to any of the currently open workspace folders. Please make sure the project is open in the workspace, or try configuring the binding manually."); messageRequestParams.setType(MessageType.Error); var learnMoreAction = new MessageActionItem("Learn more"); messageRequestParams.setActions(List.of(learnMoreAction));