File tree 1 file changed +12
-10
lines changed
apps/language_server/lib/language_server
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -531,16 +531,10 @@ 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
540
-
541
- { :ok , test_code_lens } = CodeLens . test_code_lens ( uri , state . source_files [ uri ] . text )
542
-
543
- { :ok , spec_code_lens ++ test_code_lens }
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
544
538
end
545
539
546
540
{ :async , fun , state }
@@ -602,6 +596,14 @@ defmodule ElixirLS.LanguageServer.Server do
602
596
}
603
597
end
604
598
599
+ defp get_spec_code_lens ( state , uri ) do
600
+ if dialyzer_enabled? ( state ) and state . settings [ "suggestSpecs" ] != false do
601
+ CodeLens . spec_code_lens ( state . server_instance_id , uri , state . source_files [ uri ] . text )
602
+ else
603
+ { :ok , [ ] }
604
+ end
605
+ end
606
+
605
607
# Build
606
608
607
609
defp trigger_build ( state ) do
You can’t perform that action at this time.
0 commit comments