@@ -531,16 +531,21 @@ defmodule ElixirLS.LanguageServer.Server do
531
531
532
532
defp handle_request ( code_lens_req ( _id , uri ) , state ) do
533
533
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
540
545
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)
542
547
543
- { :ok , spec_code_lens ++ test_code_lens }
548
+ # {:ok, spec_code_lens ++ test_code_lens}
544
549
end
545
550
546
551
{ :async , fun , state }
@@ -602,6 +607,14 @@ defmodule ElixirLS.LanguageServer.Server do
602
607
}
603
608
end
604
609
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
+
605
618
# Build
606
619
607
620
defp trigger_build ( state ) do
0 commit comments