Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: share workspace module with the client #42126

Closed
stamblerre opened this issue Oct 21, 2020 · 2 comments
Closed

x/tools/gopls: share workspace module with the client #42126

stamblerre opened this issue Oct 21, 2020 · 2 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@stamblerre
Copy link
Contributor

Some editor clients run commands (go test, dlv, etc.), and they may want to do so from the workspace module.
We should develop a way for clients to run commands through the workspace module.

The current proposed design would be a gopls run command (on the command line) that takes a session identifier and runs a command, piping stdout/stderr back to the client. Before we set out on implementing and investigating this design, we'd like to understand the problem space a bit better. The fastest way to get something to the clients is a non-standard request to share a directory (a temporary directory whose path is based on the gopls PID) in which clients can run commands. It would only be intended for use by VS Code Go as a starting point for the investigation.

/cc @heschik @findleyr @hyangah

@stamblerre stamblerre added this to the gopls/workspace-module milestone Oct 21, 2020
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Oct 21, 2020
@findleyr findleyr self-assigned this Oct 21, 2020
@findleyr
Copy link
Member

I'll do this, since it's a natural continuation of my WIP https://golang.org/cl/263938

Plan is to continue using transient temp directories for workspace modules within gopls, but also keep an up-to-date 'latest' directory, which can be hard-coded to $TMPDIR/gopls-<pid>.workspace/.

Note that this is slightly more complicated for the daemon. We'll have to pass the forwarder pid to the daemon when creating the session, rather than just assume it's the pid of the gopls process. So this ends up being something like an intrinsic session ID anyway, which seems like a useful abstraction.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/264618 mentions this issue: internal/lsp/cache: assign a static temp workspace dir to the first view

@golang golang locked and limited conversation to collaborators Nov 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants