@@ -327,6 +327,9 @@ defmodule ElixirLS.LanguageServer.Diagnostics do
327
327
# we return a 0 length range exactly at that location
328
328
defp range ( { line_start , char_start } , source_file )
329
329
when not is_nil ( source_file ) do
330
+ # some diagnostics are broken
331
+ line_start = line_start || 1
332
+ char_start = char_start || 1
330
333
lines = SourceFile . lines ( source_file )
331
334
# elixir_position_to_lsp will handle positions outside file range
332
335
{ line_start_lsp , char_start_lsp } =
@@ -348,6 +351,13 @@ defmodule ElixirLS.LanguageServer.Diagnostics do
348
351
# we return exactly that range
349
352
defp range ( { line_start , char_start , line_end , char_end } , source_file )
350
353
when not is_nil ( source_file ) do
354
+ # some diagnostics are broken
355
+ line_start = line_start || 1
356
+ char_start = char_start || 1
357
+
358
+ line_end = line_end || 1
359
+ char_end = char_end || 1
360
+
351
361
lines = SourceFile . lines ( source_file )
352
362
# elixir_position_to_lsp will handle positions outside file range
353
363
{ line_start_lsp , char_start_lsp } =
0 commit comments