mirror of https://github.com/Wilfred/difftastic/
feat: add queries for highlighting (#13)
parent
560a04f84d
commit
64da30ce70
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,33 @@
|
||||
; Properties
|
||||
;-----------
|
||||
|
||||
(bare_key) @property
|
||||
(quoted_key) @string
|
||||
|
||||
; Literals
|
||||
;---------
|
||||
|
||||
(boolean) @constant.builtin
|
||||
(comment) @comment
|
||||
(string) @string
|
||||
(integer) @number
|
||||
(float) @number
|
||||
(offset_date_time) @string.special
|
||||
(local_date_time) @string.special
|
||||
(local_date) @string.special
|
||||
(local_time) @string.special
|
||||
|
||||
; Punctuation
|
||||
;------------
|
||||
|
||||
"." @punctuation.delimiter
|
||||
"," @punctuation.delimiter
|
||||
|
||||
"=" @operator
|
||||
|
||||
"[" @punctuation.bracket
|
||||
"]" @punctuation.bracket
|
||||
"[[" @punctuation.bracket
|
||||
"]]" @punctuation.bracket
|
||||
"{" @punctuation.bracket
|
||||
"}" @punctuation.bracket
|
||||
@ -1,40 +1,15 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const generatePlayground = require("../tree-sitter/script/generate-playground");
|
||||
|
||||
generatePlayground("docs", {
|
||||
name: "TOML",
|
||||
example: `
|
||||
# This is a TOML document.
|
||||
|
||||
title = "TOML Example"
|
||||
|
||||
[owner]
|
||||
name = "Tom Preston-Werner"
|
||||
dob = 1979-05-27T07:32:00-08:00 # First class dates
|
||||
|
||||
[database]
|
||||
server = "192.168.1.1"
|
||||
ports = [ 8001, 8001, 8002 ]
|
||||
connection_max = 5000
|
||||
enabled = true
|
||||
|
||||
[servers]
|
||||
|
||||
# Indentation (tabs and/or spaces) is allowed but not required
|
||||
[servers.alpha]
|
||||
ip = "10.0.0.1"
|
||||
dc = "eqdc10"
|
||||
|
||||
[servers.beta]
|
||||
ip = "10.0.0.2"
|
||||
dc = "eqdc10"
|
||||
|
||||
[clients]
|
||||
data = [ ["gamma", "delta"], [1, 2] ]
|
||||
|
||||
# Line breaks are OK when inside arrays
|
||||
hosts = [
|
||||
"alpha",
|
||||
"omega"
|
||||
]
|
||||
`.trim()
|
||||
codeExample: fs.readFileSync(
|
||||
path.resolve(__dirname, "../examples/toml-lang.toml"),
|
||||
"utf8",
|
||||
),
|
||||
queryExample: fs.readFileSync(
|
||||
path.resolve(__dirname, "../queries/highlights.scm"),
|
||||
"utf8",
|
||||
),
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue