diff --git a/apps/els_lsp/src/els_code_actions.erl b/apps/els_lsp/src/els_code_actions.erl index 68ed67a8..830c3670 100644 --- a/apps/els_lsp/src/els_code_actions.erl +++ b/apps/els_lsp/src/els_code_actions.erl @@ -766,8 +766,6 @@ format_args(Document, Arity, Range) -> end. -spec guess_indentation([binary()]) -> pos_integer(). -guess_indentation([]) -> - 2; guess_indentation([A, B | Rest]) -> ACount = count_leading_spaces(A, 0), BCount = count_leading_spaces(B, 0), @@ -776,7 +774,9 @@ guess_indentation([A, B | Rest]) -> N; {_, _} -> guess_indentation([B | Rest]) - end. + end; +guess_indentation(_) -> + 2. -spec count_leading_spaces(binary(), non_neg_integer()) -> non_neg_integer(). count_leading_spaces(<<>>, _Acc) ->