Bug 416338 - LSP configuration for Go (golang)
Summary: LSP configuration for Go (golang)
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 20.08.3
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-16 14:12 UTC by Wouter Van Hemel
Modified: 2020-12-30 11:32 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
LSP configuration file with modified Go settings (2.84 KB, application/json)
2020-01-16 14:12 UTC, Wouter Van Hemel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wouter Van Hemel 2020-01-16 14:12:28 UTC
Created attachment 125171 [details]
LSP configuration file with modified Go settings

The LSP (Sourcegraph) client Kate currently uses for Go is deprecated; Go has an official client in its tools repository that's used by most editors now.

See also the README for the Sourcegraph server:
https://github.com/sourcegraph/go-langserver

Link to the official LSP server, named gopls:
https://github.com/golang/tools/tree/master/gopls

I've changed the server for Go in the settings.json file. I also had to enable some workspace root configuration for the LSP server to work correctly.

Here are the settings I've got now:

"go": {
	"command": ["/home/wouter/.local/gobin/gopls"],
	"commandDebug": ["/home/wouter/.local/gobin/gopls", "-debug"],
	"rootIndicationFileNames": ["go.mod", "go.sum"],
	"url": "https://github.com/golang/tools/tree/master/gopls",
	"highlightingModeRegex": "^Go$"
},


I will try to attach my modified settings file to this report in case that would turn out to be helpful.

Thanks for working on LSP support!
Comment 1 Christoph Cullmann 2020-01-16 19:21:00 UTC
I agree that gopls is the future, but your link below just states

https://github.com/golang/tools/tree/master/gopls

> It is currently in alpha, so it is not stable.

On the other side, the "old" deprecated server is just in maintenance mode.

Beside this, e.g. for Arch, you get just the old one packaged at all.
Comment 2 Wouter Van Hemel 2020-01-21 10:56:07 UTC
Gopls is the one used in govim and VSCode though; but they have some auto-update mechanism for updating gopls versions.

You've got a point about distributions having to catch up. I like to keep my own tools up to date, but I guess a lot of people would be disappointed if it were not to work out of the box.
Comment 3 Justin Zobel 2020-11-13 05:07:34 UTC
Can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved. I'm setting status to "needsinfo" pending your response, please change back to "reported" or "resolved" when you respond, thanks.
Comment 4 Wouter Van Hemel 2020-11-13 15:33:38 UTC
This report is still valid as of 2020-11-13 with Kate 20.08.3.

As mentioned in its repo, the Sourcegraph LSP server is deprecated and should be switched to the official Go LSP server.

It is true however that the official Go LSP server is taking quite some time to reach a stable version.