feat: language support for mail files (#12945)

This commit is contained in:
Daniel Fichtinger 2025-02-26 18:33:36 -05:00 committed by GitHub
parent 26cb3c20e7
commit bb3af143f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 52 additions and 0 deletions

View file

@ -134,6 +134,7 @@
| log | ✓ | | | |
| lpf | ✓ | | | |
| lua | ✓ | ✓ | ✓ | `lua-language-server` |
| mail | ✓ | ✓ | | |
| make | ✓ | | ✓ | |
| markdoc | ✓ | | | `markdoc-ls` |
| markdown | ✓ | | | `marksman`, `markdown-oxide` |

View file

@ -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"

View 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

View 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)