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

gutentags_ctags_executable not working #206

Closed
SephVelut opened this issue Sep 18, 2018 · 2 comments

Comments

@SephVelut
Copy link

commented Sep 18, 2018

How do I get it to work? Is it a problem with Vim's jobstart api?

let g:gutentags_project_info = []
call add(g:gutentags_project_info, {'type': 'rust', 'file': 'Cargo.toml'})
let g:gutentags_ctags_executable_rust = 'source /home/.vim/shims/gutentags.sh && ctags'

/home/.vim/shims/gutentags.sh

ctags() {
    rusty-tags vi && mv rusty-tags.vi tags.temp
}

Never mind the error message below because it never even executes that function. Is it a bash problem with the context the cmd is being executed in?

gutentags: gutentags: ctags job failed, returned: 1
gutentags: ['mv: rename ./tags.temp to ./tags: No such file or directory', '']

@ludovicchabant

This comment has been minimized.

Copy link
Owner

commented Sep 19, 2018

Can you run :call gutentags#toggletrace() so we can see what Gutentags is doing behind the scenes? When you open a file in a Rust project, it should tell you if it detected the project type correctly. Then it will tell you the command line it's using.

I'm wondering if a ctags executable path that contains && is maybe tripping the script that wants to run it (see this line).

Once you have the debug output and the log file, you can try the generated command line yourself to check what's maybe wrong with it?

@SephVelut

This comment has been minimized.

Copy link
Author

commented Sep 19, 2018

Ah didn't know the cmd was being executed in a shell script. The issue then is that source gutentags.sh drops the ctags function into the current shell. But it is unavailable to any child shells. Like the one running in gutentags shell script. I would have to do an export -f ctags in the script where I define a custom ctags function.

There are few other considerations and I would have to look at them when I have time, like possibly needing to use bash -c for my own script. Anyway, this is what I'll just do right now and it works.

/home/.vim/shims/gutentags.sh with no function just a cmd.

#!/bin/bash

rusty-tags vi && mv rusty-tags.vi tags.temp

then

let g:gutentags_ctags_executable_rust = '/home/.vim/shims/gutentags.sh'

This is not a Gutentags issue, closing.

@SephVelut SephVelut closed this Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.