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

Error? trying to run gopls.exe #134

Open
dineth-lochana opened this issue Jul 30, 2024 · 11 comments
Open

Error? trying to run gopls.exe #134

dineth-lochana opened this issue Jul 30, 2024 · 11 comments

Comments

@dineth-lochana
Copy link

dineth-lochana commented Jul 30, 2024

Hello,
I've built gopls from scratch and installed lite-xl-lsp as described in the repo. It doesn't seem to be working for me.
Running 'gopls' from my cmd starts it up. So that seems to be it.

image

I have this in my init.lua
"
local lspconfig = require "plugins.lsp.config"
lspconfig.gopls.setup()
"

I have not added anything to my config.lua in lsp

OS := Windows 10 LTSB 64 Bit
Lite-Xl Version:= 2.1.1

@dineth-lochana
Copy link
Author

lspconfig.gopls = add_lsp {
name = "gopls",
language = "go",
file_patterns = { "%.go$" },
command = { "gopls", "serve" },
verbose = true,
quit_timeout = 180
}

I've change my config to this, and now I get this
image

It seems to be stuck reloading still.. Sigh...

@dineth-lochana
Copy link
Author

dineth-lochana commented Jul 30, 2024

I though that recent gopls versions might have done something to break compatability, so I tried to build and use gopls 0.14, 12, and 10 but no cigar, they all keep restarting everytime I do something.

@dineth-lochana
Copy link
Author

Honestly pretty stumped by now.

@dineth-lochana
Copy link
Author

#43
The same issue seems to be visible here as well. Seems that seems to be unsolved. Welp...

@dineth-lochana
Copy link
Author

#31
Then again this shows gopls from working, so my idea is to use gopls and lite-xl-lsp from around 2022 to see if that's the case.

@dineth-lochana
Copy link
Author

dineth-lochana commented Jul 30, 2024

gopls/v0.9.5
Gopls 9.5 works! but only it seems to work!
Gopls 10.x and onwards don't seem to work at all for me, can anybody else confirm this

@Guldoman
Copy link
Member

My first guess: you're on windows, what happens if you use .exe after the name?
Is the gopls executable an actual executable? Is it a batch script?

@dineth-lochana
Copy link
Author

dineth-lochana commented Jul 31, 2024

When I use both gopls and gopls.exe it starts and waits for input. I even moved the exe around a few directories in my PATH to make sure it wasn't a problem. I built all the versions from source manually to an exe, and kept them all in my local Go -> bin directory.

image

I checked what the gopls command is calling

image

This is the exe it calls.

image

@Guldoman
Copy link
Member

If you set config.plugins.lsp.log_server_stderr = true, do you get more output?

@dineth-lochana
Copy link
Author

image
I set it like this

image
Ooh! It looks like it works now!

What I changed was, I switched back from go 1.22.5 to go 1.20.14.
gopls warns me about it as well.
I'm not sure if that was what made it all work, but it seems to work ok now...

@dineth-lochana
Copy link
Author

I'll test again with Go 1.22.5 when I get the chance.

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

2 participants