diff --git a/queries/highlights.scm b/queries/highlights.scm index 4e1a4bb..319abcc 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -63,7 +63,7 @@ (string) @string -(comment) @comment +(comment) @comment.line ; (interpolation) @string @@ -80,6 +80,10 @@ ["@" "==" "!=" "+" ":=" "*" ":" "/" "?"] @operator -[ "(" ")" "[" "]" "{{" "}}" "{" "}"] @punctuation.bracket +["(" ")" "[" "]" "{{" "}}" "{" "}"] @punctuation.bracket + +["," ":"] @punctuation.delimiter + +"`" @punctuation.special (ERROR) @error diff --git a/test/highlight/recipes.just b/test/highlight/recipes.just index 534ada8..d88c915 100644 --- a/test/highlight/recipes.just +++ b/test/highlight/recipes.just @@ -42,6 +42,7 @@ corge +quux: baz (quux quux) # ^ punctuation.bracket # FIXME function +osdioj: a [private] a: diff --git a/test/highlight/statements.just b/test/highlight/statements.just index 8204cc8..4b50852 100644 --- a/test/highlight/statements.just +++ b/test/highlight/statements.just @@ -1,3 +1,6 @@ +#!/usr/bin/env just +# <- comment + foo := "abc" # <- variable # ^^ operator @@ -26,121 +29,152 @@ absolute := / "abc" # ^ operator # ^^^^^ string -combined := "foo" / bar() / baz +combined := "foo" / os() / bar # <- variable # ^^ operator # ^^^^^ string # ^ operator -# ^^^ function -# ^^ punctuation.bracket -# ^ operator -# ^^^ variable +# ^^ function +# ^^ punctuation.bracket +# ^ operator +# ^^^ variable # We can't really test multiline strings completely since check comments only # apply to one line above, but should be okay here -foo := "a" +foo0 := "a" # <- variable -# ^^ operator -# ^^^ string +# ^^ operator +# ^^^ string -bar := "b +bar0 := "b c " # <- string -baz := "a\"\t" +baz0 := "a\"\t" # <- variable -# ^ operator -# ^^ string -# ^^^^ constant.character.escape -# ^ string +# ^ operator +# ^^ string +# ^^^^ constant.character.escape +# ^ string -foo := """a""" +foo1 := """a""" # <- variable -# ^^ operator -# ^^^^^^^ string +# ^^ operator +# ^^^^^^^ string -bar:= """b +bar1:= """b c """ # <- string -baz := """ +baz1 := """ abc \t def \" \"""" # <- constant.character.escape # ^^^ string -foo := 'a' +foo2 := 'a' # <- variable # ^^ operator # ^^^ string -bar := 'b +bar2 := 'b c ' # <- string -baz := 'a\"\t' +baz2 := 'a\"\t' # <- variable # ^^ operator # ^^^ string -foo := '''a''' +foo3 := '''a''' # <- variable # ^^ operator # ^^^^^^^ string -bar:= '''b +bar3 := '''b c ''' # <- string -baz := '''' +baz3 := '''' abc \t def \" ''' # <- string -foo := if a == "x" { +foo4 := `echo hi` +bar4 := `echo hi + echo bye +` + +foo5 := ```echo hi``` # <- variable # ^^ operator -# ^^^^^^^ string - "val" -} else if "1" != "2" { - foo_fn("val") -} else { val } -export foo := "abc" -# <- keyword -# ^^^ variable -# ^^ operator +bar5 := ``` +echo bye +``` + +foo4 := if foo == "x" { "val" } else if "1" != "2" { env("val") } else { bar } +# <- variable +# ^^ operator +# ^^ keyword.control.conditional +# ^^^ variable +# ^^ operator +# ^^^ string +# ^ punctuation.bracket +# ^^^^^ string +# ^ punctuation.bracket +# ^^^^ keyword.control.conditional +# ^^ keyword.control.conditional +# ^^^ string +# ^^ operator +# ^^^ string +# ^ punctuation.bracket +# ^^^ function +# ^ punctuation.bracket +# ^^^^^ string +# ^ punctuation.bracket +# ^^^^ keyword.control.conditional +# ^^^ variable + +foo_fn := env("abc", foo) +# <- variable +# ^^ operator +# ^^^ function +# ^ punctuation.bracket # ^^^^ string +# ^ punctuation.delimiter +# ^^^ variable +# ^ punctuation.bracket + -import 'foo/bar.just' +export fooexp := "abc" # <- keyword -# ^^^^^^^^^^^^^ string +# ^^^^^^ variable +# ^^ operator +# ^^^^ string import? 'baz.just' # <- keyword # ^ operator # ^^^^^^^^^^ string -mod foo -# <- keyword -# ^^^ namespace - -mod bar 'PATH' +mod? foomod # <- keyword -# ^^^ namespace +# ^ operator +# ^^^^^^ namespace -mod? baz +mod barmod 'recipes.just' # <- keyword -# ^ operator -# ^^^ namespace +# ^^^^^^ namespace +# ^^^^^ string mod? qux "PATH" # <- keyword @@ -148,14 +182,14 @@ mod? qux "PATH" # ^^^ namespace # ^^^^^ string -set SOME_BOOL -set FOO := true set dotenv-load +set fallback := false set tempdir := "/tmp/just" set shell := ["powershell.exe", "-c"] # comment # <- comment -foo := bar # + baz -# ^ comment +foo_cmt := bar # + baz +# <- variable +# ^ comment