-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
46 lines (36 loc) · 1.07 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
generate:
npx tree-sitter generate
highlight: generate
clear
npx tree-sitter highlight ./test/showcase.d2
parse: generate
clear
npx tree-sitter parse test.d2
dparse: generate
clear
npx tree-sitter parse test.d2 -d
Dparse: generate
clear
npx tree-sitter parse test.d2 -D
test: generate
clear
npx tree-sitter test
# The `watch-*` commands utilize an excellent tool called `watchexec`, a
# hot-reload CLI tool. It allows you to re-execute tests or highlights
# automatically upon saving (while running them in a separate window, tab,
# pane, etc.), eliminating the need to manually type `make test` each time.
#
# Installation instructions:
# https://github.com/watchexec/watchexec/blob/main/doc/packages.md
watch-hl:
watchexec --exts d2,js,scm -- make highlight
watch-parse:
watchexec --exts d2,js,scm,txt -- make parse
watch-test:
watchexec --exts d2,js,scm,txt -- make test
# Do not use this, this is for temporary testing until I find a better way to
# inject queries.
.PHONY: queries
queries:
mkdir -p ~/.config/nvim/queries/d2/
cp queries/* ~/.config/nvim/queries/d2/