emmy_lsp_types

Crates.ioemmy_lsp_types
lib.rsemmy_lsp_types
version0.1.0
created_at2025-10-14 05:49:05.418559+00
updated_at2025-10-14 05:49:05.418559+00
descriptionLSP types for Rust, with enhanced features and strict linting
homepage
repositoryhttps://github.com/EmmyLuaLs/emmy_lsp_types
max_upload_size
id1881727
size434,364
(CppCXY)

documentation

README

emmy_lsp_types

CI Crates.io Documentation

Language Server Protocol types for Rust - A fork of lsp-types with enhancements.

๐ŸŽฏ Overview

This library provides Rust types for the Language Server Protocol (LSP). It's a fork of the excellent lsp-types crate with additional features and improvements.

โœจ Key Differences from lsp-types

1. Modern URI Handling

  • โœ… Migrated from fluent-uri to the battle-tested url crate (100M+ downloads)
  • โœ… Built-in serde support without custom implementations
  • โœ… Full trait support: Hash, Eq, Ord, FromStr
  • โœ… 46 comprehensive URI tests covering Windows/Unix platforms

2. LSP 3.18 Protocol Support

  • โœ… SnippetTextEdit - Code snippet editing with tab stops
  • โœ… DocumentRangesFormattingParams - Format multiple ranges at once
  • โœ… OneOf3 enum - Three-way type unions

3. Enhanced Code Quality

  • โœ… Comprehensive Clippy configuration (all/pedantic/nursery)
  • โœ… Zero Clippy warnings with pragmatic allow rules
  • โœ… 78 tests with 100% pass rate
  • โœ… Platform-specific tests for Windows and Unix

๐Ÿ“ฆ Installation

Add this to your Cargo.toml:

[dependencies]
emmy_lsp_types = "0.1.0"

๐Ÿงช Testing

# Run all tests
cargo test

# Run with output
cargo test -- --nocapture

# Run specific test module
cargo test uri::test

๐Ÿ” Code Quality

This project maintains high code quality standards:

# Check formatting
cargo fmt --check

# Run Clippy (should produce 0 warnings)
cargo clippy --all-targets

# Build in release mode
cargo build --release

๐Ÿ“Š Test Coverage

  • 78 tests covering all major LSP types
  • 46 URI tests for cross-platform path handling
  • 9 formatting tests for LSP 3.18 features
  • Platform-specific tests using #[cfg(windows)] and #[cfg(unix)]

๐Ÿ› ๏ธ Development

Prerequisites

  • Rust 2024 edition or later
  • Cargo

Building

# Debug build
cargo build

# Release build
cargo build --release

# Run tests
cargo test

# Format code
cargo fmt

# Check lints
cargo clippy --all-targets

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Guidelines

  1. Run cargo fmt before committing
  2. Ensure cargo clippy --all-targets produces no warnings
  3. Add tests for new features
  4. Update documentation as needed

๐Ÿ“„ License

This project is licensed under the same terms as the original lsp-types crate.

๐Ÿ™ Acknowledgments

This project is a fork of lsp-types by the Gluon team. We're grateful for their excellent work on the original implementation.

Why Fork?

We created this fork to:

  • Modernize URI handling with the url crate
  • Add LSP 3.18 protocol support
  • Implement stricter code quality standards
  • Provide more comprehensive testing
  • Maintain faster iteration on new features

๐Ÿ”— Links

๐Ÿ“ˆ Status

  • โœ… All tests passing (78/78)
  • โœ… Zero Clippy warnings
  • โœ… LSP 3.18 support
  • โœ… Cross-platform tested
  • ๐Ÿšง Actively maintained
Commit count: 0

cargo fmt