-
Notifications
You must be signed in to change notification settings - Fork 569
Allow running projects composed of multiple files #1520
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
Comments
This bug makes this plugin completely useless. |
As an addition, when I try to run the project, the command executed is:
and because this project has more files, I get bunch of 'undefined' errors. I get the same error if I do "go build main.go". |
@ltzmaxwell it's not possible via UI yet. How do you think it should looks like? You can try to configure Go Application configuration that uses
Seriously? Running application is the only reason why you use IDE? Anyway see #1414 and #1413 discussions, you have a chance to be the first who will invent the solution and make plugin |
@zolotov for running a project composed of multiple files, would it be possible to have a "Go Multiple File" runner with an interface that lets you choose which files from the project to run? Another option would be to provide an option to allow the IDE to create a list of all files that are in the same directory as the file that contains "func main()" and invoke go tool with that list (same should happen for running _test.go files) What do you think? |
@zolotov How can I set go build in configuration?, in 'before launch ,go command'? It seems not work. |
@ltzmaxwell |
@dlsniper and then? |
Then you can configure the runner and that will run a |
I'm having this issue myself. If you really want to run an application from within the IDE you can set the path to the package import path (example), hit run, you'll get an error window, continue anyways, then hit run again and all will work as expected. |
@kiryaka from your screenshot I can see an error, you need to specify the main file. Also, if your project has multiple files in the main package, things won't work. See Alexanders' comment for why this is not supported (yet). We gladly welcome contributions. |
I need to do go build on the directory and then run the binary. What main.go can do with it? I can put it there. It will run it and exit with error, because the application have way more files then just main.go How to include other files? |
I'm really not sure what's so unclear. You cannot do that yet. The original poster asked where he can run go build, I pointed him there, there was no mention that you can run / compile multiple files. |
It's actually still unclear for me from your replies where to run "go build" on the directory. But anyhow, if the feature allowing to build and run the whole project from run configuration is not ready yet, then just consider my posts as +1 to this feature request :) Thank you. |
I've been using a "make" file for building multiple files. Make sure the working directory includes your source code. https://github.com/M-Gray/IdeaJGO/blob/master/make.go |
Do I understand it correctly? Currently a project like this cannot be compiled and run with this extension: https://github.com/rapidloop/rtop |
That's correct. Currently there's no multiple file/directory runner support in the plugins so you would have to launch the application manually from the terminal. |
Also, IDEA provides a builtin terminal, which isn't exactly a one button command, it will still allow users to stay within the IDE while working. |
@lukamicoder no, it's not correct. Besides bulitin terminal you also can just open project and invoke run action from UI, it will work. |
Awesome, thank you guys for your help! |
@zolotov I think I need to learn how to use the plugin, sorry for bad intel :D |
@zolotov I think this can be closed now as |
@dlsniper agreed |
for instance:
I can run in terminal like this : go run test0.go test1.go
How can I run this in Idea ?
The text was updated successfully, but these errors were encountered: