@@ -44,7 +44,7 @@ defmodule NextLS.ElixirExtension do
44
44
severity: severity ( d . severity ) ,
45
45
message: IO . iodata_to_binary ( d . message ) ,
46
46
source: d . compiler_name ,
47
- range: range ( d . position )
47
+ range: range ( d . position , Map . get ( d , :span ) )
48
48
} )
49
49
end
50
50
@@ -58,7 +58,7 @@ defmodule NextLS.ElixirExtension do
58
58
defp severity ( :info ) , do: GenLSP.Enumerations.DiagnosticSeverity . information ( )
59
59
defp severity ( :hint ) , do: GenLSP.Enumerations.DiagnosticSeverity . hint ( )
60
60
61
- defp range ( { start_line , start_col , end_line , end_col } ) do
61
+ defp range ( { start_line , start_col , end_line , end_col } , _ ) do
62
62
% GenLSP.Structures.Range {
63
63
start: % GenLSP.Structures.Position {
64
64
line: clamp ( start_line - 1 ) ,
@@ -71,7 +71,20 @@ defmodule NextLS.ElixirExtension do
71
71
}
72
72
end
73
73
74
- defp range ( { line , col } ) do
74
+ defp range ( { startl , startc } , { endl , endc } ) do
75
+ % GenLSP.Structures.Range {
76
+ start: % GenLSP.Structures.Position {
77
+ line: clamp ( startl - 1 ) ,
78
+ character: startc - 1
79
+ } ,
80
+ end: % GenLSP.Structures.Position {
81
+ line: clamp ( endl - 1 ) ,
82
+ character: endc - 1
83
+ }
84
+ }
85
+ end
86
+
87
+ defp range ( { line , col } , nil ) do
75
88
% GenLSP.Structures.Range {
76
89
start: % GenLSP.Structures.Position {
77
90
line: clamp ( line - 1 ) ,
@@ -84,7 +97,7 @@ defmodule NextLS.ElixirExtension do
84
97
}
85
98
end
86
99
87
- defp range ( line ) do
100
+ defp range ( line , _ ) do
88
101
% GenLSP.Structures.Range {
89
102
start: % GenLSP.Structures.Position {
90
103
line: clamp ( line - 1 ) ,
0 commit comments