Skip to content

Commit 3ba415c

Browse files
committed
Working again with optionals split.
1 parent 9fcf752 commit 3ba415c

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

java/src/processing/mode/java/ErrorChecker.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,16 @@ static private List<JavaProblem> checkForCurlyQuotes(PreprocSketch ps) {
277277
String q = matcher.group();
278278
int tabStart = in.startTabOffset + offset;
279279
int tabStop = tabStart + 1;
280+
int line = ps.tabOffsetToTabLine(in.tabIndex, tabStart);
281+
280282
// Prevent duplicate problems
281-
if (problems.stream().noneMatch(p -> p.getStartOffset() == tabStart)) {
282-
int line = ps.tabOffsetToTabLine(in.tabIndex, tabStart);
283+
boolean isDupe = problems.stream()
284+
.filter(p -> p.getTabIndex() == in.tabIndex)
285+
.filter(p -> p.getLineNumber() == line)
286+
.findAny()
287+
.isPresent();
288+
289+
if (isDupe) {
283290
String message;
284291
if (iproblem.getID() == IProblem.UnterminatedString) {
285292
message = Language.interpolate("editor.status.unterm_string_curly", q);

java/src/processing/mode/java/lsp/PdeAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,13 @@ void updateProblems(List<Problem> problems) {
233233
new Position(
234234
prob.getLineNumber(),
235235
PdeAdapter
236-
.toLineCol(code.getProgram(), prob.getStartOffset())
236+
.toLineCol(code.getProgram(), prob.getTabStartOffset().get())
237237
.col - 1
238238
),
239239
new Position(
240240
prob.getLineNumber(),
241241
PdeAdapter
242-
.toLineCol(code.getProgram(), prob.getStopOffset())
242+
.toLineCol(code.getProgram(), prob.getTabStopOffset().get())
243243
.col - 1
244244
)
245245
),

0 commit comments

Comments
 (0)