Skip to content

Commit 7ce3e30

Browse files
shawashawapokey
authored
Add Elixir support (#57)
* Add Elixir support This PR (attempts) to add support for Elixir by adding the dependency on the official Elixir tree-sitter grammar. I've been unable to build this on any machine for some reason, it looks like Emscripten is failing on the linker step. I'd appreciate any insight and testing! The output is below; yarn was failing to even run `yarn add -D` due to the preinstall step: ``` $ make web-tree-sitter /Users/shawa/Projects/cursorless/vscode-parse-tree/.make-work/tree-sitter /Users/shawa/Projects/cursorless/vscode-parse-tree/.make-work/tree-sitter Unable to find image 'emscripten/emsdk:2.0.24' locally 2.0.24: Pulling from emscripten/emsdk 345e3491a907: Pull complete 57671312ef6f: Pull complete 5e9250ddb7d0: Pull complete 859aa499d6fa: Pull complete 04e009ac95c8: Pull complete 5bfdbd9279e5: Pull complete ac435eb7f4a4: Pull complete Digest: sha256:81ec54b7a096d28f24d906955dbf98ff336cca47658d980c243baa36f6484f9f Status: Downloaded newer image for emscripten/emsdk:2.0.24 cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/pic/libGL.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic/libGL.a" for subsequent builds) cache:INFO: - ok cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/pic/libal.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic/libal.a" for subsequent builds) cache:INFO: - ok cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/pic/libhtml5.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic/libhtml5.a" for subsequent builds) cache:INFO: - ok cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/pic/libc.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic/libc.a" for subsequent builds) cache:INFO: - ok cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/pic/libcompiler_rt.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic/libcompiler_rt.a" for subsequent builds) cache:INFO: - ok cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/pic/libc++-noexcept.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic/libc++-noexcept.a" for subsequent builds) cache:INFO: - ok cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/pic/libc++abi-noexcept.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic/libc++abi-noexcept.a" for subsequent builds) cache:INFO: - ok cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/pic/libdlmalloc.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic/libdlmalloc.a" for subsequent builds) cache:INFO: - ok cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/pic/libc_rt_wasm.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic/libc_rt_wasm.a" for subsequent builds) cache:INFO: - ok cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/pic/libsockets.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic/libsockets.a" for subsequent builds) cache:INFO: - ok emcc: error: undefined exported symbol: "___cxa_atexit" [-Wundefined] [-Werror] make: *** [vendor/web-tree-sitter/0.20.4/README.md] Error 1 error Command failed with exit code 2. ``` * Update yarn.lock Co-authored-by: shawa <[email protected]> Co-authored-by: Pokey Rule <[email protected]>
1 parent e47a89a commit 7ce3e30

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# For generating .wasm files for parsers
22
# See https://www.npmjs.com/package/web-tree-sitter
3-
LANGUAGES = agda bash c c-sharp clojure cpp css elm go haskell html java javascript json kotlin latex markdown php python query ruby rust scala scss sparql talon tsx typescript yaml
3+
LANGUAGES = agda bash c c-sharp clojure cpp css elm elixir go haskell html java javascript json kotlin latex markdown php python query ruby rust scala scss sparql talon tsx typescript yaml
44

55

66
# NOTE: Update the version number in the filepath for web-tree-sitter in package.json,

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"onLanguage:css",
3030
"onLanguage:csharp",
3131
"onLanguage:elm",
32+
"onLanguage:elixir",
3233
"onLanguage:go",
3334
"onLanguage:haskell",
3435
"onLanguage:html",
@@ -93,6 +94,7 @@
9394
"tree-sitter-cpp": "^0.19.0",
9495
"@elm-tooling/tree-sitter-elm": "github:elm-tooling/tree-sitter-elm#0aecfbf69f0c9bcdfada0f6f2c5398235c23949f",
9596
"tree-sitter-go": "^0.19.0",
97+
"tree-sitter-elixir": "github:elixir-lang/tree-sitter-elixir#b20eaa75565243c50be5e35e253d8beb58f45d56",
9698
"tree-sitter-haskell": "github:tree-sitter/tree-sitter-haskell#d6ccd2d9c40bdec29fee0027ef04fe5ff1ae4ceb",
9799
"tree-sitter-html": "^0.19.0",
98100
"tree-sitter-java": "github:tree-sitter/tree-sitter-java#ac14b4b1884102839455d32543ab6d53ae089ab7",

src/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const languages: {
1919
csharp: { module: "tree-sitter-c-sharp" },
2020
css: { module: "tree-sitter-css" },
2121
elm: { module: "tree-sitter-elm" },
22+
elixir: { module: "tree-sitter-elixir" },
2223
go: { module: "tree-sitter-go" },
2324
haskell: { module: "tree-sitter-haskell" },
2425
html: { module: "tree-sitter-html" },

yarn.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2444,6 +2444,12 @@ tree-sitter-css@^0.19.0:
24442444
dependencies:
24452445
nan "^2.14.1"
24462446

2447+
"tree-sitter-elixir@github:elixir-lang/tree-sitter-elixir#b20eaa75565243c50be5e35e253d8beb58f45d56":
2448+
version "0.19.0"
2449+
resolved "https://codeload.github.com/elixir-lang/tree-sitter-elixir/tar.gz/b20eaa75565243c50be5e35e253d8beb58f45d56"
2450+
dependencies:
2451+
nan "^2.15.0"
2452+
24472453
tree-sitter-go@^0.19.0:
24482454
version "0.19.1"
24492455
resolved "https://registry.yarnpkg.com/tree-sitter-go/-/tree-sitter-go-0.19.1.tgz#f23c84bff882eafa296ce2d307366e76f1f83e2d"

0 commit comments

Comments
 (0)