From 048973fc552fd8ccc7a8060d07b1078b7f090824 Mon Sep 17 00:00:00 2001 From: Christopher Kaster Date: Sun, 6 Oct 2024 21:53:12 +0200 Subject: [PATCH] Add support for dune project language (#11829) --- book/src/generated/lang-support.md | 1 + languages.toml | 17 +++++++++++++++++ runtime/queries/dune/highlights.scm | 1 + 3 files changed, 19 insertions(+) create mode 100644 runtime/queries/dune/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 79f3a6964..c5f79aa29 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -39,6 +39,7 @@ | dockerfile | ✓ | ✓ | | `docker-langserver` | | dot | ✓ | | | `dot-language-server` | | dtd | ✓ | | | | +| dune | ✓ | | | | | earthfile | ✓ | ✓ | ✓ | `earthlyls` | | edoc | ✓ | | | | | eex | ✓ | | | | diff --git a/languages.toml b/languages.toml index 806aa815e..9be8a0170 100644 --- a/languages.toml +++ b/languages.toml @@ -1243,6 +1243,23 @@ indent = { tab-width = 2, unit = " " } name = "ocaml-interface" source = { git = "https://github.com/tree-sitter/tree-sitter-ocaml", rev = "9965d208337d88bbf1a38ad0b0fe49e5f5ec9677", subpath = "interface" } +[[language]] +name = "dune" +scope = "source.dune" +roots = ["dune-project"] +file-types = [{ glob = "dune-project" }, { glob = "dune" }] +comment-token = ";" +indent = { tab-width = 1, unit = " " } +grammar = "scheme" +auto-format = true +formatter = { command = "dune", args = ["format-dune-file"] } + +[language.auto-pairs] +'(' = ')' +'{' = '}' +'[' = ']' +'"' = '"' + [[language]] name = "lua" injection-regex = "lua" diff --git a/runtime/queries/dune/highlights.scm b/runtime/queries/dune/highlights.scm new file mode 100644 index 000000000..e11eb7881 --- /dev/null +++ b/runtime/queries/dune/highlights.scm @@ -0,0 +1 @@ +; inherits: scheme