Skip to content

Commit 5afd375

Browse files
authored
Handle parsing sigil (#1551)
1 parent 21fc148 commit 5afd375

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/els_lsp/src/els_erlfmt_ast.erl

+5
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,11 @@ erlfmt_to_st(Node) ->
680680
{args, Pos, Args} ->
681681
AAnno = dummy_anno(),
682682
erlfmt_to_st_1({tuple, Pos, [{atom, AAnno, '*args*'} | Args]});
683+
{sigil, Pos, _SigilPrefix, {string, StringPos0, Text}, _SigilSuffix} ->
684+
%% erl_syntax doesn't handle sigils, so we just extract the string
685+
%% Move start of string to start of sigil
686+
StringPos = StringPos0#{location := maps:get(location, Pos)},
687+
erlfmt_to_st_1({string, StringPos, Text});
683688
%% TODO:
684689
%% New `{spec_clause, Anno, Head, Body, Guards}` node for clauses
685690
%% inside `spec` and `callback` attributes, similar to the `clause`

0 commit comments

Comments
 (0)