Open kalloc opened 6 months ago
How I use LSP
…
"solidity": {
"command": "nomicfoundation-solidity-language-server",
"trace.server": "verbose",
"trace.server.format": "json",
"args": [
"--stdio"
],
"filetypes": [
"solidity"
],
"rootPatterns": [
"foundry.toml",
"package.json",
".git"
],
}
…
The solution for me is to install tslib (pnpm add tslib -D), but I think if hardhat (pnpm run compile) works, LSP should work too.
I'm trying to use LSP with my Neovim setup and I got an error
Cannot find module 'tslib'
in one of the projects. After long inspection, I did a small repo that can reproduce the bug. As I learned, the problem was caused by using the typescript hardhat and includingdotenv
in hardhat.config.ts.The repo: https://github.com/kalloc/nomicfoundation-solidity-language-server-dotenv-bug
Full trace:
LSP Trace: https://gist.github.com/kalloc/3f971ac9c0be79c1ae775457d108b6e0