Runs JetBrains' GoLand language server, the engine behind the Go by GoLand extension for VS Code and Cursor, under Neovim's built-in LSP client.
:GolandInstalldownloads the public JetBrains server for your platform and verifies its checksum. Nothing from JetBrains is bundled with this plugin.- Starts it through
vim.lsp.config()andvim.lsp.enable(), so every built-in LSP mapping and any completion plugin works as with other servers. - Editors opened on the same project share one server, through the
lsp-routerthat ships with it. - Shows the JetBrains license agreement. The server is not started until you accept it.
:GolandInstallmoves to the latest build, which the preview needs every month.:checkhealth golandreports the bundle, the agreement and the running clients.
- Neovim 0.12 or newer
curl,unzipandtarshasumorsha256sum- Go, with
goon yourPATH - About 800 MB of disk space for the server and 2 GB of free memory while it runs
With lazy.nvim:
{
"jpmcb/goland.nvim",
ft = { "go", "gomod", "gowork" },
opts = {},
}The plugin loads when you first open a Go file, and its commands exist from then on.
Without a plugin manager, put the plugin on your runtimepath and call setup():
require("goland").setup({})Installation is explicit. Run :GolandInstall to download the server (about 280 MB) into
stdpath("data")/goland, then run :GolandEula to read the agreement and press a to accept
it. Once accepted, the server attaches to Go buffers, including ones already open. Nothing is
downloaded until you run :GolandInstall, unless you set auto_install yourself.
Disable gopls for Go buffers first. Two language servers on one buffer answer everything
twice, and the plugin warns when it sees both attached.
vim.lsp.enable("gopls", false)Every option with its default:
require("goland").setup({
-- a bundle directory or its bin/intellij-server; nil uses the downloaded one
server_path = nil,
-- download the server on the first Go buffer when server_path is unset
auto_install = false,
-- africa|americas|apac|china|europe|middle_east|oceania; nil sends none
A5D4
region = nil,
-- usage statistics sent to JetBrains: "full"|"anonymous"|"none"
data_sharing = "none",
-- extra JVM options for the server, e.g. { "-Xmx4g" }
jvm_args = {},
-- Go SDK to analyze with; nil lets the server find `go` on PATH
goroot = nil,
-- e.g. "integration,linux"
build_tags = nil,
-- e.g. { "-tags=integration" }; only -tags is read
build_flags = nil,
filetypes = { "go", "gomod", "gowork" },
-- warn when a module is not in the active go.work
workspace_check = true,
-- merged over the generated vim.lsp.config
lsp = {},
})The workspace root is the first of go.work, .git and go.mod found above the file. The
server imports every Go module under that root, as it does for a folder opened in VS Code.
Files under GOMODCACHE or GOROOT are not projects: jumping into a dependency or the
standard library reuses the server of an open project, preferring the one you came from,
instead of starting a second one. To root at the nearest module instead:
opts = {
lsp = { root_markers = { "go.work", "go.mod" } },
}lsp takes any vim.lsp.config() field, such as on_attach, capabilities or settings.
The plugin's own before_init and on_exit run before yours. lsp.cmd is not supported; use
server_path instead.
| Command | Description |
|---|---|
:GolandInstall |
Install or update the server; restarts the shared server when attached |
:GolandEula |
Read the JetBrains license agreement; a accepts, q closes |
:GolandStart |
Attach this editor's clients; starts a server if none runs |
:GolandStop |
Detach this editor's clients; shared servers keep running |
:GolandServerStop |
Stop the shared servers; requires an attached client |
:GolandServerRestart |
Restart the shared servers; requires an attached client |
:GolandUninstall |
Remove the server and the license acceptance; ! skips the question |
:GolandLog |
Show the project import and build output |
From Lua, require("goland") exposes .install(), .start(), .stop(), .server_stop(),
.server_restart() and .uninstall().
:GolandStart and :GolandStop attach and detach every goland client in this editor,
across projects, and leave the shared servers running.
The Server commands talk to the shared daemon through an attached client. When this editor is
detached they warn and do nothing, so run :GolandStart first. They affect every editor on the
workspace: other editors lose the old server and must restart or reopen their clients.
:GolandInstall uses the same shared restart when it switches builds and a client is attached.
:GolandUninstall removes everything the plugin stored: the downloaded server in
stdpath("data")/goland and the recorded license acceptance in stdpath("state")/goland. It
first stops the shared servers this editor is attached to, then stays idle until you run
:GolandInstall again, which also means accepting the agreement again. A server that only
another editor is attached to cannot be reached, so stop it there first. The index under the
JetBrains cache directory belongs to the server and is left in place.
The plugin fires a User autocommand with the pattern GolandImport when a project import
ends. Its data.phase is FINISHED, CANCELLED or FAILED.
The server is a JetBrains product with its own license, the EULA.txt inside the bundle.
It refuses to start until the program that launches it passes a hash of that file, and
passing the hash is the acceptance.
The plugin only passes it after you ran :GolandEula and pressed a. There is no option
that accepts the agreement for you. A new build with a changed agreement asks again.
During the preview the server needs no license. JetBrains has said that licensing arrives with the 1.0 release.
Each preview build expires 30 days after its release. When that happens the server exits
and the plugin tells you to run :GolandInstall, which fetches the latest build and
restarts. :checkhealth goland warns when the installed build is close to that age.
:GolandInstall asks Open VSX for
the latest Go by GoLand extension of your platform. That extension holds a
server-bundle.json naming the matching server archive on download.jetbrains.com and
its SHA-256. The plugin downloads the archive, checks it and unpacks it.
The server is then started the way the VS Code extension starts it:
bin/lsp-router --server-launcher bin/intellij-server -- --eula <hash>lsp-router speaks LSP on stdio. It reads the workspaceId initialization option, attaches
to the server that already serves that workspace, and starts one when none does. A Go file
outside any project gets a private intellij-server --stdio instead.
A self-built server can pair with its own router by exporting INTELLIJ_LSP_ROUTER, as the
VS Code extension allows.
The region and data sharing options reach the server as the INTELLIJ_REGION and
INTELLIJ_DATA_SHARING environment variables, and jvm_args as IJ_JAVA_OPTIONS.
| What | Where | Default path |
|---|---|---|
| Server bundle | stdpath("data")/goland/servers/<build>/ |
~/.local/share/nvim/goland/servers/271.4062.0/ |
| Which build is current | stdpath("data")/goland/current.json |
~/.local/share/nvim/goland/current.json |
| EULA text | EULA.txt inside the bundle |
~/.local/share/nvim/goland/servers//EULA.txt |
| EULA acceptance | stdpath("state")/goland/eula-accepted |
~/.local/state/nvim/goland/eula-accepted |
:checkhealth golandshows what is installed and what is running.:checkhealth vim.lspshows whether thegolandclient attached, and where the LSP log is when it did not start.:GolandLogshows why a project import failed.- If a checkout is not listed in the active
go.work, the plugin warns that the server will index the workspace's other modules instead. Update the workspace, or start Neovim withGOWORK=offfor a standalone checkout. Setworkspace_check = falseto silence it. - The server keeps its index under
~/Library/Caches/JetBrainson macOS and~/.cache/JetBrainson Linux.
See the contributing guide for the development environment, checks, tests, and pull request guidance.
- intellij-lsp.nvim: JetBrains' own Neovim client for the Java and Kotlin server of the same family
- Go by GoLand documentation