Enhance your Zed editor with Solidity language support through this extension.
git clone https://github.com/zarifpour/zed-solidity
Move the zed-solidity
directory to ~/Library/Application Support/Zed/extensions/installed
.
(Optional) To ensure seamless updates from the extensions page upon the release of a new version, consider renaming the directory to solidity
.
First, navigate to the relocated repository in ~/Library/Application Support/Zed/extensions/installed
:
cd zed-solidity
Run the following command:
make
That was easy!
- Clone the
tree-sitter-solidity
repository:
git clone https://github.com/JoranHonig/tree-sitter-solidity
- Checkout the commit specified in
grammars/solidity.toml
:
git checkout 5cb506ae419c4ad620c77210fd47500d3d169dbc
- Move into the
tree-sitter-solidity
directory:
cd tree-sitter-solidity
- Build the WebAssembly (WASM) file (ensure Docker is running):
tree-sitter build-wasm
-
Rename the generated WASM file to
solidity.wasm
. -
Relocate the
solidity.wasm
file to thezed-solidity/grammars
directory within this repository. -
Remove the
solidity.toml
file from thezed-solidity/grammars
directory.
Run the following command in Zed to reload extensions:
zed: reload extensions
Try opening a .sol
file in Zed. You should see syntax highlighting.
Note
If you still do not see syntax highlighting, try quitting Zed and restarting the application.
Contributions are welcome! Note that some features, like 'Go to Definition', are not fully supported yet. We encourage enhancements and fixes.
To contribute:
- Fork the repo and create a new branch.
- Make changes and test them.
- Submit a pull request with a clear description.
Check open issues for areas needing improvement. Thanks for helping improve Solidity support in Zed!
- @JoranHonig for providing the tree-sitter-solidity repository.
- @meetmangukiya and @tomholford for inspiration with their PRs to the main Zed repo.
Made with ๐ฉต by Daniel Zarifpour