Skip to content

Commit 872efb1

Browse files
committed
Document diagnostic span
1 parent 2e61f32 commit 872efb1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/elixir/lib/code.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ defmodule Code do
199199
200200
If there is a file and position, then the diagnostic is precise
201201
and you can use the given file and position for generating snippets,
202-
IDEs annotations, and so on.
202+
IDEs annotations, and so on. An optional span is available with
203+
the line and column the diagnostic ends.
203204
204205
Otherwise, a stacktrace may be given, which you can place your own
205206
heuristics to provide better reporting.
@@ -210,7 +211,7 @@ defmodule Code do
210211
required(:message) => String.t(),
211212
required(:position) => position(),
212213
required(:stacktrace) => Exception.stacktrace(),
213-
required(:span) => {non_neg_integer(), non_neg_integer()} | nil,
214+
required(:span) => {line :: pos_integer(), column :: pos_integer()} | nil,
214215
optional(:exception) => Exception.t() | nil,
215216
optional(any()) => any()
216217
}

lib/mix/lib/mix/task.compiler.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ defmodule Mix.Task.Compiler do
3434
3535
If there is a file and position, then the diagnostic is precise
3636
and you can use the given file and position for generating snippets,
37-
IDEs annotations, and so on.
37+
IDEs annotations, and so on. An optional span is available with
38+
the line and column the diagnostic ends.
3839
3940
Otherwise, a stacktrace may be given, which you can place your own
4041
heuristics to provide better reporting.
@@ -48,7 +49,7 @@ defmodule Mix.Task.Compiler do
4849
compiler_name: String.t(),
4950
details: Exception.t() | any,
5051
stacktrace: Exception.stacktrace(),
51-
span: {non_neg_integer, non_neg_integer} | nil
52+
span: {line :: pos_integer(), column :: pos_integer()} | nil
5253
}
5354

5455
@typedoc """

0 commit comments

Comments
 (0)