File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
apps/language_server/lib/language_server Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,17 @@ defmodule ElixirLS.LanguageServer.Diagnostics do
30
30
# don't include stacktrace in exceptions with position
31
31
message =
32
32
if diagnostic . file not in [ nil , "nofile" ] and diagnostic . position != 0 and
33
- is_tuple ( diagnostic . details ) and tuple_size ( diagnostic . details ) == 2 do
33
+ is_tuple ( diagnostic . details ) and tuple_size ( diagnostic . details ) == 2 and
34
+ elem ( diagnostic . details , 0 ) in [ :error , :throw , :exit ] do
34
35
{ kind , reason } = diagnostic . details
35
- Exception . format_banner ( kind , reason )
36
+
37
+ try do
38
+ Exception . format_banner ( kind , reason )
39
+ rescue
40
+ _ ->
41
+ # we can't trust that details from external compilers will behave
42
+ diagnostic . message
43
+ end
36
44
else
37
45
diagnostic . message
38
46
end
You can’t perform that action at this time.
0 commit comments