| Crates.io | whippyunits-lsp-proxy |
| lib.rs | whippyunits-lsp-proxy |
| version | 0.1.0 |
| created_at | 2025-11-17 00:40:53.120948+00 |
| updated_at | 2025-11-17 00:40:53.120948+00 |
| description | LSP proxy for enhanced whippyunits type display in IDEs |
| homepage | |
| repository | https://github.com/Oblarg/whippyunits |
| max_upload_size | |
| id | 1936065 |
| size | 154,769 |
This package provides the LSP proxy for enhancing the developer experience when working with whippyunits in IDEs.
The LSP proxy intercepts and enhances LSP messages for VS Code and other editors, providing readable type information for whippyunits types.
Note: The whippyunits-pretty CLI tool is a separate crate (whippyunits-pretty) that uses the same core type conversion logic from this library, ensuring consistent behavior across all development environments.
cargo build -p whippyunits-lsp-proxy --release
This builds the LSP proxy:
target/release/lsp-proxy - LSP integrationThe LSP proxy intercepts communication between your editor and rust-analyzer, transforming whippyunits types in:
Configure your editor to use the LSP proxy instead of rust-analyzer directly:
// VS Code settings.json
{
"rust-analyzer.server.path": "/path/to/target/release/lsp-proxy"
}
Set environment variables to control the display format:
WHIPPYUNITS_VERBOSE=true - Enable verbose output modeWHIPPYUNITS_UNICODE=false - Disable Unicode symbolsWHIPPYUNITS_INCLUDE_RAW=true - Include raw type informationThe whippyunits-pretty CLI tool is a separate crate that uses the same core type conversion logic from this library. See the whippyunits-pretty crate for documentation on using the CLI tool to pretty-print rustc compiler output.
| Original | Clean Mode | Verbose Mode |
|---|---|---|
Quantity<0, 9223372036854775807, 1, 0, 0, 9223372036854775807, 9223372036854775807, 9223372036854775807> |
Quantity<m; Length> |
Quantity<meter; Length; [mass⁰, length¹, time⁰, current⁰, temperature⁰, amount⁰, luminosity⁰, angle⁰] [2³²⁷⁶⁷, 3³²⁷⁶⁷, 5³²⁷⁶⁷, 10³²⁷⁶⁷, π⁰] f64> |
Quantity<1, 0, 0, 0, 0, 0, 0, 0> |
Quantity<kg; Mass> |
Quantity<kilogram; Mass; [mass¹, length⁰, time⁰, current⁰, temperature⁰, amount⁰, luminosity⁰, angle⁰] [2⁰, 3⁰, 5⁰, 10⁰, π⁰] f64> |
The library provides:
WhippyUnitsTypeConverter - Converts complex Quantity<...> types to readable formatsDisplayConfig - Configuration for output modes (verbose, unicode, raw)LspProxy - Handles LSP message interception and transformationwhippyunits - The underlying units library with prettyprint capabilitieswhippyunits-proc-macros - Compile-time unit definitionswhippyunits-pretty - CLI tool for pretty-printing compiler output (uses this library)