From 7bce91556afd2430c336f2fe4a6ce3f7ce555be2 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 25 Jan 2022 00:50:34 -0600 Subject: [PATCH] add tree-sitter-iex (#1576) * add tree-sitter-iex * run docgen task * fix url for iex submodule --- .gitmodules | 4 ++++ book/src/generated/lang-support.md | 1 + helix-syntax/languages/tree-sitter-iex | 1 + languages.toml | 7 +++++++ runtime/queries/iex/highlights.scm | 1 + runtime/queries/iex/injections.scm | 6 ++++++ 6 files changed, 20 insertions(+) create mode 160000 helix-syntax/languages/tree-sitter-iex create mode 100644 runtime/queries/iex/highlights.scm create mode 100644 runtime/queries/iex/injections.scm diff --git a/.gitmodules b/.gitmodules index 780d1b63..247ac276 100644 --- a/.gitmodules +++ b/.gitmodules @@ -214,3 +214,7 @@ path = helix-syntax/languages/tree-sitter-elm url = https://github.com/elm-tooling/tree-sitter-elm shallow = true +[submodule "helix-syntax/languages/tree-sitter-iex"] + path = helix-syntax/languages/tree-sitter-iex + url = https://github.com/elixir-lang/tree-sitter-iex + shallow = true diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index e4070117..eff82226 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -21,6 +21,7 @@ | graphql | ✓ | | | | | haskell | ✓ | | | `haskell-language-server-wrapper` | | html | ✓ | | | | +| iex | ✓ | | | | | java | ✓ | | | | | javascript | ✓ | | ✓ | `typescript-language-server` | | json | ✓ | | ✓ | | diff --git a/helix-syntax/languages/tree-sitter-iex b/helix-syntax/languages/tree-sitter-iex new file mode 160000 index 00000000..3ec55082 --- /dev/null +++ b/helix-syntax/languages/tree-sitter-iex @@ -0,0 +1 @@ +Subproject commit 3ec55082cf0be015d03148be8edfdfa8c56e77f9 diff --git a/languages.toml b/languages.toml index a589d7b8..02c64732 100644 --- a/languages.toml +++ b/languages.toml @@ -586,3 +586,10 @@ auto-format = true comment-token = "--" language-server = { command = "elm-language-server" } indent = { tab-width = 4, unit = " " } + +[[language]] +name = "iex" +scope = "source.iex" +injection-regex = "iex" +file-types = ["iex"] +roots = [] diff --git a/runtime/queries/iex/highlights.scm b/runtime/queries/iex/highlights.scm new file mode 100644 index 00000000..2847fbff --- /dev/null +++ b/runtime/queries/iex/highlights.scm @@ -0,0 +1 @@ +(prompt) @comment diff --git a/runtime/queries/iex/injections.scm b/runtime/queries/iex/injections.scm new file mode 100644 index 00000000..48863d9d --- /dev/null +++ b/runtime/queries/iex/injections.scm @@ -0,0 +1,6 @@ +((evaluation_block (prompt_line (expression) @injection.content)) + (#set! injection.language "elixir") + (#set! injection.combined)) + +((result) @injection.content + (#set! injection.language "elixir"))