diff options
| author | TravonteD <tman1300@aol.com> | 2020-09-15 22:24:33 -0400 |
|---|---|---|
| committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-09-18 17:09:43 +0200 |
| commit | c366a041c8dd09fd6e6b3a9e1a8b8574e118ef8c (patch) | |
| tree | c5703f5ae603661ef7228515b74d92ebb5a243ae | |
| parent | move the generic "constant" capture to the top (diff) | |
| download | nvim-treesitter-c366a041c8dd09fd6e6b3a9e1a8b8574e118ef8c.tar nvim-treesitter-c366a041c8dd09fd6e6b3a9e1a8b8574e118ef8c.tar.gz nvim-treesitter-c366a041c8dd09fd6e6b3a9e1a8b8574e118ef8c.tar.bz2 nvim-treesitter-c366a041c8dd09fd6e6b3a9e1a8b8574e118ef8c.tar.lz nvim-treesitter-c366a041c8dd09fd6e6b3a9e1a8b8574e118ef8c.tar.xz nvim-treesitter-c366a041c8dd09fd6e6b3a9e1a8b8574e118ef8c.tar.zst nvim-treesitter-c366a041c8dd09fd6e6b3a9e1a8b8574e118ef8c.zip | |
Add TSTag and TSTagDelimiter groups
These groups will be added for use with xml-like tags such as html and
jsx.
| -rw-r--r-- | CONTRIBUTING.md | 9 | ||||
| -rw-r--r-- | lua/nvim-treesitter/highlight.lua | 4 | ||||
| -rw-r--r-- | queries/html/highlights.scm | 4 |
3 files changed, 15 insertions, 2 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 11471969c..63613cbf2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -164,6 +164,15 @@ Mainly for markup languages. @text.uri ``` +#### Tags + +Used for xml-like tags + +``` +@tag +@tag.delimiter +``` + ### Locals ``` diff --git a/lua/nvim-treesitter/highlight.lua b/lua/nvim-treesitter/highlight.lua index 539f8a7c2..a458fd815 100644 --- a/lua/nvim-treesitter/highlight.lua +++ b/lua/nvim-treesitter/highlight.lua @@ -68,6 +68,10 @@ hlmap["text.title"] = "TSTitle" hlmap["text.literal"] = "TSLiteral" hlmap["text.uri"] = "TSURI" +-- Tags +hlmap["tag"] = "TSTag" +hlmap["tag.delimiter"] = "TSTagDelimiter" + hlmap["none"] = "TSNone" function M.attach(bufnr, lang) diff --git a/queries/html/highlights.scm b/queries/html/highlights.scm index 1e83ecf4c..38a06766b 100644 --- a/queries/html/highlights.scm +++ b/queries/html/highlights.scm @@ -1,4 +1,4 @@ -(tag_name) @type +(tag_name) @tag (erroneous_end_tag_name) @error (doctype) @constant (attribute_name) @property @@ -13,4 +13,4 @@ ">" "</" "/>" - ] @punctuation.bracket + ] @tag.delimiter |
