diff --git a/.gitmodules b/.gitmodules index 65d5ef54e2..504f16efa5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1302,9 +1302,6 @@ [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 @@ -1446,3 +1443,6 @@ [submodule "vendor/grammars/zephir-sublime"] path = vendor/grammars/zephir-sublime url = https://github.com/phalcon/zephir-sublime +[submodule "vendor/grammars/vscode-ocaml-platform"] + path = vendor/grammars/vscode-ocaml-platform + url = https://github.com/ocamllabs/vscode-ocaml-platform.git diff --git a/grammars.yml b/grammars.yml index 219734dcf1..c4329a076c 100644 --- a/grammars.yml +++ b/grammars.yml @@ -1163,7 +1163,7 @@ vendor/grammars/vscode-curry: - markdown.curry.codeblock - source.curry - source.icurry -vendor/grammars/vscode-dune: +vendor/grammars/vscode-ocaml-platform: - source.dune vendor/grammars/vscode-euphoria: - source.euphoria diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index b5eebfe281..0437cafbb8 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1674,7 +1674,9 @@ Dune: type: programming ace_mode: lisp filenames: + - dune-workspace - dune-project + - dune tm_scope: source.dune color: "#89421e" language_id: 754574151 diff --git a/samples/Dune/filenames/dune b/samples/Dune/filenames/dune new file mode 100644 index 0000000000..ae2ed22af9 --- /dev/null +++ b/samples/Dune/filenames/dune @@ -0,0 +1,101 @@ +(ocamllex + (modules reason_declarative_lexer)) + +; Use select.exe from janestreet/ppx_ast to choose ocaml_util.ml based on ocaml version + +(rule + (targets ocaml_util.ml) + (deps ocaml_util.cppo.ml) + (action + (run %{bin:cppo} -V OCAML:%{ocaml_version} %{deps} -o %{targets}))) + +(menhir + (flags --strict --inspection --unused-tokens --table --cmly) + (modules reason_parser)) + +; Previously, make preprocess. +; (rule +; (targets reason_parser.cmly reason_parser.ml reason_parser.mli) +; (deps reason_parser.mly) +; (action +; (run menhir --strict --inspection --infer +; --unused-tokens +; --fixed-exception +; --table +; --cmly reason_parser.mly))) + +(executables + (names menhir_error_processor) + (modules menhir_error_processor) + (libraries unix menhirSdk)) + +(rule + (targets reason_parser_explain_raw.ml) + (deps reason_parser.cmly) + (action + (with-stdout-to + %{targets} + (run ./menhir_error_processor.exe reason_parser.cmly)))) + +(rule + (targets reason_parser_recover.ml) + (deps reason_parser.cmly) + (action + (with-stdout-to + %{targets} + (run ../menhir-recover/main.exe reason_parser.cmly)))) + +(rule + (targets reason_syntax_util.ml) + (deps reason_syntax_util.cppo.ml) + (action + (run %{bin:cppo} -V OCAML:%{ocaml_version} %{deps} -o %{targets}))) + +(rule + (targets reason_syntax_util.mli) + (deps reason_syntax_util.cppo.mli) + (action + (run %{bin:cppo} -V OCAML:%{ocaml_version} %{deps} -o %{targets}))) + +(library + (name reason) + ; Uncomment to allow make coverage target to work + ; requires you to have run $ opam install bisect_ppx + ; (preprocess (pps (bisect_ppx))) + (public_name reason) + (wrapped false) + (flags + (:standard -w -9-52 -safe-string)) + (modules + ocaml_util + reason_syntax_util + reason_comment + reason_attributes + reason_layout + reason_heuristics + reason_location + reason_toolchain_conf + reason_toolchain_reason + reason_toolchain_ocaml + reason_toolchain + reason_config + reason_pprint_ast + reason_errors + reason_parser_def + reason_parser + reason_single_parser + reason_multi_parser + merlin_recovery + reason_recover_parser + reason_declarative_lexer + reason_lexer + reason_oprint + reason_parser_explain_raw + reason_parser_explain + reason_parser_recover) + (modules_without_implementation reason_parser_def) + (libraries + reason.ocaml-migrate-parsetree + menhirLib + reason.easy_format + ppxlib)) diff --git a/samples/Dune/filenames/dune-workspace b/samples/Dune/filenames/dune-workspace new file mode 100644 index 0000000000..182f25399f --- /dev/null +++ b/samples/Dune/filenames/dune-workspace @@ -0,0 +1,2 @@ +(lang dune 3.2) +(context default) diff --git a/vendor/README.md b/vendor/README.md index f2b1a53f67..ced0936d54 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -147,7 +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) +- **Dune:** [ocamllabs/vscode-ocaml-platform](https://github.com/ocamllabs/vscode-ocaml-platform) - **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 deleted file mode 160000 index cd0c2057c2..0000000000 --- a/vendor/grammars/vscode-dune +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cd0c2057c24253bf1bfefc804ef496a30213960c diff --git a/vendor/grammars/vscode-ocaml-platform b/vendor/grammars/vscode-ocaml-platform new file mode 160000 index 0000000000..1113a5dde0 --- /dev/null +++ b/vendor/grammars/vscode-ocaml-platform @@ -0,0 +1 @@ +Subproject commit 1113a5dde0282f074a53f865c9d2a99f8cd5b9ea diff --git a/vendor/licenses/git_submodule/vscode-dune.dep.yml b/vendor/licenses/git_submodule/vscode-dune.dep.yml deleted file mode 100644 index 6cc5147f1b..0000000000 --- a/vendor/licenses/git_submodule/vscode-dune.dep.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -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: [] diff --git a/vendor/licenses/git_submodule/vscode-ocaml-platform.dep.yml b/vendor/licenses/git_submodule/vscode-ocaml-platform.dep.yml new file mode 100644 index 0000000000..7d42f96742 --- /dev/null +++ b/vendor/licenses/git_submodule/vscode-ocaml-platform.dep.yml @@ -0,0 +1,25 @@ +--- +name: vscode-ocaml-platform +version: 1113a5dde0282f074a53f865c9d2a99f8cd5b9ea +type: git_submodule +homepage: https://github.com/ocamllabs/vscode-ocaml-platform.git +license: isc +licenses: +- sources: LICENSE + text: | + ISC License + + Copyright (c) 2019 OCaml Labs + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +notices: []