compact-lsp is a Language Server Protocol (LSP) implementation for the Compact smart contract language, providing IDE features for editors that support LSP.
Note: This is an experimental project developed in my personal free time for educational purposes — primarily to learn how Language Server Protocol implementations work. While functional, it is not officially supported. Feedback and contributions are welcome!
Features
| Feature | Description |
|---|---|
| Diagnostics | Real-time syntax errors + compiler errors on save |
| Completion | Keywords, types, snippets, local and imported symbols |
| Hover | Documentation for keywords, types, and symbols |
| Go to Definition | Jump to symbol definitions (local and imported) |
| Find References | Find all usages of a symbol (local and cross-file) |
| Rename | Rename symbols across the workspace |
| Signature Help | Parameter hints while typing function calls |
| Semantic Tokens | Rich syntax highlighting |
| Document Symbols | Outline view (circuits, structs, enums, modules) |
| Formatting | Code formatting via format-compact |
Requirements
- Rust toolchain (for building)
compactccompiler (for diagnostics)
Building
cargo build --release
Binary: target/release/compact-lsp
Links
Related
- GitHub - 1NickPappas/compact.vim: Vim/Neovim plugin for Compact smart contract language (Midnight network) – syntax highlighting, tree-sitter support, and smart indentation – Vim/Neovim syntax highlighting