@@ -531,16 +531,21 @@ defmodule ElixirLS.LanguageServer.Server do
531531
532532 defp handle_request ( code_lens_req ( _id , uri ) , state ) do
533533 fun = fn ->
534- { :ok , spec_code_lens } =
535- if dialyzer_enabled? ( state ) and state . settings [ "suggestSpecs" ] != false do
536- CodeLens . spec_code_lens ( state . server_instance_id , uri , state . source_files [ uri ] . text )
537- else
538- [ ]
539- end
534+ with { :ok , spec_code_lens } <- get_spec_code_lens ( state , uri ) ,
535+ { :ok , test_code_lens } <- CodeLens . test_code_lens ( uri , state . source_files [ uri ] . text ) do
536+ { :ok , spec_code_lens ++ test_code_lens }
537+ end
538+
539+ # {:ok, spec_code_lens} =
540+ # if dialyzer_enabled?(state) and state.settings["suggestSpecs"] != false do
541+ # CodeLens.spec_code_lens(state.server_instance_id, uri, state.source_files[uri].text)
542+ # else
543+ # {:ok, []}
544+ # end
540545
541- { :ok , test_code_lens } = CodeLens . test_code_lens ( uri , state . source_files [ uri ] . text )
546+ # {:ok, test_code_lens} = CodeLens.test_code_lens(uri, state.source_files[uri].text)
542547
543- { :ok , spec_code_lens ++ test_code_lens }
548+ # {:ok, spec_code_lens ++ test_code_lens}
544549 end
545550
546551 { :async , fun , state }
@@ -602,6 +607,14 @@ defmodule ElixirLS.LanguageServer.Server do
602607 }
603608 end
604609
610+ defp get_spec_code_lens ( state , uri ) do
611+ if dialyzer_enabled? ( state ) and state . settings [ "suggestSpecs" ] != false do
612+ CodeLens . spec_code_lens ( state . server_instance_id , uri , state . source_files [ uri ] . text )
613+ else
614+ { :ok , [ ] }
615+ end
616+ end
617+
605618 # Build
606619
607620 defp trigger_build ( state ) do
0 commit comments