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

code lens: add a 'run' code lens for main functions #159

Open
stamblerre opened this issue Jun 3, 2020 · 7 comments
Open

code lens: add a 'run' code lens for main functions #159

stamblerre opened this issue Jun 3, 2020 · 7 comments
Labels
FeatureRequest NeedsFix The path to resolution is known, but the work has not been done. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@stamblerre
Copy link
Contributor

See the original feature request: microsoft/vscode-go#3074.

@stamblerre stamblerre added FeatureRequest NeedsFix The path to resolution is known, but the work has not been done. labels Jun 3, 2020
@zhylmzr
Copy link

zhylmzr commented Jun 12, 2020

This feature is very helpful for single file and implementation inspiration.

@hyangah
Copy link
Contributor

hyangah commented Feb 17, 2021

Should it run in the single file mode, or run the package?

@AntBlo
Copy link

AntBlo commented Jan 3, 2022

I'd find this useful for cmd/*.go files. I believe I've seen tests that have run/debug code lenses.
Having the same feature for main seem like a good idea to me.

@hyangah
Copy link
Contributor

hyangah commented Mar 18, 2022

@vuon9 Thanks for the PR!

I see the current implementation is similar to run test codelens,
creates a dedicated output channel called "Go Main" and forwards go run . output to stdout/stderr.
I now wonder if that's too limiting for a run test though.

What do you think about utilizing the task provider (https://code.visualstudio.com/api/extension-guides/task-provider)?
I guess that may allow access to stdio (including `stdin) and also open up the possibility of users can customize further to add environment or arguments.

@hyangah hyangah added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 18, 2022
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/393454 mentions this issue: add codelens for running main func

@polinasok
Copy link
Contributor

Is it odd that Run: Start Without Debugging uses dlv with noDebug while the codelens will use "go run"?

@tooltitude-support
Copy link

We implemented this feature in our extension, tooltitude. We focus on augmenting gopls with convenience and productivity features.

Screenshot 2023-02-17 at 2 22 16 PM

We use the machinery provided by go extension under the hood, i.e. we just create a debug configuration and launch it, or just launch via shell task in the run case.

P.S. You could read more about it here: https://www.tooltitude.com/ You could install from here: https://marketplace.visualstudio.com/items?itemName=tooltitudeteam.tooltitude

cc @zhylmzr @AntBlo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsFix The path to resolution is known, but the work has not been done. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

7 participants