Skip to content

Commit

Permalink
Add [doc] and [group] attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
laniakea64 committed May 25, 2024
1 parent 0991695 commit 65f66b0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion syntax/just.vim
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ syn region justRecipeAttributes
\ contains=justRecipeAttr,justRecipeAttrSep,justRecipeAttrArgs,justRecipeAttrArgError

syn keyword justRecipeAttr
\ confirm linux macos no-cd no-exit-message no-quiet private unix windows
\ confirm doc group linux macos no-cd no-exit-message no-quiet private unix windows
\ contained
syn match justRecipeAttrSep ',' contained
syn region justRecipeAttrArgs matchgroup=justRecipeAttr start='\V(' end='\V)' contained
Expand Down
16 changes: 16 additions & 0 deletions tests/cases/recipes-with-extras.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,19 @@
<span class="Type">[confirm(</span><span class="String">x"Run this recipe in </span><span class="PreProc">$PWD</span><span class="String"> ?"</span><span class="Type">)]</span>
<span class="Function">confirm_shell_expanded</span><span class="Operator">:</span>
<span class="Number"> echo </span><span class="Delimiter">{{</span><span class="String">x"Running in </span><span class="PreProc">$PWD</span><span class="String">"</span><span class="Delimiter">}}</span>

<span class="Type">[group(</span><span class="String">'foo group'</span><span class="Type">)]</span>
<span class="Function">grouped1</span><span class="Operator">:</span>
<span class="Number"> echo </span><span class="String">'grouped'</span>

<span class="Comment"># An undocumented recipe</span>
<span class="Type">[doc]</span>
<span class="Function">not_documented</span><span class="Operator">:</span>
<span class="Number"> echo foo</span>

<span class="Type">[doc(</span><span class="String">'''</span>
<span class="String"> A very documented recipe.</span>
<span class="String"> This documentation comment spans multiple lines.</span>
<span class="String">'''</span><span class="Type">)]</span>
<span class="Function">long_doc</span><span class="Operator">:</span>
<span class="Number"> echo foo foo</span>
16 changes: 16 additions & 0 deletions tests/cases/recipes-with-extras.just
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,19 @@ hex_digits_all:
[confirm(x"Run this recipe in $PWD ?")]
confirm_shell_expanded:
echo {{x"Running in $PWD"}}

[group('foo group')]
grouped1:
echo 'grouped'

# An undocumented recipe
[doc]
not_documented:
echo foo

[doc('''
A very documented recipe.
This documentation comment spans multiple lines.
''')]
long_doc:
echo foo foo

0 comments on commit 65f66b0

Please sign in to comment.