Skip to content

Lay some groundwork for language plugins#3837

Merged
maxbrunsfeld merged 1 commit intomainfrom
wasm-language-plugins
Jan 3, 2024
Merged

Lay some groundwork for language plugins#3837
maxbrunsfeld merged 1 commit intomainfrom
wasm-language-plugins

Conversation

@maxbrunsfeld
Copy link
Copy Markdown
Collaborator

This PR adds undocumented functionality for loading custom language plugins at runtime. I don't intend to expose the functionality to end users yet, but this will allow the team to test the capability internally.

Implementation

There isn't much new code in Zed. Most of the work here is within Tree-sitter, in PRs tree-sitter/tree-sitter#1864 and tree-sitter/tree-sitter#2840, which allow Tree-sitter to load languages from WASM blobs. I've tested the functionality in Tree-sitter's test suite and via its CLI, but having it wired into Zed allows us to test the functionality more fully.

Details

Now, on startup, Zed will look for subdirectories inside of ~/Application Support/plugins. These subdirectories are expected to look similar to the per-language subdirectories in crates/zed2/src/languages, except that they also contain a .wasm file for the parser itself.

I'll add more details here as I go.

@JosephTLyons
Copy link
Copy Markdown
Collaborator

This is exciting! Nice work Max.

@maxbrunsfeld maxbrunsfeld marked this pull request as ready for review January 3, 2024 17:37
@maxbrunsfeld maxbrunsfeld merged commit b594e59 into main Jan 3, 2024
@maxbrunsfeld maxbrunsfeld deleted the wasm-language-plugins branch January 3, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants