Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nixel2007 committed Jan 28, 2020
2 parents 3c80423 + 75d5156 commit e472db1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,11 @@ public ParseTree visitFile(BSLParser.FileContext ctx) {
if (regions.isEmpty() && !ctx.getTokens().isEmpty()) {

List<DiagnosticRelatedInformation> relatedInformation = createRelatedInformations(ctx);

var ctxStart = ctx.getStart();
diagnosticStorage.addDiagnostic(
Ranges.create(ctxStart.getLine(),
ctxStart.getCharPositionInLine(),
ctxStart.getLine(),
ctxStart.getCharPositionInLine()),
relatedInformation);
if(!relatedInformation.isEmpty()) {
diagnosticStorage.addDiagnostic(
relatedInformation.get(0).getLocation().getRange(),
relatedInformation);
}
return ctx;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void testNoRegions() {

assertThat(diagnostics).hasSize(1);
assertThat(diagnostics, true)
.hasRange(5, 0, 0)
.hasRange(4, 0, 5, 8)
;
assertThat(diagnostics.get(0).getRelatedInformation())
.isNotNull()
Expand All @@ -83,7 +83,7 @@ void testCodeBlock() {

assertThat(diagnostics).hasSize(1);
assertThat(diagnostics, true)
.hasRange(1, 0, 0);
.hasRange(0, 0, 0, 23);

}

Expand Down

0 comments on commit e472db1

Please sign in to comment.