neovim / nvim-lspconfig

Quickstart configs for Nvim LSP
Apache License 2.0
10.48k stars 2.06k forks source link

LSP[solc] not functional #2478

Open zeroknots opened 1 year ago

zeroknots commented 1 year ago

Description

Trying to use solc LSP in lazyvim simply installed solc lsp, and it throws error with every character I type

LSP[solc]: Error INVALID_SERVER_MESSAGE: {
  error = {
    code = -32803,
    message = "Unknown file: file:///Users/ops/work/*****/foundry/playground/src/Counter.sol"
  },
  jsonrpc = "2.0"

Neovim version

NVIM v0.8.0 Build type: Release LuaJIT 2.1.0-beta3

Nvim-lspconfig version

91998cef4b1ae3a624901d0f9c894409db24e760

Operating system and version

MacOS 12.6

Affected language servers

solc

Steps to reproduce

  1. install solc
  2. mkdir foobar
  3. forge init
  4. nvim ./src/Counter.sol
  5. type anything in nvim
  6. -> errors appear as documentented below

Actual behavior

LSP[solc]: Error INVALID_SERVER_MESSAGE: { error = { code = -32803, message = "Unknown file: file:///Users/ops/work/*****/foundry/playground/src/Counter.sol" }, jsonrpc = "2.0"

Expected behavior

No response

Minimal config

:LspInstall solc

LSP log

-

glepnir commented 1 year ago

looks like the server not handle the schema + filename.

zeroknots commented 1 year ago

@glepnir is there anything I can do to config this?

dalechyn commented 1 year ago

I also confirm this bug with trying to get solc --lsp working in the nvim environment.

iFrostizz commented 1 year ago

You can use the hardhat solidity extension which is to date probably the best one: https://github.com/NomicFoundation/hardhat-vscode/pull/362