From 5d5e644761f07b5b93715bb78b40c6f5f41c6df4 Mon Sep 17 00:00:00 2001 From: Alexander Brevig Date: Wed, 10 Apr 2024 12:23:59 +0200 Subject: [PATCH 1/3] feat(lang): add LDIF support --- book/src/generated/lang-support.md | 1 + languages.toml | 13 +++++++++++++ runtime/queries/ldif/highlights.scm | 21 +++++++++++++++++++++ 3 files changed, 35 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 fb1c7bd5a473..24bf3eece405 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 6e0ad97bdbd4..6d34453d9555 100644 --- a/languages.toml +++ b/languages.toml @@ -3497,3 +3497,16 @@ 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 = [ + { glob = "*.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 000000000000..982c9a71be66 --- /dev/null +++ b/runtime/queries/ldif/highlights.scm @@ -0,0 +1,21 @@ +(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 + +(ERROR) @error From 6dc43efe39daa354c50f0ff83154ac7b0e15f362 Mon Sep 17 00:00:00 2001 From: Alexander Brevig Date: Thu, 11 Apr 2024 09:00:30 +0200 Subject: [PATCH 2/3] style: no unnecessary glob --- languages.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/languages.toml b/languages.toml index 6d34453d9555..d73286f8a1f3 100644 --- a/languages.toml +++ b/languages.toml @@ -3502,9 +3502,7 @@ source = { git = "https://github.com/adl-lang/tree-sitter-adl", rev = "2787d04be name = "ldif" scope = "source.ldif" injection-regex = "ldif" -file-types = [ - { glob = "*.ldif" }, -] +file-types = ["ldif"] comment-token = "#" [[grammar]] From c8f33664976c42d4ab350e52ff5acc51612e4785 Mon Sep 17 00:00:00 2001 From: Alexander Brevig Date: Thu, 11 Apr 2024 14:44:57 +0200 Subject: [PATCH 3/3] Update runtime/queries/ldif/highlights.scm Co-authored-by: Michael Davis --- runtime/queries/ldif/highlights.scm | 2 -- 1 file changed, 2 deletions(-) diff --git a/runtime/queries/ldif/highlights.scm b/runtime/queries/ldif/highlights.scm index 982c9a71be66..882ace9fce56 100644 --- a/runtime/queries/ldif/highlights.scm +++ b/runtime/queries/ldif/highlights.scm @@ -17,5 +17,3 @@ (change_modify) @string (value_spec) @keyword - -(ERROR) @error