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
3
3
Caches the module list and a list of modules keyed by the behaviour they implement.
4
4
"""
5
5
defstruct by_behaviour: % { } , list: [ ] , plugins: [ ]
6
+ require Logger
6
7
7
8
@ type t :: % __MODULE__ {
8
9
by_behaviour: % { optional ( atom ) => module } ,
@@ -14,7 +15,25 @@ defmodule ElixirLS.LanguageServer.Plugins.ModuleStore do
14
15
15
16
def ensure_compiled ( context , module_or_modules ) do
16
17
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 )
18
37
19
38
Map . update! ( context , :module_store , & build ( modules , & 1 ) )
20
39
end
You can’t perform that action at this time.
0 commit comments