diff --git a/Dockerfile b/Dockerfile index ab57be7..9e8aaf9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,18 +3,17 @@ MAINTAINER Liang Ding ADD . /wide/gogogo/src/github.com/b3log/wide -RUN tar zxf /wide/gogogo/src/github.com/b3log/wide/docker-deps/golang.org.tar.gz -C /wide/gogogo/src/ -RUN mkdir /wide/gogogo/src/github.com/88250 -RUN tar zxf /wide/gogogo/src/github.com/b3log/wide/docker-deps/ide_stub.tar.gz -C /wide/gogogo/src/github.com/88250/ +RUN tar zxf /wide/gogogo/src/github.com/b3log/wide/deps/golang.org.tar.gz -C /wide/gogogo/src/ +RUN tar zxf /wide/gogogo/src/github.com/b3log/wide/deps/github.com.tar.gz -C /wide/gogogo/src/ RUN useradd wide && useradd runner ENV GOROOT /usr/src/go ENV GOPATH /wide/gogogo -RUN go get -v github.com/88250/ide_stub github.com/nsf/gocode github.com/bradfitz/goimports +RUN go get github.com/visualfc/gotools github.com/nsf/gocode github.com/bradfitz/goimports WORKDIR /wide/gogogo/src/github.com/b3log/wide -RUN go get -v && go build -v +RUN go get && go build -v EXPOSE 7070 \ No newline at end of file diff --git a/README.md b/README.md index 8b4f770..475966b 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Flow: Flow: 1. Browser sends code assist request 2. Handler gets user workspace of the request with HTTP session - 3. Server executes ````gocode````/````ide_stub````
+ 3. Server executes ````gocode````/````ide_stub(gotools)````
3.1 Sets environment variables (e.g. ${GOPATH})
3.2 ````gocode```` with ````lib-path```` parameter @@ -122,8 +122,7 @@ Download [HERE](http://pan.baidu.com/s/1dD3XwOT)! 1. [Download](https://github.com/b3log/wide/archive/master.zip) source or by `git clone https://github.com/b3log/wide` 2. Get dependencies with * `go get` - * `go get github.com/88250/ide_stub` - * `go get github.com/nsf/gocode` + * `go get go get github.com/visualfc/gotools github.com/nsf/gocode github.com/bradfitz/goimports` 3. Compile wide with `go build` ### Docker diff --git a/conf/wide.go b/conf/wide.go index 7412b7e..4c3cbf7 100644 --- a/conf/wide.go +++ b/conf/wide.go @@ -286,13 +286,13 @@ func checkEnv() { logger.Warnf("Not found gocode [%s], please install it with this command: go get github.com/nsf/gocode", gocode) } - ideStub := util.Go.GetExecutableInGOBIN("ide_stub") + ideStub := util.Go.GetExecutableInGOBIN("gotools") cmd = exec.Command(ideStub, "version") _, err = cmd.Output() if nil != err { event.EventQueue <- &event.Event{Code: event.EvtCodeIDEStubNotFound} - logger.Warnf("Not found ide_stub [%s], please install it with this command: go get github.com/88250/ide_stub", ideStub) + logger.Warnf("Not found gotools [%s], please install it with this command: go get github.com/visualfc/gotools", ideStub) } } diff --git a/deps/github.com.zip b/deps/github.com.zip new file mode 100644 index 0000000..9747fb9 Binary files /dev/null and b/deps/github.com.zip differ diff --git a/docker-deps/golang.org.tar.gz b/deps/golang.org.tar.gz similarity index 100% rename from docker-deps/golang.org.tar.gz rename to deps/golang.org.tar.gz diff --git a/docker-deps/ide_stub.tar.gz b/docker-deps/ide_stub.tar.gz deleted file mode 100644 index 4f65518..0000000 Binary files a/docker-deps/ide_stub.tar.gz and /dev/null differ diff --git a/editor/editors.go b/editor/editors.go index 42f9d96..b65f957 100644 --- a/editor/editors.go +++ b/editor/editors.go @@ -223,7 +223,7 @@ func GetExprInfoHandler(w http.ResponseWriter, r *http.Request) { logger.Tracef("offset [%d]", offset) - ideStub := util.Go.GetExecutableInGOBIN("ide_stub") + ideStub := util.Go.GetExecutableInGOBIN("gotools") argv := []string{"types", "-pos", filename + ":" + strconv.Itoa(offset), "-info", "."} cmd := exec.Command(ideStub, argv...) cmd.Dir = curDir @@ -299,7 +299,7 @@ func FindDeclarationHandler(w http.ResponseWriter, r *http.Request) { logger.Tracef("offset [%d]", offset) - ideStub := util.Go.GetExecutableInGOBIN("ide_stub") + ideStub := util.Go.GetExecutableInGOBIN("gotools") argv := []string{"types", "-pos", filename + ":" + strconv.Itoa(offset), "-def", "."} cmd := exec.Command(ideStub, argv...) cmd.Dir = curDir @@ -384,7 +384,7 @@ func FindUsagesHandler(w http.ResponseWriter, r *http.Request) { offset := getCursorOffset(code, line, ch) logger.Tracef("offset [%d]", offset) - ideStub := util.Go.GetExecutableInGOBIN("ide_stub") + ideStub := util.Go.GetExecutableInGOBIN("gotools") argv := []string{"types", "-pos", filename + ":" + strconv.Itoa(offset), "-use", "."} cmd := exec.Command(ideStub, argv...) cmd.Dir = curDir diff --git a/event/events.go b/event/events.go index da9ee67..743ea5f 100644 --- a/event/events.go +++ b/event/events.go @@ -29,7 +29,7 @@ const ( EvtCodeGOROOTNotFound // EvtCodeGocodeNotFound indicates an event: not found gocode EvtCodeGocodeNotFound - // EvtCodeIDEStubNotFound indicates an event: not found ide_stub + // EvtCodeIDEStubNotFound indicates an event: not found gotools EvtCodeIDEStubNotFound // EvtCodeServerInternalError indicates an event: server internal error EvtCodeServerInternalError diff --git a/pkg.sh b/pkg.sh index 111d282..9a9a164 100755 --- a/pkg.sh +++ b/pkg.sh @@ -22,22 +22,22 @@ os=darwin export GOOS=${os} export GOARCH=386 go build -go build github.com/88250/ide_stub +go build github.com/visualfc/gotools go build github.com/nsf/gocode -cp ${GOPATH}/bin/${GOOS}_${GOARCH}/ide_stub . +cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gotools . cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gocode . -tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} ide_stub gocode wide --exclude-vcs --exclude='conf/*.go' --exclude='i18n/*.go' -rm -f wide ide_stub gocode +tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} gotools gocode wide --exclude-vcs --exclude='conf/*.go' --exclude='i18n/*.go' +rm -f wide gotools gocode export GOOS=${os} export GOARCH=amd64 go build -go build github.com/88250/ide_stub +go build github.com/visualfc/gotools go build github.com/nsf/gocode -cp ${GOPATH}/bin/${GOOS}_${GOARCH}/ide_stub . +cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gotools . cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gocode . -tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} ide_stub gocode wide --exclude-vcs --exclude='conf/*.go' --exclude='i18n/*.go' -rm -f wide ide_stub gocode +tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} gotools gocode wide --exclude-vcs --exclude='conf/*.go' --exclude='i18n/*.go' +rm -f wide gotools gocode ## linux os=linux @@ -45,22 +45,22 @@ os=linux export GOOS=${os} export GOARCH=386 go build -go build github.com/88250/ide_stub +go build github.com/visualfc/gotools go build github.com/nsf/gocode -cp ${GOPATH}/bin/${GOOS}_${GOARCH}/ide_stub . +cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gotools . cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gocode . -tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} ide_stub gocode wide --exclude-vcs --exclude='conf/*.go' --exclude='i18n/*.go' -rm -f wide ide_stub gocode +tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} gotools gocode wide --exclude-vcs --exclude='conf/*.go' --exclude='i18n/*.go' +rm -f wide gotools gocode export GOOS=${os} export GOARCH=amd64 go build -go build github.com/88250/ide_stub +go build github.com/visualfc/gotools go build github.com/nsf/gocode -cp ${GOPATH}/bin/${GOOS}_${GOARCH}/ide_stub . +cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gotools . cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gocode . -tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} ide_stub gocode wide --exclude-vcs --exclude='conf/*.go' --exclude='i18n/*.go' -rm -f wide ide_stub gocode +tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} gotools gocode wide --exclude-vcs --exclude='conf/*.go' --exclude='i18n/*.go' +rm -f wide gotools gocode ## windows os=windows @@ -68,20 +68,20 @@ os=windows export GOOS=${os} export GOARCH=386 go build -go build github.com/88250/ide_stub +go build github.com/visualfc/gotools go build github.com/nsf/gocode -cp ${GOPATH}/bin/${GOOS}_${GOARCH}/ide_stub.exe . +cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gotools.exe . cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gocode.exe . -zip -r ${target}/wide-${ver}-${GOOS}-${GOARCH}.zip ${list} ide_stub.exe gocode.exe wide.exe --exclude=conf/*.go --exclude=i18n/*.go -rm -f wide.exe ide_stub.exe gocode.exe +zip -r ${target}/wide-${ver}-${GOOS}-${GOARCH}.zip ${list} gotools.exe gocode.exe wide.exe --exclude=conf/*.go --exclude=i18n/*.go +rm -f wide.exe gotools.exe gocode.exe export GOOS=${os} export GOARCH=amd64 go build -go build github.com/88250/ide_stub +go build github.com/visualfc/gotools go build github.com/nsf/gocode -cp ${GOPATH}/bin/${GOOS}_${GOARCH}/ide_stub.exe . +cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gotools.exe . cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gocode.exe . -zip -r ${target}/wide-${ver}-${GOOS}-${GOARCH}.zip ${list} ide_stub.exe gocode.exe wide.exe --exclude=conf/*.go --exclude=i18n/*.go -rm -f wide.exe ide_stub.exe gocode.exe +zip -r ${target}/wide-${ver}-${GOOS}-${GOARCH}.zip ${list} gotools.exe gocode.exe wide.exe --exclude=conf/*.go --exclude=i18n/*.go +rm -f wide.exe gotools.exe gocode.exe