From 009a5498ca14dfc083b3ff0ceec9231f3c917a98 Mon Sep 17 00:00:00 2001 From: Alexander Brevig Date: Thu, 11 Apr 2024 17:17:44 +0200 Subject: [PATCH] add LDIF support (#10330) * feat(lang): add LDIF support * style: no unnecessary glob * Update runtime/queries/ldif/highlights.scm Co-authored-by: Michael Davis --------- Co-authored-by: Michael Davis --- book/src/generated/lang-support.md | 1 + languages.toml | 11 +++++++++++ runtime/queries/ldif/highlights.scm | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 runtime/queries/ldif/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index fb1c7bd5a..24bf3eece 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -105,6 +105,7 @@ | kotlin | ✓ | | | `kotlin-language-server` | | latex | ✓ | ✓ | | `texlab` | | ld | ✓ | | ✓ | | +| ldif | ✓ | | | | | lean | ✓ | | | `lean` | | ledger | ✓ | | | | | llvm | ✓ | ✓ | ✓ | | diff --git a/languages.toml b/languages.toml index 6e0ad97bd..d73286f8a 100644 --- a/languages.toml +++ b/languages.toml @@ -3497,3 +3497,14 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "adl" source = { git = "https://github.com/adl-lang/tree-sitter-adl", rev = "2787d04beadfbe154d3f2da6e98dc45a1b134bbf" } + +[[language]] +name = "ldif" +scope = "source.ldif" +injection-regex = "ldif" +file-types = ["ldif"] +comment-token = "#" + +[[grammar]] +name = "ldif" +source = { git = "https://github.com/kepet19/tree-sitter-ldif", rev = "0a917207f65ba3e3acfa9cda16142ee39c4c1aaa" } diff --git a/runtime/queries/ldif/highlights.scm b/runtime/queries/ldif/highlights.scm new file mode 100644 index 000000000..882ace9fc --- /dev/null +++ b/runtime/queries/ldif/highlights.scm @@ -0,0 +1,19 @@ +(comment) @comment + +((distinguishedName + (name + (name_componet + (attributeTypeAndValue + (attributeType) @comment + (string) @type.parameter + )))) @comment) + + +(dn_spec) @constant +(changerecord) @constant +(mod_spec) @constant + +(attributeType) @type.parameter +(change_modify) @string + +(value_spec) @keyword