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

nut code #10

Closed
ctaggart opened this issue Apr 24, 2016 · 11 comments
Closed

nut code #10

ctaggart opened this issue Apr 24, 2016 · 11 comments

Comments

@ctaggart
Copy link

ctaggart commented Apr 24, 2016

I'd like to be able to type nut code after I clone a project and get a Visual Studio Code environment with extensions for editing that project.

It would be great if I could put some of the nut options under a macro in nut.yml. Something like:

macros:
  code:
    docker-image: ctaggart/golang-vscode
    enable_gui: true
    mount:
      main:
      - .
      - /home/vscode/mygoproject
    usage: start vscode to edit this project
    actions:
    - su vscode -c "code -w /home/vscode/mygoproject"

This way I could clone mygoproject, run nut code and have it start Visual Studio Code with all the extensions I need to code. This would eliminate a ton of developer environment setup time.

@matthieudelaro
Copy link
Owner

OK, overloading configuration in macros would make Nut more flexible.
I'm not sure why it would be useful for golang-vscode though. You always use the same docker image, right?

@ctaggart
Copy link
Author

That is a macro for a nut.yml that I would put in another go project. In this example, I would add it to mygoproject. Allowing the overloading would allow me to launch a Go IDE for a Go project and a .NET IDE for a .NET project. That would be killer.

@matthieudelaro
Copy link
Owner

So you mean, having the exact same nut.yml for a project in Go and for a project with .NET ?

@ctaggart
Copy link
Author

ctaggart commented Apr 24, 2016

No. A .NET project would have a different code macro that would launch a Visual Studio Code environment with .NET support. I want to be able to:

git clone https://github.com/ctaggart/SourceLink.git
nut code

Since it is a .NET project, it would have nut.yml with:

macros:
  code:
    docker-image: ctaggart/dotnet-vscode
    enable_gui: true
    mount:
      main:
      - .
      - /home/vscode/sourcelink
    usage: start vscode to edit this project
    actions:
    - su vscode -c "code -w /home/vscode/sourcelink"

@matthieudelaro
Copy link
Owner

OK. Seems to me that in your case, you want to keep the same macro, and change only the docker image. Right? I think this corresponds to the examples of Go environment that you can find in Nut repository:

  • in go1.5 environment, I defined many macros, as well as default parameters
  • in go1.6 and goLatest, I inherited from go1.5 (to keep the macros), and I modify the docker image
  • in mygoproject, I can inherited from go1.6 to change the name of the directory, and/or to add a new macro, or overload an existing one.

Similarly, you could create a parent vscode configuration, and inherite from it to provide a Go environment and a .Net environment.

Still, the improvement of nut.yml that you offer would bring more flexibility. Wanna contribute?

@ctaggart
Copy link
Author

ctaggart commented Apr 27, 2016

The flexibility needed is the ability to have different docker image and mount points for a macro.

@ctaggart
Copy link
Author

This project is using vendor directories, but it does not appear that the go apps vscode uses all work with vendor directories yet. ctaggart/golang-vscode#6

I did a workaround and now I finally can debug and learn the codebase.
image

Do you use an editor? What do you use for debugging?

@matthieudelaro
Copy link
Owner

I'm using command line and Sublime Text 3 on my Mac (it runs on the host, not in the container launched by nut for compilation and execution).

If you want to offer a default editor for Nut, with proper parameters, etc... we can add it to the repo. I'm so familiar with ST3 and so new to Go, that I didn't even take time to take a look at what Go developers usually use.

About the issue with vendor: when you cloned the repository, did you use --recursive to clone the dependencies as well?

@ctaggart
Copy link
Author

We are in a similar boat. I haven't programmed in Go yet. One of the main reasons was lack of IDE support which Visual Studio Code is changing that, but issues like ctaggart/golang-vscode#7 make me sad.

Yeah, I used --recursive and have all the code.

@ctaggart ctaggart mentioned this issue Apr 30, 2016
@matthieudelaro
Copy link
Owner

Hi @ctaggart ,

Seems like we can close this issue, right?

@ctaggart
Copy link
Author

Yes. I believe so! Thanks.
On May 14, 2016 10:01 AM, "matthieudelaro" notifications@github.com wrote:

Hi @ctaggart https://github.com/ctaggart ,

Seems like we can close this issue, right?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#10 (comment)

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

Successfully merging a pull request may close this issue.

2 participants