From 4207d7e652632e0dfb1d6a829ac182ab23dfbfc8 Mon Sep 17 00:00:00 2001 From: Dov Alperin Date: Tue, 5 Dec 2023 03:35:06 -0500 Subject: [PATCH] Add support for EdgeQL languages (#5780) * Add support for edgeql languages https://www.edgedb.com/docs/edgeql/index * Correct order * Fix order --------- Co-authored-by: Colin Seymour --- .gitmodules | 3 ++ grammars.yml | 2 ++ lib/linguist/languages.yml | 11 +++++++ samples/EdgeQL/default.esdl | 8 +++++ samples/EdgeQL/migration.edgeql | 12 +++++++ test/test_language.rb | 1 + vendor/README.md | 1 + vendor/grammars/edgedb-editor-plugin | 1 + .../edgedb-editor-plugin.dep.yml | 31 +++++++++++++++++++ 9 files changed, 70 insertions(+) create mode 100644 samples/EdgeQL/default.esdl create mode 100644 samples/EdgeQL/migration.edgeql create mode 160000 vendor/grammars/edgedb-editor-plugin create mode 100644 vendor/licenses/git_submodule/edgedb-editor-plugin.dep.yml diff --git a/.gitmodules b/.gitmodules index b1f2bbf4f..0dac6c83f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -437,6 +437,9 @@ [submodule "vendor/grammars/ecl-tmLanguage"] path = vendor/grammars/ecl-tmLanguage url = https://github.com/hpcc-systems/ecl-tmLanguage +[submodule "vendor/grammars/edgedb-editor-plugin"] + path = vendor/grammars/edgedb-editor-plugin + url = https://github.com/edgedb/edgedb-editor-plugin.git [submodule "vendor/grammars/eiffel.tmbundle"] path = vendor/grammars/eiffel.tmbundle url = https://github.com/textmate/eiffel.tmbundle diff --git a/grammars.yml b/grammars.yml index 41e9ed800..38a00c634 100644 --- a/grammars.yml +++ b/grammars.yml @@ -354,6 +354,8 @@ vendor/grammars/ec.tmbundle: - source.c.ec vendor/grammars/ecl-tmLanguage: - source.ecl +vendor/grammars/edgedb-editor-plugin: +- source.edgeql vendor/grammars/eiffel.tmbundle: - source.eiffel vendor/grammars/ejs-tmbundle: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index ff82c9a3b..c2fc588b6 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1743,6 +1743,17 @@ Ecmarkup: aliases: - ecmarkdown language_id: 844766630 +EdgeQL: + type: programming + color: "#31A7FF" + aliases: + - esdl + extensions: + - ".edgeql" + - ".esdl" + ace_mode: text + tm_scope: source.edgeql + language_id: 925235833 EditorConfig: type: data color: "#fff1f2" diff --git a/samples/EdgeQL/default.esdl b/samples/EdgeQL/default.esdl new file mode 100644 index 000000000..8ae731812 --- /dev/null +++ b/samples/EdgeQL/default.esdl @@ -0,0 +1,8 @@ +module default { + type Task { + required property text -> str; + required property completed -> bool{ + default := false; + }; + } +}; diff --git a/samples/EdgeQL/migration.edgeql b/samples/EdgeQL/migration.edgeql new file mode 100644 index 000000000..84f3969a8 --- /dev/null +++ b/samples/EdgeQL/migration.edgeql @@ -0,0 +1,12 @@ +CREATE MIGRATION m146naaaow4uwgbxpnjq5hyizixicxvg2ccpta24pxebzfn7xeppna + ONTO initial +{ + CREATE EXTENSION edgeql_http VERSION '1.0'; + CREATE EXTENSION graphql VERSION '1.0'; + CREATE TYPE default::Task { + CREATE REQUIRED PROPERTY completed -> std::bool { + SET default := false; + }; + CREATE REQUIRED PROPERTY text -> std::str; + }; +}; diff --git a/test/test_language.rb b/test/test_language.rb index 8fc42a866..0f781beeb 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -24,6 +24,7 @@ class TestLanguage < Minitest::Test assert_equal Language['Common Lisp'], Language.find_by_alias('lisp') assert_equal Language['Darcs Patch'], Language.find_by_alias('dpatch') assert_equal Language['Dart'], Language.find_by_alias('dart') + assert_equal Language['EdgeQL'], Language.find_by_alias('esdl') assert_equal Language['Emacs Lisp'], Language.find_by_alias('elisp') assert_equal Language['Emacs Lisp'], Language.find_by_alias('emacs') assert_equal Language['Emacs Lisp'], Language.find_by_alias('emacs-lisp') diff --git a/vendor/README.md b/vendor/README.md index 177047d25..bdc61638b 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -152,6 +152,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting - **Easybuild:** [MagicStack/MagicPython](https://github.com/MagicStack/MagicPython) - **Ecere Projects:** [Nixinova/NovaGrammars](https://github.com/Nixinova/NovaGrammars) - **Ecmarkup:** [Alhadis/language-etc](https://github.com/Alhadis/language-etc) +- **EdgeQL:** [edgedb/edgedb-editor-plugin](https://github.com/edgedb/edgedb-editor-plugin) - **EditorConfig:** [sindresorhus/atom-editorconfig](https://github.com/sindresorhus/atom-editorconfig) - **Edje Data Collection:** [textmate/c.tmbundle](https://github.com/textmate/c.tmbundle) - **Eiffel:** [textmate/eiffel.tmbundle](https://github.com/textmate/eiffel.tmbundle) diff --git a/vendor/grammars/edgedb-editor-plugin b/vendor/grammars/edgedb-editor-plugin new file mode 160000 index 000000000..56312c127 --- /dev/null +++ b/vendor/grammars/edgedb-editor-plugin @@ -0,0 +1 @@ +Subproject commit 56312c127054a627404ed89316e5f642f24e8586 diff --git a/vendor/licenses/git_submodule/edgedb-editor-plugin.dep.yml b/vendor/licenses/git_submodule/edgedb-editor-plugin.dep.yml new file mode 100644 index 000000000..b26d9a2af --- /dev/null +++ b/vendor/licenses/git_submodule/edgedb-editor-plugin.dep.yml @@ -0,0 +1,31 @@ +--- +name: edgedb-editor-plugin +version: 56312c127054a627404ed89316e5f642f24e8586 +type: git_submodule +homepage: https://github.com/edgedb/edgedb-editor-plugin.git +license: mit +licenses: +- sources: LICENSE + text: | + The MIT License + + Copyright (c) 2015-present MagicStack Inc. http://magic.io + + 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: []