@@ -374,14 +374,16 @@ defmodule ElixirLS.LanguageServer.Dialyzer do
374
374
375
375
{ active_plt , new_mod_deps , raw_warnings } = Analyzer . analyze ( active_plt , files_to_analyze )
376
376
377
- mod_deps = Map . merge ( mod_deps , new_mod_deps )
377
+ mod_deps = update_mod_deps ( mod_deps , new_mod_deps , removed_modules )
378
378
warnings = add_warnings ( warnings , raw_warnings )
379
379
380
380
md5 =
381
381
for { file , { _ , hash } } <- file_changes , into: md5 do
382
382
{ file , hash }
383
383
end
384
384
385
+ md5 = remove_files ( md5 , removed_files )
386
+
385
387
{ active_plt , mod_deps , md5 , warnings }
386
388
end )
387
389
@@ -393,6 +395,18 @@ defmodule ElixirLS.LanguageServer.Dialyzer do
393
395
analysis_finished ( parent , :ok , active_plt , mod_deps , md5 , warnings , timestamp , build_ref )
394
396
end
395
397
398
+ defp update_mod_deps ( mod_deps , new_mod_deps , removed_modules ) do
399
+ mod_deps
400
+ |> Map . merge ( new_mod_deps )
401
+ |> Map . drop ( removed_modules )
402
+ |> Enum . map ( fn { mod , deps } -> { mod , deps -- removed_modules } end )
403
+ |> Enum . into ( % { } )
404
+ end
405
+
406
+ defp remove_files ( md5 , removed_files ) do
407
+ Map . drop ( md5 , removed_files )
408
+ end
409
+
396
410
defp add_warnings ( warnings , raw_warnings ) do
397
411
new_warnings =
398
412
for { _ , { file , line , m_or_mfa } , _ } = warning <- raw_warnings ,
0 commit comments