File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
java/src/processing/mode/java/lsp Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -228,18 +228,25 @@ void updateProblems(List<Problem> problems) {
228228 Map <URI , List <Diagnostic >> dias = problems .stream ()
229229 .map (prob -> {
230230 SketchCode code = sketch .getCode (prob .getTabIndex ());
231+
232+ Optional <Integer > startOffset = prob .getTabStartOffset ();
233+ Optional <Integer > endOffset = prob .getTabStopOffset ();
234+
235+ assert startOffset .isPresent ();
236+ assert endOffset .isPresent ();
237+
231238 Diagnostic dia = new Diagnostic (
232239 new Range (
233240 new Position (
234241 prob .getLineNumber (),
235242 PdeAdapter
236- .toLineCol (code .getProgram (), prob . getTabStartOffset () .get ())
243+ .toLineCol (code .getProgram (), startOffset .get ())
237244 .col - 1
238245 ),
239246 new Position (
240247 prob .getLineNumber (),
241248 PdeAdapter
242- .toLineCol (code .getProgram (), prob . getTabStopOffset () .get ())
249+ .toLineCol (code .getProgram (), endOffset .get ())
243250 .col - 1
244251 )
245252 ),
You can’t perform that action at this time.
0 commit comments