Skip to content

Commit

Permalink
Add Dune (OCaml build system) (#6814)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kisaragi-hiu authored Aug 29, 2024
1 parent c0d3f3b commit ebbedf0
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
63 changes: 63 additions & 0 deletions samples/Dune/filenames/dune-project
Original file line number Diff line number Diff line change
@@ -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 <jordojw@gmail.com>")

(maintainers
"Jordan Walke <jordojw@gmail.com>"
"Antonio Nuno Monteiro <anmonteiro@gmail.com>")

(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"))))
1 change: 1 addition & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions vendor/grammars/vscode-dune
Submodule vscode-dune added at cd0c20
31 changes: 31 additions & 0 deletions vendor/licenses/git_submodule/vscode-dune.dep.yml
Original file line number Diff line number Diff line change
@@ -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: []

0 comments on commit ebbedf0

Please sign in to comment.