A Zed extension to provide Mojo language support with syntax highlighting and LSP integration.
- Syntax highlighting via tree-sitter
- Language Server Protocol (LSP) support
- Install the Magic Package Manager
- Clone this repository
- Open Zed and click "Install Dev Extension" from the extensions page
- Select the cloned repository
Configure the Language Server Protocol in your Zed settings:
{
"lsp": {
"mojo": {
"settings": {
"lsp_path": "/name/my-proj/.magic/envs/default/bin/mojo-lsp-server", // path to mojo-lsp-server
"args": ["--log=verbose"] // additional args
}
}
},
}
Enable formatting by adding following in zed setting :
{
"languages": {
"mojo": {
"formatter": {
"external": {
"command": "magic",
"arguments": ["run", "mojo", "format", "-q", "-"]
}
}
}
}
}
The extension uses tree-sitter-mojo for syntax highlighting.
Feedback and contributions are welcome! Please share your suggestions to help improve this extension.
Note
The Magic Package Manager is required for the LSP functionality to work properly.
Warning
This extension is not published to zed extension store, as it isn't stable and isn't completed yet.