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

ui: view for go env and important settings that affects go's functionality #2049

Closed
hyangah opened this issue Feb 2, 2022 · 10 comments
Closed

Comments

@hyangah
Copy link
Contributor

hyangah commented Feb 2, 2022

There are dozens of settings and environment variables affecting how go command works.
go env or commands to inspect environment variables is a typical way to inspect them,
but often the environment the extension (or vscode extension host) is different from what
users see from their terminals (e.g. users use shell config that does not get invoked when
vscode launches, etc.). That causes confusions numerous times.

We added some of the info in the Go: Locate Configured Tools command output, but
the output is verbose and text-heavy. It's time to think about better UI. An option is View.

Info to included in the new Go Env view

  • go env output
  • Path to the go command (or GOROOT)
  • List of tools
    • Name, path, version
  • settings affecting build/test (e.g. go.buildFlags, or tags)

Future work

This view may be extended in the future to have associated commands

  • to open the associated resources (e.g. open go.mod file)
  • to trigger setting changes (e.g. Allow setting GOOS via UI)
  • to update tools

Remarks

  • The info in the view may need to change depending on the workspace root folder the open file belongs to.

  • I cannot think of a good existing default container (explorer/scm/debug/test) where this new view belongs to yet. We may need to create a custom view container for Go - where we can organize more go-project specific information (Module/Package dependencies, Package doc, ...)

cc @jamalc @golang/tools-team

@gopherbot gopherbot added this to the Untriaged milestone Feb 2, 2022
@suzmue suzmue modified the milestones: Untriaged, On Deck Feb 7, 2022
@hyangah
Copy link
Contributor Author

hyangah commented Feb 18, 2022

Of course, this is not the first time I thought about this :-) #1630

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/388754 mentions this issue: src/goExplorer.ts: display tools configuration detail in explorer view

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/388435 mentions this issue: src/goExplorer.ts: add a go tree view to the explorer

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/389454 mentions this issue: test/integration: test go explorer tree view ui

@hyangah hyangah modified the milestones: On Deck, v0.33.0 Mar 8, 2022
gopherbot pushed a commit that referenced this issue Mar 9, 2022
Adds a tree view for Go to the explorer. Initially the
view contains only select entries about the go env settings
for the currently open workspace and file - GOPRIVATE, GOMOD,
GOWORK, GOENV, and any value set with toolsEnvVars from the
go workspace configuration.

Snapshot: https://drive.google.com/file/d/1q0whHB5wSV0Q_pzMr9TM1-E7GxRE5zru/view?usp=sharing

For #2049

Change-Id: I5c5f78913626f5f6d59de90368fff4bd5ffcb33e
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/388435
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopherbot pushed a commit that referenced this issue Mar 9, 2022
Added a tree item to the Go explorer view that displays
the status and version detail of installed tools.

Snapshot: https://drive.google.com/file/d/17s1qWzl-7slTHLIfovfNZqQERveVVcAN/view?usp=sharing

For #2049

Change-Id: I074a4a087db56e5e0cdcfcf8a90d234d083dc483
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/388754
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Polina Sokolova <polina@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
gopherbot pushed a commit that referenced this issue Mar 9, 2022
For #2049

Change-Id: I5b66e4565f0d615a6cff31677981913a3e02d4b7
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/389454
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/391254 mentions this issue: package.json: add go icon to explorer view

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/391255 mentions this issue: src/goExplorer.ts: consolidate tools information into single tree item

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/391256 mentions this issue: src/goExplorer.ts: create opened files if they do not exist

gopherbot pushed a commit that referenced this issue Mar 10, 2022
If a user drags the explorer from the default
location to the activitybar, the Go logo will
appear instead of the default file icon.

Snapshot: https://drive.google.com/file/d/1uSF4qIp5yHFPZEpOOT9xLVq3g_0LjJPf/view

For #2049

Change-Id: I8647485cfaf6c71560ed1eac6ee0f9cc8b81afa7
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/391254
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopherbot pushed a commit that referenced this issue Mar 10, 2022
For #2049

Change-Id: Idc23f0b10263d1988a1a20fe619a6a8ebc73b2d2
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/391255
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
gopherbot pushed a commit that referenced this issue Mar 10, 2022
For #2049

Change-Id: Iaa4c5cf67d44f97f8fe4bd0e49a897cc5d4d9624
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/391256
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/391515 mentions this issue: src/goExplorer.ts: make workspace go env editable via commands

gopherbot pushed a commit that referenced this issue Mar 21, 2022
Added commands for editing and resetting go env values. The
commands are available from the command palette or as context
items within the explorer view. When invoked from the explorer
on an env tree item, the command will apply only to that item.
The edit command invoked from the palette will present the user
with a list of editable go env variables.

Screencast: https://drive.google.com/file/d/19KcTYcYACpL-8R5pW9z_XMaaCnliqSZj/view?usp=sharing

For #2049.

Change-Id: Ic13944437f300d3616d8b98533842c4da914c080
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/391515
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
@hyangah
Copy link
Contributor Author

hyangah commented Apr 25, 2022

Screen Shot 2022-04-25 at 2 54 19 PM

From v0.33.0, there will be a Go view in the Explorer container by default and that will present some environment variables and tool locations and versions. We plan to extend this to provide easy access to update the env vars or flag variables in the future. Users can move the view to the activity bar directly, move to bottom of the editor, or completely hide it like other views.

Thanks @jamalc

@hyangah hyangah closed this as completed Apr 25, 2022
@polinasok
Copy link
Contributor

Should go.toolsEnvVars settings be reflected as well? That could help with highlighting hidden settings like in #2206.
Or maybe settings.json could be its own separate Explorer category. And another launch.json section when debug session is running could be nice too.

@golang golang locked and limited conversation to collaborators Apr 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants