We love your input! We want to make contributing to Zed as easy and transparent as possible, whether it's:
- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer
We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.
- Fork the repo and create your branch from
master
- If you've added code that should be tested, add tests
- If you've changed APIs, update the documentation
- Ensure the test suite passes
- Make sure your code lints
- Issue that pull request!
In short, when you submit code changes, your submissions are understood to be under the same Apache 2.0 License that covers the project. Feel free to contact the maintainers if that's a concern.
Report bugs using GitHub's issue tracker
We use GitHub issues to track public bugs. Report a bug by opening a new issue.
Great Bug Reports tend to have:
- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
-
Install prerequisites:
# Install Rust and Cargo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Install GNU tools (Ubuntu/Debian) sudo apt-get install build-essential # Or on macOS brew install gcc
-
Clone and build:
git clone https://github.com/zed-coding/zed-lang cd zed-lang make
-
Run tests (once we have them):
make test
zed-lang/
├── compiler/ # The Zed compiler (zedc)
│ ├── src/ # Compiler source code
│ └── tests/ # Compiler tests
├── zed-build/ # Build system tool
├── vscode/ # VSCode extension
├── examples/ # Example programs
├── docs/ # Documentation
└── tests/ # Integration tests
- Follow the standard Rust formatting guidelines
- Use
rustfmt
to format your code - Run
clippy
for additional lints:cargo clippy --all-targets --all-features
Currently, Zed has no formal test suite. If you're contributing, please help us establish a testing framework! We need:
- Unit tests for the compiler components
- Integration tests for full programs
- Test infrastructure setup
- CI configuration for automated testing
-
Lexer
- Token recognition
- String literal parsing
- Comment handling
- Error conditions
-
Parser
- AST construction
- Syntax validation
- Error recovery
- Edge cases
-
Code Generation
- Assembly output verification
- Function calling conventions
- Stack management
- String handling
-
Integration
- Full program compilation
- Build system functionality
- Error messages
- Edge cases
tests/
├── compiler/
│ ├── lexer/ # Lexer unit tests
│ ├── parser/ # Parser unit tests
│ └── codegen/ # Code generation tests
├── integration/ # Full program tests
└── examples/ # Example programs that should compile
If you're interested in helping establish the test framework, please:
- Open an issue to discuss testing approaches
- Propose a testing framework (e.g., Rust's built-in testing, custom framework)
- Submit a PR with initial test infrastructure
- Update documentation for any changed functionality
- Add documentation for new features
- Ensure code examples in documentation work
- Update docs/docs.md if necessary
-
Update your fork to the latest upstream:
git remote add upstream https://github.com/zed-coding/zed-lang.git git fetch upstream git checkout master git merge upstream/master
-
Create a feature branch:
git checkout -b feature-name
-
Commit your changes:
git commit -m "Description of changes"
-
Push to your fork:
git push origin feature-name
-
Open a Pull Request from your
feature-name
branch to ourmaster
branch
Your PR should:
- Include a description of changes
- Link any relevant issues
- Update documentation as needed
- Add or update tests (once we have them)
- Pass all CI checks (once we have them)
- Be welcoming to newcomers
- Be respectful of differing viewpoints and experiences
- Accept constructive criticism gracefully
- Focus on what is best for the community
By contributing, you agree that your contributions will be licensed under the Apache License, Version 2.0.