Skip to content

Commit

Permalink
Udpate
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jan 4, 2024
1 parent bbe7f5a commit cf0058d
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 52 deletions.
8 changes: 6 additions & 2 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
(string) @string


(comment) @comment
(comment) @comment.line

; (interpolation) @string

Expand All @@ -80,6 +80,10 @@

["@" "==" "!=" "+" ":=" "*" ":" "/" "?"] @operator

[ "(" ")" "[" "]" "{{" "}}" "{" "}"] @punctuation.bracket
["(" ")" "[" "]" "{{" "}}" "{" "}"] @punctuation.bracket

["," ":"] @punctuation.delimiter

"`" @punctuation.special

(ERROR) @error
1 change: 1 addition & 0 deletions test/highlight/recipes.just
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ corge +quux: baz (quux quux)
# ^ punctuation.bracket
# FIXME function

osdioj: a

[private]
a:
134 changes: 84 additions & 50 deletions test/highlight/statements.just
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env just
# <- comment

foo := "abc"
# <- variable
# ^^ operator
Expand Down Expand Up @@ -26,136 +29,167 @@ 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
# ^ operator
# ^^^ 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

0 comments on commit cf0058d

Please sign in to comment.