File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed
apps/language_server/lib/language_server Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -308,16 +308,29 @@ defmodule ElixirLS.LanguageServer.Dialyzer do
308
308
end
309
309
310
310
{ :exit , reason } , file_changes ->
311
- # on elixir >= 1.14 reason will actually be {beam_path, reason} but
312
- # it's not easy to pattern match on that
311
+ # on elixir >= 1.14 reason will actually be {beam_path, reason}
312
+
313
313
message = "Unable to process one of the beams: #{ Exception . format_exit ( reason ) } "
314
314
Logger . error ( message )
315
315
316
- JsonRpc . telemetry (
317
- "dialyzer_error" ,
318
- % { "elixir_ls.dialyzer_error" => message } ,
319
- % { }
320
- )
316
+ case reason do
317
+ { beam_path , _inner_reason } when is_binary ( beam_path ) or is_list ( beam_path ) ->
318
+ case File . rm_rf ( beam_path ) do
319
+ { :ok , _ } ->
320
+ Logger . info ( "Beam file #{ inspect ( beam_path ) } removed" )
321
+ :ok
322
+ rm_error ->
323
+ Logger . warning ( "Unable to remove beam file #{ inspect ( beam_path ) } : #{ inspect ( rm_error ) } " )
324
+ JsonRpc . show_message (
325
+ :error ,
326
+ "ElixirLS Dialyzer is unable to process #{ inspect ( beam_path ) } . Please remove it manually" )
327
+ end
328
+ _ ->
329
+ JsonRpc . show_message (
330
+ :error ,
331
+ "ElixirLS Dialyzer is unable to process one of the beam files. Please remove .elixir_ls/dialyzer* directory manually" )
332
+ :ok
333
+ end
321
334
322
335
file_changes
323
336
end )
You can’t perform that action at this time.
0 commit comments