vscode-solidity
vscode-solidity copied to clipboard
Frequent Errors and Server Crashes with Solidity Language Server in VS Code
Description
I am experiencing frequent errors and crashes with the Solidity Language Server in Visual Studio Code, particularly when using the textDocument/hover
and textDocument/completion
functionalities. These issues significantly disrupt the development workflow. Below are the details of the errors and server behavior:
Errors Encountered
-
EISDIR: illegal operation on a directory, read
-
First Occurrence: 3:39:25 PM (during
textDocument/hover
) -
Second Occurrence: 3:40:26 PM (during
textDocument/completion
) - Error Message: Request failed with message: EISDIR: illegal operation on a directory, read
- Code: -32603
-
First Occurrence: 3:39:25 PM (during
-
Cannot read properties of null (reading 'getSelectedItem')
-
Timestamp: 3:39:34 PM (during
textDocument/hover
) - Error Message: Request failed with message: Cannot read properties of null (reading 'getSelectedItem')
- Code: -32603
-
Timestamp: 3:39:34 PM (during
-
[Info - 3:36:18 PM] Validating using the compiler selected: localFile
- [Info - 3:40:26 PM] Validating using the compiler selected: remote
- [Info - 3:40:27 PM] Connection to server got closed. Server will restart.
Server Behavior
- The server attempted to restart multiple times after encountering errors but eventually crashed and did not restart after the 5th crash within a 3-minute window.
Log Snippets
- Validation attempts using both local and remote compilers were noted before and after the errors occurred.
- The final message indicated that the server crashed 5 times in the last 3 minutes and would not be restarted.
Steps to Reproduce
- Open a `.sol file in Visual Studio Code with the Solidity extension enabled for this repo https://github.com/collectivexyz/revolution-protocol. Observe working compilation
- Open a
.t.sol
test file. Compilation breaks - Observe the errors and eventual server crash + inability to compile
Environment
- VS Code Version: 1.85.1
- Solidity Extension Version: 0.0.166
- Operating System: Mac OSX 13.5.1
Additional Context
These issues began occurring recently, disrupting the usual development process. Any insights or fixes for these problems would be greatly appreciated.
Hi, I have tested on the latest version, and everything seems fine now:
Many thanks.
Configuration is mono repo "checked"
unfortunately still happening for me as well. language server crashes for almost any action AFAICT
VS Code and Env Version Infos
Version: 1.86.1
Commit: 31c37ee8f63491495ac49e43b8544550fbae4533
Date: 2024-02-07T09:08:57.920Z (6 days ago)
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.2.0
Extension Version
v0.0169
Any repo example? @chapati23
newest version doesn't seem to fix this w/the repo I linked
i'm on an apple silicon mac if that makes a difference
if I edit .sol files it works fine
as soon as I open eg RevolutionBuilder.t.sol
it freezes, then the compiler switches from local to remote version and throws brief error, then the whole server crashes.
happy to hop on a discord/screenshare if that'd be helpful
for reference this is my vs code settings file
{
"solidity.defaultCompiler": "localFile",
"prettier.documentSelectors": ["**/*.sol"],
"solidity.packageDefaultDependenciesDirectory": "node_modules",
"solidity.enabledAsYouTypeCompilationErrorCheck": true,
"[solidity]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"solidity.enableLocalNodeCompiler": true,
"solidity.compileUsingLocalVersion": ".........../soljson-v0.8.22+commit.4fc1097e.js",
"solidity.compileUsingRemoteVersion": ""
}
@rocketman-21 I assume that your local path is correct and relative, to the root. Can you turn off mono repo in the settings?
Ok i did turn off mono repo and made it worse, I tested it in windows and ubuntu with similar settings to this, these are the workspace settings
Also I ensure in the workspace (just in case) I set it as in monorepo
"solidity.monoRepoSupport": true,
If you are still having problems, lets have a chat for sure :)
My config now is
"solidity.monoRepoSupport": true,
"solidity.compileUsingLocalVersion": "/Users/.../.../revolution-protocol/soljson-v0.8.22+commit.4fc1097e.js",
"solidity.defaultCompiler": "localFile"
I type something in AuctionHouse.sol
to make sure the compilation works
Then I open RevolutionBuilder.t.sol
and it bricks itself as soon as I start typing, no compile checking.
I'm a bit confused, were you able to get it working with monoRepoSupport set to true?
What's the best way to chat?
Yes I set It on monorepo, drop me a message in twitter or pm me in discord (in my profile)