feat: language support for mail files (#12945)
This commit is contained in:
parent
26cb3c20e7
commit
bb3af143f1
4 changed files with 52 additions and 0 deletions
|
@ -134,6 +134,7 @@
|
|||
| log | ✓ | | | |
|
||||
| lpf | ✓ | | | |
|
||||
| lua | ✓ | ✓ | ✓ | `lua-language-server` |
|
||||
| mail | ✓ | ✓ | | |
|
||||
| make | ✓ | | ✓ | |
|
||||
| markdoc | ✓ | | | `markdoc-ls` |
|
||||
| markdown | ✓ | | | `marksman`, `markdown-oxide` |
|
||||
|
|
|
@ -1676,6 +1676,16 @@ injection-regex = "tablegen"
|
|||
name = "tablegen"
|
||||
source = { git = "https://github.com/Flakebi/tree-sitter-tablegen", rev = "3e9c4822ab5cdcccf4f8aa9dcd42117f736d51d9" }
|
||||
|
||||
[[language]]
|
||||
name = "mail"
|
||||
scope = "text.mail"
|
||||
file-types = ["eml"]
|
||||
injection-regex = "mail|eml|email"
|
||||
|
||||
[[grammar]]
|
||||
name = "mail"
|
||||
source = { git = "https://github.com/ficcdaf/tree-sitter-mail", rev = "8e60f38efbae1cc5f22833ae13c5500dd0f3b12f" }
|
||||
|
||||
[[language]]
|
||||
name = "markdown"
|
||||
scope = "source.md"
|
||||
|
|
28
runtime/queries/mail/highlights.scm
Normal file
28
runtime/queries/mail/highlights.scm
Normal file
|
@ -0,0 +1,28 @@
|
|||
; header fields
|
||||
[
|
||||
(header_field_email)
|
||||
(header_field_subject)
|
||||
(header_field)
|
||||
] @keyword
|
||||
|
||||
; delimited punctuation
|
||||
(header_separator) @punctuation.delimiter
|
||||
(email_delimiter) @punctuation.delimiter
|
||||
|
||||
; email subject contents
|
||||
(header_subject
|
||||
(subject) @markup.bold)
|
||||
; extra metadata headers
|
||||
(header_other
|
||||
(header_unstructured) @comment)
|
||||
|
||||
; Addressee Name (Firstname, Lastname, etc.)
|
||||
(atom) @variable
|
||||
|
||||
; Email Address
|
||||
(email) @string
|
||||
|
||||
; Quoted Reply
|
||||
(quote_marker) @punctuation.special
|
||||
(quote_contents) @markup.quote
|
||||
|
13
runtime/queries/mail/textobjects.scm
Normal file
13
runtime/queries/mail/textobjects.scm
Normal file
|
@ -0,0 +1,13 @@
|
|||
(atom_block
|
||||
(atom) @entry.inside) @entry.around
|
||||
|
||||
(email_address) @entry.around
|
||||
(header_other
|
||||
(header_unstructured) @entry.around)
|
||||
|
||||
(quoted_block)+ @comment.around
|
||||
|
||||
(body_block)+ @function.around
|
||||
|
||||
(header_subject
|
||||
(subject) @function.around)
|
Loading…
Add table
Reference in a new issue