Skip to content

Commit

Permalink
Use released sonarlint-core 6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jblievremont committed Sep 24, 2021
1 parent ab5fbeb commit 852068c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</issueManagement>

<properties>
<sonarlint.core.version>6.4.0.36592</sonarlint.core.version>
<sonarlint.core.version>6.5.0.37122</sonarlint.core.version>
<!-- analyzers used for tests -->
<sonar.java.version>6.15.0.25849</sonar.java.version>
<sonar.javascript.version>6.2.1.12157</sonar.javascript.version>
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/org/sonarsource/sonarlint/ls/CommandManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
import org.eclipse.lsp4j.jsonrpc.messages.Either;
import org.eclipse.lsp4j.jsonrpc.messages.ResponseError;
import org.eclipse.lsp4j.jsonrpc.messages.ResponseErrorCode;
import org.sonar.api.batch.fs.TextRange;
import org.sonarsource.sonarlint.core.client.api.common.ClientInputFileEdit;
import org.sonarsource.sonarlint.core.client.api.common.QuickFix;
import org.sonarsource.sonarlint.core.client.api.common.RuleDetails;
import org.sonarsource.sonarlint.core.client.api.common.TextRange;
import org.sonarsource.sonarlint.core.client.api.common.analysis.Issue;
import org.sonarsource.sonarlint.core.client.api.connected.ConnectedRuleDetails;
import org.sonarsource.sonarlint.core.client.api.connected.ConnectedSonarLintEngine;
Expand All @@ -67,6 +67,7 @@
import org.sonarsource.sonarlint.ls.standalone.StandaloneEngineManager;

import static java.net.URI.create;
import static org.sonar.api.utils.Preconditions.checkNotNull;
import static org.sonarsource.sonarlint.ls.AnalysisManager.SONARLINT_SOURCE;
import static org.sonarsource.sonarlint.ls.AnalysisManager.SONARQUBE_TAINT_SOURCE;

Expand Down Expand Up @@ -184,9 +185,13 @@ private static TextEdit newLspTextEdit(org.sonarsource.sonarlint.core.client.api
}

private static Range newLspRange(TextRange range) {
checkNotNull(range.getStartLine());
checkNotNull(range.getStartLineOffset());
checkNotNull(range.getEndLine());
checkNotNull(range.getEndLineOffset());
Range lspRange = new Range();
lspRange.setStart(new Position(range.start().line() - 1, range.start().lineOffset()));
lspRange.setEnd(new Position(range.end().line() - 1, range.end().lineOffset()));
lspRange.setStart(new Position(range.getStartLine() - 1, range.getStartLineOffset()));
lspRange.setEnd(new Position(range.getEndLine() - 1, range.getEndLineOffset()));
return lspRange;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.sonarsource.sonarlint.core.client.api.common.ClientInputFileEdit;
import org.sonarsource.sonarlint.core.client.api.common.QuickFix;
import org.sonarsource.sonarlint.core.client.api.common.TextEdit;
import org.sonarsource.sonarlint.core.client.api.common.TextRange;
import org.sonarsource.sonarlint.core.client.api.common.analysis.ClientInputFile;
import org.sonarsource.sonarlint.core.client.api.common.analysis.Issue;
import org.sonarsource.sonarlint.core.client.api.connected.ConnectedRuleDetails;
Expand All @@ -56,8 +57,6 @@
import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneRuleDetails;
import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneRuleParam;
import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneSonarLintEngine;
import org.sonarsource.sonarlint.core.container.analysis.filesystem.DefaultTextPointer;
import org.sonarsource.sonarlint.core.container.analysis.filesystem.DefaultTextRange;
import org.sonarsource.sonarlint.core.container.standalone.rule.DefaultStandaloneRuleParam;
import org.sonarsource.sonarlint.ls.SonarLintExtendedLanguageClient.ShowRuleDescriptionParams;
import org.sonarsource.sonarlint.ls.connected.ProjectBindingManager;
Expand Down Expand Up @@ -193,7 +192,7 @@ void showQuickFixFromAnalyzer() {

TextEdit textEdit = mock(TextEdit.class);
when(textEdit.newText()).thenReturn("");
when(textEdit.range()).thenReturn(new DefaultTextRange(new DefaultTextPointer(1, 0), new DefaultTextPointer(1, 1)));
when(textEdit.range()).thenReturn(new TextRange(1, 0,1, 1));
ClientInputFileEdit edit = mock(ClientInputFileEdit.class);
when(edit.textEdits()).thenReturn(Collections.singletonList(textEdit));
ClientInputFile target = mock(ClientInputFile.class);
Expand Down

0 comments on commit 852068c

Please sign in to comment.