@@ -120,7 +120,7 @@ defmodule NextLS.Runtime do
120120                NextLS.Logger . log ( logger ,  "The runtime for #{ name }  ) 
121121
122122              reason  -> 
123-                 NextLS.Logger . error ( logger ,  "The runtime for #{ name } #{ reason }  ) 
123+                 NextLS.Logger . error ( logger ,  "The runtime for #{ name } #{ inspect ( reason ) }  ) 
124124            end 
125125        end 
126126      end ) 
@@ -136,8 +136,8 @@ defmodule NextLS.Runtime do
136136          |>  Path . join ( "monkey/_next_ls_private_compiler.ex" ) 
137137          |>  then ( & :rpc . call ( node ,  Code ,  :compile_file ,  [ & 1 ] ) ) 
138138          |>  tap ( fn 
139-             { :badrpc ,  :EXIT ,   { error ,   _ } }  -> 
140-               NextLS.Logger . error ( logger ,  error ) 
139+             { :badrpc ,  error }  -> 
140+               NextLS.Logger . error ( logger ,  { :badrpc ,   error } ) 
141141
142142            _  -> 
143143              :ok 
@@ -192,15 +192,22 @@ defmodule NextLS.Runtime do
192192  def  handle_call ( :compile ,  from ,  % { node:  node }  =  state )  do 
193193    task  = 
194194      Task.Supervisor . async_nolink ( state . task_supervisor ,  fn  -> 
195-         { _ ,  errors }  =  :rpc . call ( node ,  :_next_ls_private_compiler ,  :compile ,  [ ] ) 
195+         case  :rpc . call ( node ,  :_next_ls_private_compiler ,  :compile ,  [ ] )  do 
196+           { :badrpc ,  error }  -> 
197+             NextLS.Logger . error ( state . logger ,  { :badrpc ,  error } ) 
198+             [ ] 
196199
197-         Registry . dispatch ( state . registry ,  :extensions ,  fn  entries  -> 
198-           for  { pid ,  _ }  <-  entries  do 
199-             send ( pid ,  { :compiler ,  errors } ) 
200-           end 
201-         end ) 
200+           { _ ,  diagnostics }  when  is_list ( diagnostics )  -> 
201+             Registry . dispatch ( state . registry ,  :extensions ,  fn  entries  -> 
202+               for  { pid ,  _ }  <-  entries ,  do:  send ( pid ,  { :compiler ,  diagnostics } ) 
203+             end ) 
202204
203-         errors 
205+             diagnostics 
206+ 
207+           unknown  -> 
208+             NextLS.Logger . warning ( state . logger ,  "Unexpected compiler response: #{ inspect ( unknown ) }  ) 
209+             [ ] 
210+         end 
204211      end ) 
205212
206213    { :noreply ,  % { state  |  compiler_ref:  % { task . ref  =>  from } } } 
0 commit comments