You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
x/tools/gopls: support -remote=auto across CLI subcommands #81721
Currently, gopls CLI subcommands (such as definition, references, check, and
workspace_symbol) run an in-process, single-use LSP session.
-remote=auto allows CLI commands to connect to a shared background daemon,
starting one automatically if none is running.
To support this cleanly, several adjustments to the client/server interaction are
necessary:
• Daemons shut down automatically after an idle period (controlled by -remote.listen.timeout).
• The CLI must properly implement LSP (currently it bypasses some messages, and directly
accesses the handler).
• Different CLI invocations run in different working directories and with different environment
variables (such as GOOS, GOARCH, and GOWORK). The daemon must resolve packages
using the client's working directory (or workspace root) and environment rather than its own
startup state.
• Subcommand-specific option overrides (such as symbol matchers, analyzers, and code lenses)
must propagate to the daemon over the LSP connection.
I was thinking to make this default, but that's too early.
I found -remote=auto isn't working in non-unix platform yet.
Activity
gopherbot commentedon Sep 24, 2026
Change https://go.dev/cl/837926 mentions this issue:
gopls/internal/cmd: identify gopls cli in LSP initializegopherbot commentedon Sep 24, 2026
Change https://go.dev/cl/837928 mentions this issue:
gopls/internal/cmd: propagate client options to server via configurationgopherbot commentedon Sep 24, 2026
Change https://go.dev/cl/837927 mentions this issue:
gopls/internal/cmd: send Go environment in remote mode initializegopherbot commentedon Sep 24, 2026
Change https://go.dev/cl/837929 mentions this issue:
gopls/internal/server: suppress shutdown race when diagnosing orphaned filesgopherbot commentedon Sep 24, 2026
Change https://go.dev/cl/837925 mentions this issue:
gopls/internal/cmd: start a daemon with -remote=autogabyhelp commentedon Sep 24, 2026
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
gopls/internal/server: suppress shutdown race when diagnosing orphane…
gopls/internal/cmd: start a daemon with -remote=auto
gopls/internal/cmd: identify gopls cli in LSP initialize
gopherbot commentedon Oct 8, 2026
Change https://go.dev/cl/847486 mentions this issue:
gopls/internal/cmd: separate out client and servergopls/internal/cmd: separate out client and server
gopls/internal/cmd: send Go environment in remote mode initialize
gopls/internal/cmd: propagate client options to server via configuration