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
Assignees
Labels
Milestone

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Oct 21, 2020

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
@findleyr findleyr self-assigned this Oct 21, 2020
@findleyr
Copy link
Contributor

@findleyr findleyr commented Oct 21, 2020

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

@gopherbot gopherbot commented Oct 23, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants