We welcome contributions! Here's how to get started.
-
Install Rust (1.70 or later):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Clone the repository:
git clone https://github.com/shaharia-lab/code-navigator.git cd code-navigator -
Build the project:
cargo build
-
Run tests:
cargo test
-
Format code before committing:
cargo fmt
-
Lint code with Clippy:
cargo clippy -- -D warnings
-
Write tests for new features and bug fixes
-
Keep it simple: Avoid over-engineering, prefer clarity over cleverness
- Fork the repository
- Create a branch for your feature:
git checkout -b feature/my-feature - Make your changes and commit with clear messages
- Add tests for your changes
- Ensure all tests pass:
cargo test - Run fmt and clippy:
cargo fmt && cargo clippy - Push to your fork:
git push origin feature/my-feature - Open a Pull Request with a clear description of the changes
- New language support: Java, C++, Ruby, Rust, PHP, C#
- Performance improvements: Faster parsing, better memory usage
- Bug fixes: Check issues
- Query language: DSL for complex graph queries
- Advanced analysis: Cyclomatic complexity, dead code detection
- Documentation: Examples, tutorials, use cases
- Tests: Improve coverage, add integration tests
- Web UI: Interactive graph visualization
- IDE plugins: VS Code, IntelliJ, Vim
- Export formats: Additional visualization formats
To add a new language parser:
-
Add tree-sitter grammar to
Cargo.toml:tree-sitter-java = "0.23"
-
Create parser in
src/parser/:// src/parser/java.rs pub struct JavaParser { parser: Parser, } impl LanguageParser for JavaParser { fn parse_file(&mut self, content: &str, file_path: &Path) -> Result<Vec<Node>> { // Implementation } }
-
Update
src/parser/mod.rsto include new parser -
Add test fixtures in
tests/fixtures/java/ -
Add tests in
src/lib.rs
When reporting bugs, include:
- Code Navigator version:
code-navigator --version - Operating system: Linux, macOS, Windows
- Language and project size: e.g., "TypeScript, 5,000 files"
- Steps to reproduce: Clear steps to trigger the bug
- Expected vs actual behavior: What should happen vs what does happen
- Error messages: Full error output if available
Open an issue or start a discussion.
- Be respectful: Treat others with kindness and professionalism
- Be constructive: Provide helpful feedback and suggestions
- Be inclusive: Welcome contributors of all backgrounds and skill levels
- Be patient: Remember that everyone was a beginner once
By contributing, you agree that your contributions will be licensed under the MIT License.