File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
apps/language_server/lib/language_server/providers/plugins Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ defmodule ElixirLS.LanguageServer.Plugins.ModuleStore do
33 Caches the module list and a list of modules keyed by the behaviour they implement.
44 """
55 defstruct by_behaviour: % { } , list: [ ] , plugins: [ ]
6+ require Logger
67
78 @ type t :: % __MODULE__ {
89 by_behaviour: % { optional ( atom ) => module } ,
@@ -14,7 +15,25 @@ defmodule ElixirLS.LanguageServer.Plugins.ModuleStore do
1415
1516 def ensure_compiled ( context , module_or_modules ) do
1617 modules = List . wrap ( module_or_modules )
17- Enum . each ( modules , & Code . ensure_compiled / 1 )
18+
19+ modules =
20+ Enum . filter ( modules , fn module ->
21+ try do
22+ if match? ( { :module , _module } , Code . ensure_compiled ( module ) ) do
23+ true
24+ else
25+ Logger . warning ( "Failed to ensure compiled #{ inspect ( module ) } " )
26+ false
27+ end
28+ catch
29+ kind , payload ->
30+ Logger . warning (
31+ "Failed to ensure compiled #{ inspect ( module ) } : #{ Exception . format ( kind , payload , __STACKTRACE__ ) } "
32+ )
33+
34+ false
35+ end
36+ end )
1837
1938 Map . update! ( context , :module_store , & build ( modules , & 1 ) )
2039 end
You can’t perform that action at this time.
0 commit comments