Skip to content

Commit

Permalink
Highlight !include same as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
laniakea64 committed Dec 20, 2023
1 parent 9ffcd1b commit a426a59
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 26 deletions.
6 changes: 4 additions & 2 deletions syntax/just.vim
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ syn match justOperator "\v\=[=~]|!\=|[+/]"
syn cluster justExprBase contains=@justAllStrings,justConditional,justOperator
syn cluster justExpr contains=@justExprBase,@justBuiltInFunctions,justBuiltInFunctionArgs,justReplaceRegex

syn match justInclude "^!include\s\+.*$"
syn match justOldInclude "^!include\s.*$" contains=justOldIncludeDirective
syn match justOldIncludeDirective "^!include" contained

hi def link justAlias Statement
hi def link justAssignmentOperator Operator
Expand All @@ -256,13 +257,14 @@ hi def link justConditional Conditional
hi def link justCurlyBraces Special
hi def link justExport Statement
hi def link justFunction Function
hi def link justInclude Include
hi def link justIndentError Error
hi def link justInterpolation Normal
hi def link justInterpolationDelim Delimiter
hi def link justLineContinuation Special
hi def link justLineLeadingSymbol Special
hi def link justName Identifier
hi def link justOldInclude PreProc
hi def link justOldIncludeDirective Underlined
hi def link justOperator Operator
hi def link justParameterError Error
hi def link justParameterOperator Operator
Expand Down
5 changes: 5 additions & 0 deletions tests/cases/deprecated_obsolete.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<span class="Underlined">!include</span><span class="PreProc"> subdir/some.just</span>

<span class="Statement">set</span> <span class="Underlined">windows-powershell</span>
<span class="Statement">set</span> <span class="Underlined">windows-powershell</span><span class="Operator">:=</span><span class="Boolean">false</span>
<span class="Statement">set</span> <span class="Underlined">windows-powershell</span> <span class="Operator">:=</span> <span class="Boolean">true</span>
5 changes: 5 additions & 0 deletions tests/cases/deprecated_obsolete.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
!include subdir/some.just

set windows-powershell
set windows-powershell:=false
set windows-powershell := true
8 changes: 0 additions & 8 deletions tests/cases/include.html

This file was deleted.

8 changes: 0 additions & 8 deletions tests/cases/include.just

This file was deleted.

4 changes: 0 additions & 4 deletions tests/cases/set.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@

<span class="Statement">set</span> <span class="Keyword">windows-shell</span><span class="Operator">:=</span>[<span class="String">"powershell.exe"</span>, <span class="String">"-NoLogo"</span>, <span class="String">"-Command"</span>]

<span class="Statement">set</span> <span class="Underlined">windows-powershell</span>
<span class="Statement">set</span> <span class="Underlined">windows-powershell</span><span class="Operator">:=</span><span class="Boolean">false</span>
<span class="Statement">set</span> <span class="Underlined">windows-powershell</span> <span class="Operator">:=</span> <span class="Boolean">true</span>

<span class="Statement">set</span> <span class="Keyword">fallback</span>
<span class="Statement">set</span> <span class="Keyword">fallback</span> <span class="Operator">:=</span> <span class="Boolean">true</span>
<span class="Statement">set</span> <span class="Keyword">fallback</span> <span class="Operator">:=</span> <span class="Boolean">false</span>
Expand Down
4 changes: 0 additions & 4 deletions tests/cases/set.just
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ set shell:=['bash',"-c"]

set windows-shell:=["powershell.exe", "-NoLogo", "-Command"]

set windows-powershell
set windows-powershell:=false
set windows-powershell := true

set fallback
set fallback := true
set fallback := false
Expand Down

0 comments on commit a426a59

Please sign in to comment.