Settings
Open extension settings
Open the Command Palette (Ctrl+Shift+P) and run Preferences: Open Settings (UI).
In the settings search field, enter
@ext:JetBrains.goland-server.
Go settings
The extension reads go.toolsEnvVars, go.buildTags, and go.buildFlags from user or workspace settings. It uses one build target for code analysis across the whole workspace. Changes take effect after a language server restart.
- Go tools environment variables
Setting ID:
go.toolsEnvVarsA map of environment variable names to string values. For code analysis, the extension reads
GOOSfor the target operating system,GOARCHfor the target architecture, andCGO_ENABLED(1enables cgo,0disables it). It also reads-tagsfromGOFLAGS. These values override the corresponding variables in the extension host environment.For example,
{"GOOS": "linux", "GOARCH": "arm64"}selects files for Linux on ARM64.Setting ID:
go.buildTagsBuild tags to use for code analysis, as a string such as
"integration,enterprise". These tags override the tags inGOFLAGS.- Go build flags
Setting ID:
go.buildFlagsA list of build flags. Code analysis uses only the
-tagsflag. To specify tags in this setting, use separate entries for the flag and its value, such as["-tags", "integration"]. This form overridesgo.buildTagsand the tags inGOFLAGS.- Go SDK root
Setting ID:
go.gorootThe absolute path to the root of an installed Go SDK on the machine where the language server runs. An empty value enables automatic Go SDK detection.
The setting applies to the whole workspace. The path supports the following substitutions:
~at the start of the path: your home directory.${env:NAME}: the value of the environment variableNAME, or an empty string if the variable is unset.${workspaceFolder}and${workspaceRoot}: the path to the workspace folder.${workspaceFolderBasename}: the name of the workspace folder.
Workspace variables use the folder of the active file. If the file has no workspace folder, or no file is active, they use the first workspace folder.
For remote workspaces, paths and variables refer to the machine where the language server runs.
If the expanded path is relative or does not point to an existing directory, Go by GoLand shows a warning and detects Go automatically. If it expands to an empty string, the extension detects Go automatically.
Changes take effect after a language server restart. For configuration instructions, refer to Select a Go SDK.
Language server settings
- Additional JVM arguments
Setting ID:
intellij.additionalJvmArgsAdditional JVM arguments passed to the language server. For example,
-Xmx4gincreases the maximum heap size to 4 GB. Changes take effect after a language server restart.For configuration instructions, refer to Configure JVM memory.
- Build tool
Setting ID:
intellij.buildToolControls automatic Go project detection in workspace folders:
gomodules-recursive-scan(default): detects Go modules anywhere in the workspace.gomodules: detects a Go project only if the workspace root contains a go.mod or go.work file.null: checks the workspace root first and scans its subdirectories if the root has no go.mod or go.work file.""(an empty string): disables automatic project detection.
After detection succeeds, both Go project types scan the directory and its subdirectories during import. A non-empty
intellij.projectslist takes precedence over this setting for all workspace folders.For configuration instructions, refer to Select how to detect Go projects.
- Completion case sensitivity
Setting ID:
intellij.completion.caseSensitivityControls how code completion matches uppercase and lowercase letters in the text you type:
Case-insensitive (
none): ignores letter case.First letter only (
firstLetter, default): matches the case of the first letter.All letters (
all): matches the case of every letter.
Changes take effect after a language server restart. For configuration instructions, refer to Configure completion case sensitivity.
- Language server port
Setting ID:
intellij.dev.serverPortThe port of a locally running language server. The value
-1uses the bundled language server instead.For configuration instructions, refer to Connect to a local language server.
- Workspace index reuse
Setting ID:
intellij.forkFromWorkspaceThe absolute path to a workspace that Go by GoLand has already indexed. The path points to the source checkout, such as the main checkout of a Git worktree, on the machine where the language server runs. Both
null(default) and an empty string ("") disable index reuse.Set this value before opening the new worktree for the first time. When the new workspace has no index, Go by GoLand copies the source index and updates it for the new workspace. Each workspace then keeps its own index. If the source index uses a different format, the language server indexes the new workspace from scratch.
For configuration instructions and an example, refer to Reuse an index for a new worktree.
- Projects to import
Setting ID:
intellij.projectsA non-empty list replaces automatic project detection across all workspace folders. Include every directory you want the extension to use as an import root. An empty list uses the detection mode set by
intellij.buildTool.Each entry sets a project
type(gomodules-recursive-scanorgomodules) and afile:///URI for the directory. You can use the$PROJECT_DIR$macro in the URI and setofflinetotrueto import using already downloaded modules.For configuration instructions, refer to Find the project import setting and Specify directories to import.
- Protocol tracing
Setting ID:
intellij.trace.serverThe level of tracing between the editor and the language server:
off,messages, orverbose. Theverboselevel logs all protocol messages.For configuration instructions, refer to Configure protocol tracing.
- Workspace reload on save
Setting ID:
intellij.workspace.reloadOnBuildFileSaveControls what happens when you save a workspace folder's or subproject's .vscode/settings.json file in the editor.
Always (
always, default) reloads automatically.Prompt (
prompt) asks before reloading.Never (
never) skips reloads triggered by these saves.
The language server watches go.mod and go.work separately. Their changes can trigger a reimport even when this setting is
never.For configuration instructions, refer to Configure workspace reloads.
The following settings control data sharing and your region.
- Data sharing
Setting ID:
intellij.dataSharingControls which diagnostic data the language server shares with JetBrains:
Full (
full) : sends anonymous usage statistics and full error reports, including exception messages and attachments.Anonymous (
anonymous) : sends anonymous usage statistics and anonymized error reports. Exception messages, user data, and attachments are removed.None (
none) : does not send usage statistics or error reports.
The default is
not_set. The extension asks you to choose a preference during setup. At server startup,not_setbehaves likenone. This setting is available in user settings. Changes take effect after a language server restart.For configuration instructions, refer to Change region and data sharing settings.
- Region
Setting ID:
intellij.regionYour region for JetBrains product terms and data processing.
The available regions are:
Africa (
africa)Americas (
americas)Asia (Except Mainland China) (
apac)Mainland China (
china)Europe (
europe)Middle East (
middle_east)Oceania (
oceania)
The default is
not_set. The extension asks you to select a region during setup. This setting is available in user settings. Changes take effect after a language server restart.
- Disable index write-ahead logging
Setting ID:
intellij.disableRocksDBWriteAheadLogDisables the write-ahead log of the index database to reduce peak disk usage during indexing. The option does not reduce the final size of the index. If the language server terminates unexpectedly, recent index changes can be lost.
Changes take effect after a language server restart. For configuration instructions, refer to Disable the index write-ahead log.