
Gopls: Language server protocol implementation for Go - ra7
https://github.com/golang/go/wiki/gopls
======
donio
I use this fork:
[https://github.com/saibing/tools](https://github.com/saibing/tools) which has
a bunch of features ported over from bingo (which is another LSP backend for
Go). References support is the important one for me.

------
atombender
Gopls is great, but it's still alpha quality, in my opinion.

I've tried using it with VSCode this week, and it frequently stopped working
in different ways, requiring a restart.

The peskiest problem is that it just refuses to automatically add some
imports. No errors in the log, just messages about "undefined:
someimportedname".

Really looking forward to Gopls stabilizing, because it's bound to be better
than what came before.

~~~
stamblerre
gopls does support automatically organizing imports (it uses the same library
as goimports). If you're having problems with this feature, please file a bug
on the Go issue tracker
([https://github.com/golang/go/issues](https://github.com/golang/go/issues)).
Thanks!

~~~
atombender
I'll try, but the code I've been working on is not open source, and the
problem only happened with _some_ imports within my own project. I don't
expect a bug report is very useful without my code given the relative
sparseness of Gopls's debug log.

~~~
stamblerre
No worries, but if you are able to encounter a scenario where goimports works,
but gopls fails, it would be very helpful. Totally understand if you aren't
able to share, but even redacted logs will be useful for debugging.

~~~
atombender
[https://github.com/golang/go/issues/31977](https://github.com/golang/go/issues/31977)

------
eknkc
Recetly switched to using this on VsCode. Works great. A lot faster than the
older implementation and this server model makes a lot of sense. Good job
having gopls ready in a short time.

------
harrygeez
Finally! Still in the early days but Go has been lacking in good tooling (at
least, not as great as JS) and hopefully this is the mark of things changing.

~~~
closeparen
Gomft and goimports have been great for as long as I’ve been using Go. GoLand
had a rocky start but has been excellent for ~2 years. Pprof is awesome.

The only weak tooling I saw was dependency management; Dep is great and
modules are part of the toolchain now.

I can’t agree that Go lacks tooling. Maybe it’s just a disparity in what my
company configures out of the box, but I feel better supported by tools in Go
than in Python or Java.

~~~
harrygeez
I don't use GoLand, but one thing that's definitely lacking is good
autocomplete support.

The language server by sourcegraph isn't too bad, but it often takes more than
10GB RAM for a big project and is not forgiving to errors (i.e. autocomplete,
peeking, jumping, referencing will all fail when there are syntax/build
errors).

------
macrael
Isn't there an "official" LSP in the works?

~~~
jhawk28
this is the official one

------
lxe
Doesn't sourcegraph already have an LSP server for go?

~~~
ngrilly
Sourcegraph agreed to join the effort around gopls, to have one really robust
implementation supported by the whole Go community.

~~~
sqs
Sourcegraph CEO here. Yes, we are very happy that the Go core team is taking
over. I posted about this 7 months ago at
[https://news.ycombinator.com/item?id=18042930](https://news.ycombinator.com/item?id=18042930).
Language servers should be owned by the same core team that owns the compiler
for each language because tooling is so important to language users.

