ascarter / Go-bbpackage

BBEdit package for Go development
MIT License
35 stars 3 forks source link

gotags does not take an --exclude option #5

Closed raj-room closed 8 years ago

raj-room commented 8 years ago

I installed gotags v1.3.0 with go get -u github.com/jstemmer/gotags, per the README.

When I try to build, I get a gotags failure because gotags does not take an --exclude option. The sodlib tags are then dumped to stdout instead of to a file. Here is the output of make:

$ make clean install
rm -rf ./Go.bbpackage
mkdir -p ./Go.bbpackage/Contents
cp README.md ./Go.bbpackage/.
cp LICENSE ./Go.bbpackage/.
cp -R ./src/* ./Go.bbpackage/Contents/.
mkdir -p ./Go.bbpackage/Contents/Completion\ Data/Go
gotags -R \
        --exclude="*_test.go" \
        --exclude="/usr/local/go/src/*/*/testdata/*" \
        --exclude="/usr/local/go/src/*/*/testdata/*/*" \
        --exclude="/usr/local/go/src/*/*/testdata/*/*/*" \
        --exclude="/usr/local/go/src/*/*/testdata/*/*/*/*" \
        --exclude="/usr/local/go/src/*/*/testdata/*/*/*/*/*" \
        --exclude="/usr/local/go/src/*/*/testdata/*/*/*/*/*/*" \
        --exclude="/usr/local/go/src/*/*/testdata/*/*/*/*/*/*/*" \
        --exclude="/usr/local/go/src/*/*/*/testdata/*" \
        --exclude="/usr/local/go/src/internal/*/*" \
        --exclude="/usr/local/go/src/internal/*/*/*" \
        --exclude="/usr/local/go/*/internal/*" \
        --exclude="/usr/local/go/*/internal/*/*" \
        --exclude="/usr/local/go/*/internal/*/*/*" \
        --exclude="/usr/local/go/*/internal/*/*/*/*" \
        --exclude="/usr/local/go/*/*/internal/*" \
        --exclude="/usr/local/go/*/*/internal/*/*" \
        --exclude="/usr/local/go/*/*/internal/*/*/*" \
        --exclude="/usr/local/go/*/*/internal/*/*/*/*" \
        -f=./Go.bbpackage/Contents/Completion\ Data/Go/Go\ Standard\ Library.tags --exclude-private=true /usr/local/go/src
flag provided but not defined: -exclude
gotags version 1.3.0

Usage: gotags [options] file(s)
...
ascarter commented 8 years ago

@raj-room - the problem is that gotags still hasn't merged my PR (I submitted it last July). You can install my fork but it's kind of complicated (because you need to have all the import paths correct):

go get -u github.com/jstemmer/gotags
cd $GOPATH/src/github.com/jstemmer/gotags
git remote add ascarter git@github.com:ascarter/gotags.git
git checkout -b excludeprivate ascarter/ascarter-excludeprivate
go install 

That should build out the version of gotags that has the two new flags I used.

I'll ping @jstemmer again on merging the PR. I'll also put something in that tests for the version of gotags - I can fall back to ctags if it is missing.

FYI the reason to use gotags is that it has much nicer completion for the standard lib (includes func params and the like). I'm pretty happy with that (at least until BBEdit gives a hook to call something nicer like gocode)

raj-room commented 8 years ago

Thanks. I was able to get the build to work after merging your addexcludes and excludeprivate gotags branches.

It might be helpful to create a single branch with both these changes, and then update the Go-bbpackage README about how to install the correct version..

Thanks again!

ascarter commented 8 years ago

Yeah - I will do that. I didn't think it would take this long for the feature to land in gotags. Thanks for the feedback.

Reopening the issue to make this fail more gracefully and to update the readme.

ascarter commented 8 years ago

Switched over to using Universal Ctags.