Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Add click to "run" button on main function #3074

Closed
rakyll opened this issue Feb 28, 2020 · 4 comments
Closed

Add click to "run" button on main function #3074

rakyll opened this issue Feb 28, 2020 · 4 comments

Comments

@rakyll
Copy link

rakyll commented Feb 28, 2020

It would be great if VSCode was able to recognize a main function in a main package and automatically put a "run" button on it. Then, you can build the package, run it and show the output on the terminal tab.

@hyangah
Copy link
Contributor

hyangah commented Feb 28, 2020

Interesting idea. The go extension currently offers code lens for test/benchmark functions, so this may be similar. But, my concern is that many programs need input, output, flags, and sometimes configuring the right execution environment, so, a simple run is not going to be helpful in many cases.

@SaberD
Copy link

SaberD commented Mar 10, 2020

What about a run current file in terminal button similar to the python extension? (go run {filename}.go)
It is located in the upper right corner of the opened file only.
run

Forget about implementing inputs, outputs, flags, and configuring the execution environment. This would be useful for quick tests to confirm expected results from isolated functions in a small test.go file.

@ramya-rao-a
Copy link
Contributor

The ability to run the current file is available via the Run: Start Without Debugging command which I believe is mapped to Ctrl+F5 keybinding. This already suffers from the pitfalls of not taking any inputs, flags etc, but is considered helpful.

Having the codelens run would make the existing feature more visible and accessible.

@stamblerre
Copy link
Contributor

I have transferred this to golang/vscode-go#159, so let's continue the discussion there, as this repo is migrating (#3247).

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