| Crates.io | forge-lsp |
| lib.rs | forge-lsp |
| version | 0.0.7 |
| created_at | 2025-12-09 00:39:09.119086+00 |
| updated_at | 2025-12-15 20:23:38.874216+00 |
| description | Language Server Protocol implementation for Solidity |
| homepage | https://github.com/mmsaki/forge-lsp |
| repository | https://github.com/mmsaki/forge-lsp |
| max_upload_size | |
| id | 1974619 |
| size | 188,693 |
A Language Server Protocol (LSP) implementation for Solidity development using Foundry's compilation and linting infrastructure.
This work is a continuation from foundry-rs/foundry PR #11187.
Install binary from crates.io
cargo install forge-lsp
Start the LSP server using:
forge-lsp --stdio
cargo build --release
cargo test
You can add the following to VSCode (or cursor) using a lsp-proxy extension see comment here:
[
{
"languageId": "solidity",
"command": "forge-lsp",
"fileExtensions": [
".sol"
],
}
]
If you have neovim 0.11+ installed add these to your config
-- lsp/forge_lsp.lua
return {
cmd = { "forge-lsp" },
filetypes = { "solidity" },
root_markers = { "foundry.toml", ".git" },
root_dir = vim.fs.root(0, { "foundry.toml", ".git" }),
}
-- init.lua
vim.lsp.enable("forge_lsp")
Lsp logs are stored in ~/.local/state/nvim/lsp.log
To clear lsp logs run:
> -f ~/.local/state/nvim/lsp.log
To monitor logs in real time run:
tail -f ~/.local/state/nvim/lsp.log
Enable traces in neovim to view full traces in logs:
:lua vim.lsp.set_log_level("trace")
Check out the foundry contribution guide.