File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 3535 expect ( ex ) . to include_elixir_syntax ( 'elixirDocString' , 'foo' )
3636 end
3737
38+ it 'doc with sigil_S triple double-quoted multiline content with parentheses' do
39+ ex = <<~'EOF'
40+ @doc(~S"""
41+ foo
42+ """)
43+ EOF
44+ expect ( ex ) . to include_elixir_syntax ( 'elixirVariable' , 'doc' )
45+ expect ( ex ) . to include_elixir_syntax ( 'elixirSigilDelimiter' , 'S"""' )
46+ expect ( ex ) . to include_elixir_syntax ( 'elixirSigil' , 'foo' )
47+ end
48+
3849 it 'doc with sigil_S triple single-quoted multiline content' do
3950 ex = <<~'EOF'
4051 @doc ~S'''
4657 expect ( ex ) . to include_elixir_syntax ( 'elixirDocString' , 'foo' )
4758 end
4859
60+ it 'doc with sigil_S triple single-quoted multiline content with parentheses' do
61+ ex = <<~'EOF'
62+ @doc(~S'''
63+ foo
64+ ''')
65+ EOF
66+ expect ( ex ) . to include_elixir_syntax ( 'elixirVariable' , 'doc' )
67+ expect ( ex ) . to include_elixir_syntax ( 'elixirSigilDelimiter' , "S'''" )
68+ expect ( ex ) . to include_elixir_syntax ( 'elixirSigil' , 'foo' )
69+ end
70+
4971 it 'doc with triple single-quoted multiline content is not a doc string' do
5072 ex = <<~'EOF'
5173 @doc '''
Original file line number Diff line number Diff line change 1010 expect ( 'def f(~s(")), do: true' ) . not_to include_elixir_syntax ( 'elixirSigilDelimiter' , '"' )
1111 end
1212
13+ it 'as function argument multiline content' do
14+ ex = <<~'EOF'
15+ f(
16+ ~S"""
17+ foo
18+ """,
19+ bar
20+ )
21+ EOF
22+
23+ expect ( ex ) . to include_elixir_syntax ( 'elixirSigilDelimiter' , 'S"""' )
24+ expect ( ex ) . to include_elixir_syntax ( 'elixirSigil' , 'foo' )
25+ end
26+
1327 describe 'upper case' do
1428 it 'string' do
1529 expect ( '~S(string)' ) . to include_elixir_syntax ( 'elixirSigilDelimiter' , 'S' )
Original file line number Diff line number Diff line change @@ -103,8 +103,8 @@ syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l("
103103syn region elixirSigil matchgroup =elixirSigilDelimiter start =" \~\l\/ " end =" \/ " skip =" \\\\\|\\\/ " contains =@elixirStringContained,elixirRegexEscapePunctuation fold
104104
105105" Sigils surrounded with heredoc
106- syn region elixirSigil matchgroup =elixirSigilDelimiter start =+ \~\a\z ("""\) + end =+ ^\s *\z s \z 1 \s *$ + skip =+ \\ "+ fold
107- syn region elixirSigil matchgroup =elixirSigilDelimiter start =+ \~\a\z ('''\) + end =+ ^\s *\z s \z 1 \s *$ + skip =+ \\ '+ fold
106+ syn region elixirSigil matchgroup =elixirSigilDelimiter start =+ \~\a\z ("""\) + end =+ ^\s *\z 1 + skip =+ \\ "+ fold
107+ syn region elixirSigil matchgroup =elixirSigilDelimiter start =+ \~\a\z ('''\) + end =+ ^\s *\z 1 + skip =+ \\ '+ fold
108108
109109" Documentation
110110if exists (' g:elixir_use_markdown_for_docs' ) && g: elixir_use_markdown_for_docs
You can’t perform that action at this time.
0 commit comments