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 35
35
expect ( ex ) . to include_elixir_syntax ( 'elixirDocString' , 'foo' )
36
36
end
37
37
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
+
38
49
it 'doc with sigil_S triple single-quoted multiline content' do
39
50
ex = <<~'EOF'
40
51
@doc ~S'''
46
57
expect ( ex ) . to include_elixir_syntax ( 'elixirDocString' , 'foo' )
47
58
end
48
59
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
+
49
71
it 'doc with triple single-quoted multiline content is not a doc string' do
50
72
ex = <<~'EOF'
51
73
@doc '''
Original file line number Diff line number Diff line change 10
10
expect ( 'def f(~s(")), do: true' ) . not_to include_elixir_syntax ( 'elixirSigilDelimiter' , '"' )
11
11
end
12
12
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
+
13
27
describe 'upper case' do
14
28
it 'string' do
15
29
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("
103
103
syn region elixirSigil matchgroup =elixirSigilDelimiter start =" \~\l\/ " end =" \/ " skip =" \\\\\|\\\/ " contains =@elixirStringContained,elixirRegexEscapePunctuation fold
104
104
105
105
" 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
108
108
109
109
" Documentation
110
110
if 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