Working again with optionals split.

This commit is contained in:
Sam Pottinger
2023-05-11 13:33:45 -07:00
parent 9fcf7527aa
commit 3ba415c7f3
2 changed files with 11 additions and 4 deletions
@@ -277,9 +277,16 @@ public class ErrorChecker {
String q = matcher.group();
int tabStart = in.startTabOffset + offset;
int tabStop = tabStart + 1;
int line = ps.tabOffsetToTabLine(in.tabIndex, tabStart);
// Prevent duplicate problems
if (problems.stream().noneMatch(p -> p.getStartOffset() == tabStart)) {
int line = ps.tabOffsetToTabLine(in.tabIndex, tabStart);
boolean isDupe = problems.stream()
.filter(p -> p.getTabIndex() == in.tabIndex)
.filter(p -> p.getLineNumber() == line)
.findAny()
.isPresent();
if (isDupe) {
String message;
if (iproblem.getID() == IProblem.UnterminatedString) {
message = Language.interpolate("editor.status.unterm_string_curly", q);
@@ -233,13 +233,13 @@ class PdeAdapter {
new Position(
prob.getLineNumber(),
PdeAdapter
.toLineCol(code.getProgram(), prob.getStartOffset())
.toLineCol(code.getProgram(), prob.getTabStartOffset().get())
.col - 1
),
new Position(
prob.getLineNumber(),
PdeAdapter
.toLineCol(code.getProgram(), prob.getStopOffset())
.toLineCol(code.getProgram(), prob.getTabStopOffset().get())
.col - 1
)
),