solidity-language-server

Crates.iosolidity-language-server
lib.rssolidity-language-server
version0.1.2
created_at2025-12-18 23:43:44.902289+00
updated_at2026-01-17 01:53:51.602501+00
descriptionA solidity language server with foundry's build process.
homepagehttps://github.com/mmsaki/solidity-language-server
repositoryhttps://github.com/mmsaki/solidity-language-server
max_upload_size
id1993850
size241,249
msakiart (mmsaki)

documentation

README

Solidity Language Server

Solidity lsp server using foundry's build process only.

Install

Install binary from crates.io

cargo install solidity-language-server

Usage

Start the LSP server using:

solidity-language-server

Optional Compilers Flags

[!info] Solar compiler (WIP) Solar is a solidity compiler, written in Rust by paradigmxyz. This implementation is not fully featured, only diagnostics for now it is still a work in progress.

  • Use --use-solar flag for lsp implementation using solar compiler, currently only diagnostics.
solidity-language-server --use-solar

LSP Features

General

  • initialize - Server initialization
  • initialized - Server initialized notification
  • shutdown - Server shutdown

Text Synchronization

  • textDocument/didOpen - Handle file opening
  • textDocument/didChange - Handle file content changes
  • textDocument/didSave - Handle file saving with diagnostics refresh
  • textDocument/didClose - Handle file closing
  • textDocument/willSave - File will save notification
  • textDocument/willSaveWaitUntil - File will save wait until

Diagnostics

  • textDocument/publishDiagnostics - Publish compilation errors and warnings via forge build
  • textDocument/publishDiagnostics - Publish linting errors and warnings via forge lint

Language Features

  • textDocument/definition - Go to definition
  • textDocument/declaration - Go to declaration
  • textDocument/references - Find all references
  • textDocument/documentSymbol - Document symbol outline (contracts, functions, variables, events, structs, enums, etc.)
  • textDocument/prepareRename - Prepare rename validation
  • textDocument/rename - Rename symbols across files
  • textDocument/formatting - Document formatting
  • textDocument/completion - Code completion
  • textDocument/hover - Hover information
  • textDocument/signatureHelp - Function signature help
  • textDocument/typeDefinition - Go to type definition
  • textDocument/implementation - Go to implementation
  • textDocument/documentHighlight - Document highlighting
  • textDocument/codeAction - Code actions (quick fixes, refactoring)
  • textDocument/codeLens - Code lens
  • textDocument/documentLink - Document links
  • textDocument/documentColor - Color information
  • textDocument/colorPresentation - Color presentation
  • textDocument/rangeFormatting - Range formatting
  • textDocument/onTypeFormatting - On-type formatting
  • textDocument/foldingRange - Folding ranges
  • textDocument/selectionRange - Selection ranges
  • textDocument/semanticTokens - Semantic tokens
  • textDocument/semanticTokens/full - Full semantic tokens
  • textDocument/semanticTokens/range - Range semantic tokens
  • textDocument/semanticTokens/delta - Delta semantic tokens

Workspace Features

  • workspace/symbol - Workspace-wide symbol search
  • workspace/didChangeConfiguration - Acknowledges configuration changes (logs only)
  • workspace/didChangeWatchedFiles - Acknowledges watched file changes (logs only)
  • workspace/didChangeWorkspaceFolders - Acknowledges workspace folder changes (logs only)
  • workspace/applyEdit - Apply workspace edits
  • workspace/executeCommand - Execute workspace commands (stub implementation)
  • workspace/willCreateFiles - File creation preview
  • workspace/willRenameFiles - File rename preview
  • workspace/willDeleteFiles - File deletion preview

Window Features

  • window/showMessage - Show message to user
  • window/showMessageRequest - Show message request to user
  • window/workDoneProgress - Work done progress

Future improvements

  • Solc / Forge build ast issues
    • No ast nodes supported for yul
    • Struct defined types e.g. Lib.Sturct nameLocations are not identified as separate ast nodes
      • This makes renaming, and references for Lib not show up in Lib.Struct type usage
  • Solar's hir and inmemory ast replacement for our ast_cache
    • Currently still in production
    • You can try add --use-solar for lsp that uses solar for ast production
Commit count: 52

cargo fmt