Thank you for your interest in contributing to Gleeb! This guide will help you get started.
- Fork the repository (when it's moved to its own repo)
- Clone your fork locally
- Install dependencies:
npm install - Build the project:
npm run build - Run tests:
npm test(when tests are added)
# Clone the repository
git clone <your-fork-url>
cd gleeb
# Install dependencies
npm install
# Start development with watch mode
npm run watch
# In another terminal, test the server
npm start- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes in the
src/directory - Test your changes thoroughly
- Build the project:
npm run build - Commit your changes:
git commit -m "Add your feature" - Push to your fork:
git push origin feature/your-feature-name - Create a pull request
src/
├── server.ts # Main LSP server implementation
├── completion.ts # Code completion provider
├── diagnostics.ts # Diagnostic analysis
└── hover.ts # Hover information provider
To add a new Fern widget to the completion system:
-
Add to
completion.ts:private static fernWidgets = [ 'Text', 'Button', 'TextInput', 'YourNewWidget', // Add here // ... other widgets ];
-
Add documentation to
hover.ts:private static fernDocumentation = new Map<string, string>([ ['YourNewWidget', '```cpp\nYourNewWidget(config)\n```\n\nDescription of your widget.'], // ... other documentation ]);
To add a new Fern function:
-
Add to
completion.ts:private static fernFunctions = [ 'initialize', 'getWidth', 'yourNewFunction', // Add here // ... other functions ];
-
Add hover documentation in
hover.ts -
Add diagnostic rules in
diagnostics.tsif needed
To add new diagnostic checks:
- Edit
diagnostics.ts:public static validateDocument(document: TextDocument, settings: GleebSettings): Diagnostic[] { const diagnostics: Diagnostic[] = []; // Your new diagnostic check if (yourCondition) { diagnostics.push({ severity: DiagnosticSeverity.Warning, range: Range.create(Position.create(line, 0), Position.create(line, 0)), message: 'Your diagnostic message', source: 'gleeb' }); } return diagnostics; }
Use the provided test_example.cpp file to manually test LSP features:
# Start the server
./start-server.sh
# Open test_example.cpp in your LSP-compatible editor
# Test completion, diagnostics, and hover featuresWhen adding automated tests:
- Create test files in a
tests/directory - Use Jest for testing framework
- Test each LSP feature separately
- Mock LSP client interactions
- TypeScript: Use TypeScript for all source files
- Formatting: Use consistent formatting (consider adding Prettier)
- Comments: Add JSDoc comments for public methods
- Error Handling: Always handle errors gracefully
Follow conventional commit format:
feat: add new widget completion supportfix: resolve hover documentation issuedocs: update README with new featurestest: add completion provider testsrefactor: improve diagnostic performance
- All changes must be reviewed via pull request
- Tests must pass (when CI is set up)
- Documentation must be updated for new features
- Breaking changes must be clearly documented
- Version bump in
package.json - Update CHANGELOG (when added)
- Create release notes
- Publish to npm (when ready)
- Issues: Report bugs and request features via GitHub issues
- Discussions: Ask questions in GitHub discussions
- Discord: Join the Fern community Discord (link TBD)
- Go-to-definition support
- Find references functionality
- Workspace symbol search
- Code actions (quick fixes)
- Enhanced diagnostics
- Snippet support
- Multi-file analysis
- Configuration validation
- Performance optimizations
- Syntax highlighting grammar
- Documentation generation
- Plugin for other editors
- CI/CD pipeline
Be respectful, inclusive, and constructive in all interactions. We're building this together!
By contributing to Gleeb, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to Gleeb! 🎉