File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -57,11 +57,11 @@ defmodule NextLS.ElixirExtension do
57
57
defp range ( { start_line , start_col , end_line , end_col } ) do
58
58
% GenLSP.Structures.Range {
59
59
start: % GenLSP.Structures.Position {
60
- line: start_line - 1 ,
60
+ line: clamp ( start_line - 1 ) ,
61
61
character: start_col - 1
62
62
} ,
63
63
end: % GenLSP.Structures.Position {
64
- line: end_line - 1 ,
64
+ line: clamp ( end_line - 1 ) ,
65
65
character: end_col - 1
66
66
}
67
67
}
@@ -70,11 +70,11 @@ defmodule NextLS.ElixirExtension do
70
70
defp range ( { line , col } ) do
71
71
% GenLSP.Structures.Range {
72
72
start: % GenLSP.Structures.Position {
73
- line: line - 1 ,
73
+ line: clamp ( line - 1 ) ,
74
74
character: col - 1
75
75
} ,
76
76
end: % GenLSP.Structures.Position {
77
- line: line - 1 ,
77
+ line: clamp ( line - 1 ) ,
78
78
character: 999
79
79
}
80
80
}
@@ -83,13 +83,15 @@ defmodule NextLS.ElixirExtension do
83
83
defp range ( line ) do
84
84
% GenLSP.Structures.Range {
85
85
start: % GenLSP.Structures.Position {
86
- line: line - 1 ,
86
+ line: clamp ( line - 1 ) ,
87
87
character: 0
88
88
} ,
89
89
end: % GenLSP.Structures.Position {
90
- line: line - 1 ,
90
+ line: clamp ( line - 1 ) ,
91
91
character: 999
92
92
}
93
93
}
94
94
end
95
+
96
+ def clamp ( line ) , do: max ( line , 0 )
95
97
end
You can’t perform that action at this time.
0 commit comments