Solidity Language Server
Solidy lsp server.
Install
Install binary from crates.io
Usage
Start the LSP server using:
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 viaforge build -
textDocument/publishDiagnostics- Publish linting errors and warnings viaforge 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/rename- Rename symbols across files -
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/formatting- Document formatting -
textDocument/rangeFormatting- Range formatting -
textDocument/onTypeFormatting- On-type formatting -
textDocument/prepareRename- Prepare rename validation -
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.SturctnameLocations are not identified as separate ast nodes- This makes renaming, and references for
Libnot show up inLib.Structtype usage
- This makes renaming, and references for