Skip to content

Commit c85c91f

Browse files
committed
CodeQuality имеет 1-based номера строк
1 parent 375e5f3 commit c85c91f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReportEntry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public CodeQualityReportEntry(String path, Diagnostic diagnostic, DiagnosticInfo
7878
this.location = new Location();
7979
this.location.path = path;
8080
this.location.lines = new Lines();
81-
this.location.lines.begin = diagnostic.getRange().getStart().getLine();
81+
this.location.lines.begin = diagnostic.getRange().getStart().getLine() + 1;
8282
}
8383

8484
@Getter
@@ -100,7 +100,7 @@ public static class Location {
100100
@ToString
101101
public static class Lines {
102102
/**
103-
* The line on which the code quality violation occurred.
103+
* The line on which the code quality violation occurred (1-based).
104104
*/
105105
private int begin;
106106
}

src/test/java/com/github/_1c_syntax/bsl/languageserver/reporters/CodeQualityReportEntryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void testConstructor() {
5757
.hasFieldOrPropertyWithValue("checkName", "Typo")
5858
.hasFieldOrPropertyWithValue("severity", CodeQualityReportEntry.Severity.INFO)
5959
.hasFieldOrPropertyWithValue("location.path", "file.txt")
60-
.hasFieldOrPropertyWithValue("location.lines.begin", 0)
60+
.hasFieldOrPropertyWithValue("location.lines.begin", 1)
6161
;
6262
}
6363

0 commit comments

Comments
 (0)