Skip to content

Commit

Permalink
Don't show inlay hint for _Var if arg is named Var (#1558)
Browse files Browse the repository at this point in the history
  • Loading branch information
plux authored Oct 7, 2024
1 parent bcfbb23 commit fd26c04
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion apps/els_lsp/src/els_inlay_hint_provider.erl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,17 @@ should_show_arg_hint(_Name, undefined) ->
should_show_arg_hint(undefined, _Name) ->
true;
should_show_arg_hint(Name, DefArgName) ->
strip_trailing_digits(Name) /= strip_trailing_digits(DefArgName).
normalize(Name) /= normalize(DefArgName).

-spec normalize(string()) -> string().
normalize(String) ->
remove_leading_underscore(
strip_trailing_digits(String)
).

-spec remove_leading_underscore(string()) -> string().
remove_leading_underscore(String) ->
string:trim(String, leading, "_").

-spec strip_trailing_digits(string()) -> string().
strip_trailing_digits(String) ->
Expand Down

0 comments on commit fd26c04

Please sign in to comment.