Skip to content
New issue

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

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

Already on GitHub? # to your account

Unexpected end of JSON input error #17

Open
leoluz opened this issue Dec 8, 2021 · 3 comments
Open

Unexpected end of JSON input error #17

leoluz opened this issue Dec 8, 2021 · 3 comments

Comments

@leoluz
Copy link
Contributor

leoluz commented Dec 8, 2021

I can't seem to get it working in my setup.

Im getting the following error from lsp logs in Neovim:

[ERROR][2021-12-08 15:04:28] .../vim/lsp/rpc.lua:417 "rpc" "golangci-lint-langserver" "stderr" "unexpected end of JSON input\n"

My configs:

Neovim: 0.6.0
golangci-lint-langserver: v0.0.6
running with lspconfig with standard config:

if not configs.golangcilsp then
  configs.golangcilsp = {
    default_config = {
      cmd = {"golangci-lint-langserver", "-debug", "true"},
      root_dir = lspconfig.util.root_pattern('.git', 'go.mod'),
      init_options = {
        command = { "golangci-lint", "run", "--enable-all", "--disable", "lll", "--out-format", "json" };
      }
    };
  }
end

lspconfig.golangcilsp.setup {
  filetypes = {'go'}
}
@nametake
Copy link
Owner

That log was output as golangci-lint command not found.

Please install golangci-lint.

And I appended it to the README.

Thank you!

@leoluz
Copy link
Contributor Author

leoluz commented Dec 11, 2021

I do have golangci-lint installed and it is part of my PATH:

$golangci-lint --version
golangci-lint has version 1.43.0 built from 861262b on 2021-11-02T20:54:42Z

@nametake
Copy link
Owner

Maybe it is caused by the lock of parallel execution.

https://github.com/golangci/golangci-lint/blob/d29d9f12395a9928a1b50e9c00f7c56db39bf655/pkg/commands/executor.go#L220-L221

If exist lock file, please delete it.

Or, please try to add --allow-parallel-runners to golangci-lint option.

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

No branches or pull requests

2 participants