Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frequent Errors and Server Crashes with Solidity Language Server in VS Code #446

Open
rocketman-21 opened this issue Feb 7, 2024 · 10 comments

Comments

@rocketman-21
Copy link

rocketman-21 commented Feb 7, 2024

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

  1. 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
  2. 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
  3. [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

  1. 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
  2. Open a .t.sol test file. Compilation breaks
  3. 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.

@juanfranblanco
Copy link
Owner

Hi, I have tested on the latest version, and everything seems fine now:
image
image

Many thanks.

Configuration is mono repo "checked"

@chapati23
Copy link

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

@juanfranblanco
Copy link
Owner

Any repo example? @chapati23

@rocketman-21
Copy link
Author

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

@rocketman-21
Copy link
Author

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": ""
}

@juanfranblanco
Copy link
Owner

@rocketman-21 I assume that your local path is correct and relative, to the root. Can you turn off mono repo in the settings?

@juanfranblanco
Copy link
Owner

juanfranblanco commented Feb 14, 2024

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

image
Also I ensure in the workspace (just in case) I set it as in monorepo

"solidity.monoRepoSupport": true,

@juanfranblanco
Copy link
Owner

If you are still having problems, lets have a chat for sure :)

@rocketman-21
Copy link
Author

rocketman-21 commented Feb 15, 2024

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?

@juanfranblanco
Copy link
Owner

Yes I set It on monorepo, drop me a message in twitter or pm me in discord (in my profile)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants