diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e69de29 diff --git a/Dockerfile b/Dockerfile index aae2042..f249ee8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,8 @@ ENV DEBIAN_FRONTEND noninteractive RUN cd /root \ && ./install-apt-packages.sh \ && useradd -m vscode -s /bin/bash \ - && cp install-vscode-extension*.sh /home/vscode/ \ + && cp install-vscode-*.sh /home/vscode/ \ && chown vscode:vscode /home/vscode/install-vscode-extension*.sh \ - && su vscode -c /home/vscode/install-vscode-extensions.sh + && su - vscode -c /home/vscode/install-vscode-Go.sh -CMD su vscode -c "code -w /home/vscode" \ No newline at end of file +CMD su - vscode -c "code -w /home/vscode" \ No newline at end of file diff --git a/nut.yml b/nut.yml index 9695d5c..03b2b98 100644 --- a/nut.yml +++ b/nut.yml @@ -9,6 +9,48 @@ mount: - /home/vscode/golang-vscode macros: code: - usage: start vscode to edit this project + usage: open this project in vscode actions: - - su vscode -c "code -w /home/vscode/golang-vscode" \ No newline at end of file + - su - vscode -c "code -w /home/vscode/golang-vscode" + bash: + usage: start bash + actions: + - su - vscode + + # macros to open vscode for the dependencies + gocode: + usage: open gocode in vscode + actions: + - su - vscode -c "code -w /home/vscode/go/src/github.com/nsf/gocode" + godef: + usage: open godef in vscode + actions: + - su - vscode -c "code -w /home/vscode/go/src/github.com/rogpeppe/godef" + golint: + usage: open golint in vscode + actions: + - su - vscode -c "code -w /home/vscode/go/src/github.com/golang/lint/golint" + go-outline: + usage: open go-outline in vscode + actions: + - su - vscode -c "code -w /home/vscode/go/src/github.com/lukehoban/go-outline" + goreturns: + usage: open goreturns in vscode + actions: + - su - vscode -c "code -w /home/vscode/go/src/sourcegraph.com/sqs/goreturns" + gorename: + usage: open gorename in vscode + actions: + - su - vscode -c "code -w /home/vscode/go/src/golang.org/x/tools/cmd/gorename" + gopkgs: + usage: open gopkgs in vscode + actions: + - su - vscode -c "code -w /home/vscode/go/src/github.com/tpng/gopkgs" + go-symbols: + usage: open go-symbols in vscode + actions: + - su - vscode -c "code -w /home/vscode/go/src/github.com/newhook/go-symbols" + guru: + usage: open guru in vscode + actions: + - su - vscode -c "code -w /home/vscode/go/src/golang.org/x/tools/cmd/guru" \ No newline at end of file diff --git a/root/install-vscode-Go.sh b/root/install-vscode-Go.sh new file mode 100755 index 0000000..84152ff --- /dev/null +++ b/root/install-vscode-Go.sh @@ -0,0 +1,22 @@ +#!/bin/sh +dir=$(cd `dirname "$0"` && pwd) +# publisher extension version +$dir/install-vscode-extension.sh lukehoban Go 0.6.38 + +echo 'export GOPATH=$HOME/go' >> ~/.bash_profile +echo 'export PATH=$GOPATH/bin:/usr/local/go/bin:$PATH' >> ~/.bash_profile +. ~/.bash_profile + +# https://github.com/Microsoft/vscode-go#tools +go get -u -v github.com/nsf/gocode +go get -u -v github.com/rogpeppe/godef +go get -u -v github.com/golang/lint/golint +go get -u -v github.com/lukehoban/go-outline +go get -u -v sourcegraph.com/sqs/goreturns +go get -u -v golang.org/x/tools/cmd/gorename +go get -u -v github.com/tpng/gopkgs +go get -u -v github.com/newhook/go-symbols +go get -u -v golang.org/x/tools/cmd/guru + +# https://github.com/derekparker/delve/blob/master/Documentation/installation/linux/install.md +go get github.com/derekparker/delve/cmd/dlv \ No newline at end of file diff --git a/root/install-vscode-extensions.sh b/root/install-vscode-extensions.sh deleted file mode 100755 index 4dd8eba..0000000 --- a/root/install-vscode-extensions.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -dir=$(cd `dirname "$0"` && pwd) -# publisher extension version -$dir/install-vscode-extension.sh lukehoban Go 0.6.38 -# $dir/install-vscode-extension.sh donjayamanne python 0.3.5 -# $dir/install-vscode-extension.sh saviorisdead RustyCode 0.12.0 -# $dir/install-vscode-extension.sh Ionide Ionide-fsharp 1.6.3 \ No newline at end of file