From ebbedf06dc18e929104a4a3573ac43b43298a761 Mon Sep 17 00:00:00 2001 From: Kisaragi Hiu Date: Fri, 30 Aug 2024 01:13:34 +0900 Subject: [PATCH] Add Dune (OCaml build system) (#6814) * Add Dune * Remove dune-file which only has one use * Merge all Dune entries into the same languages Since they all share the same grammar, they should just be considered as one language. The grammar used also only defines one source.dune scope. * Reduce scope to just dune-project - `dune` is only used by a bit over 100 repositories (5 pages), the 1.8k in the search results isn't what we're counting here - The two workspace files have even fewer uses --- .gitmodules | 3 + grammars.yml | 2 + lib/linguist/languages.yml | 8 +++ samples/Dune/filenames/dune-project | 63 +++++++++++++++++++ vendor/README.md | 1 + vendor/grammars/vscode-dune | 1 + .../git_submodule/vscode-dune.dep.yml | 31 +++++++++ 7 files changed, 109 insertions(+) create mode 100644 samples/Dune/filenames/dune-project create mode 160000 vendor/grammars/vscode-dune create mode 100644 vendor/licenses/git_submodule/vscode-dune.dep.yml diff --git a/.gitmodules b/.gitmodules index d1c4643c51..7e22d7ba2e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1281,6 +1281,9 @@ [submodule "vendor/grammars/vscode-curry"] path = vendor/grammars/vscode-curry url = https://github.com/fwcd/vscode-curry +[submodule "vendor/grammars/vscode-dune"] + path = vendor/grammars/vscode-dune + url = https://github.com/maelvls/vscode-dune.git [submodule "vendor/grammars/vscode-euphoria"] path = vendor/grammars/vscode-euphoria url = https://github.com/OpenEuphoria/vscode-euphoria diff --git a/grammars.yml b/grammars.yml index c25205ca81..e36a9a50dc 100644 --- a/grammars.yml +++ b/grammars.yml @@ -1143,6 +1143,8 @@ vendor/grammars/vscode-curry: - markdown.curry.codeblock - source.curry - source.icurry +vendor/grammars/vscode-dune: +- source.dune vendor/grammars/vscode-euphoria: - source.euphoria vendor/grammars/vscode-fluent: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 32c3a9f8ed..7b96e2ceb6 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1669,6 +1669,14 @@ Dotenv: tm_scope: source.dotenv ace_mode: text language_id: 111148035 +Dune: + type: programming + ace_mode: lisp + filenames: + - dune-project + tm_scope: source.dune + color: "#89421e" + language_id: 754574151 Dylan: type: programming color: "#6c616e" diff --git a/samples/Dune/filenames/dune-project b/samples/Dune/filenames/dune-project new file mode 100644 index 0000000000..a9e1089a07 --- /dev/null +++ b/samples/Dune/filenames/dune-project @@ -0,0 +1,63 @@ +(lang dune 2.9) + +(name reason) + +(using menhir 2.0) + +(cram enable) + +(version 3.8.2) + +(generate_opam_files true) + +(source + (github reasonml/reason)) + +(authors "Jordan Walke ") + +(maintainers + "Jordan Walke " + "Antonio Nuno Monteiro ") + +(homepage "https://reasonml.github.io/") + +(bug_reports "https://github.com/reasonml/reason/issues") + +(license "MIT") + +(package + (name reason) + (synopsis "Reason: Syntax & Toolchain for OCaml") + (description + "Reason gives OCaml a new syntax that is remniscient of languages like\nJavaScript. It's also the umbrella project for a set of tools for the OCaml &\nJavaScript ecosystem.") + (depends + (ocaml + (and + (>= "4.03") + (< "5.2"))) + (ocamlfind :build) + (dune-build-info + (>= 2.9.3)) + (menhir + (>= "20180523")) + (merlin-extend + (>= "0.6")) + fix + ppx_derivers + (ppxlib + (>= "0.28.0")))) + +(package + (name rtop) + (synopsis "Reason toplevel") + (description + "rtop is the toplevel (or REPL) for Reason, based on utop (https://github.com/diml/utop).") + (depends + (ocaml + (and + (>= "4.03") + (< "5.2"))) + (reason + (= :version)) + (utop + (>= "2.0")))) diff --git a/vendor/README.md b/vendor/README.md index 78d7a7e420..71363f19a7 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -147,6 +147,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting - **Diff:** [textmate/diff.tmbundle](https://github.com/textmate/diff.tmbundle) - **Dockerfile:** [asbjornenge/Docker.tmbundle](https://github.com/asbjornenge/Docker.tmbundle) - **Dotenv:** [Alhadis/language-etc](https://github.com/Alhadis/language-etc) +- **Dune:** [maelvls/vscode-dune](https://github.com/maelvls/vscode-dune) - **Dylan:** [textmate/dylan.tmbundle](https://github.com/textmate/dylan.tmbundle) - **E-mail:** [mariozaizar/language-eml](https://github.com/mariozaizar/language-eml) - **EBNF:** [Alhadis/language-grammars](https://github.com/Alhadis/language-grammars) diff --git a/vendor/grammars/vscode-dune b/vendor/grammars/vscode-dune new file mode 160000 index 0000000000..cd0c2057c2 --- /dev/null +++ b/vendor/grammars/vscode-dune @@ -0,0 +1 @@ +Subproject commit cd0c2057c24253bf1bfefc804ef496a30213960c diff --git a/vendor/licenses/git_submodule/vscode-dune.dep.yml b/vendor/licenses/git_submodule/vscode-dune.dep.yml new file mode 100644 index 0000000000..6cc5147f1b --- /dev/null +++ b/vendor/licenses/git_submodule/vscode-dune.dep.yml @@ -0,0 +1,31 @@ +--- +name: vscode-dune +version: cd0c2057c24253bf1bfefc804ef496a30213960c +type: git_submodule +homepage: https://github.com/maelvls/vscode-dune.git +license: mit +licenses: +- sources: LICENSE + text: | + MIT License + + Copyright (c) 2019 Maƫl Valais + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +notices: []