Skip to content

Commit

Permalink
Trick to ensure we can handle macros like ?'FOO BAR',but not ?'IF'
Browse files Browse the repository at this point in the history
  • Loading branch information
shuying2244 committed Dec 9, 2024
1 parent a206895 commit 019e671
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions apps/els_lsp/src/els_completion_provider.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1625,12 +1625,10 @@ macro_label(Name) ->
macro_to_label(Name) ->
%% Trick to ensure we can handle macros like ?'FOO BAR'.
Bin = atom_to_binary(Name, utf8),
LowerBin = string:lowercase(Bin),
LowerAtom = binary_to_atom(LowerBin, utf8),
case atom_to_label(LowerAtom) == LowerBin of
true ->
case re:run(Bin, "\s", [{capture, none}]) of
nomatch ->
Bin;
false ->
match ->
atom_to_label(Name)
end.

Expand Down

0 comments on commit 019e671

Please sign in to comment.