4 ms·
Gopls: Language server protocol implementation for Go
- donio 8y agoI 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.
- eknkc 8y agoRecetly 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 8y agoFinally! 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 8y agoGomft 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 8y agoI 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).
- atombender 8y agoGopls 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 8y agogopls 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 8y agoI'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 8y agoNo 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 7y agohttps://github.com/golang/go/issues/31977 https://github.com/golang/go/issues/31977
- deleted 8y ago[deleted]
- macrael 8y agoIsn't there an "official" LSP in the works?
- jhawk28 8y agothis is the official one
- lxe 8y agoDoesn't sourcegraph already have an LSP server for go?
- ngrilly 8y agoSourcegraph agreed to join the effort around gopls, to have one really robust implementation supported by the whole Go community.
- sqs 8y agoSourcegraph 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.