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

BTags does not work with C++ #17

Closed
walkingsparrow opened this issue Sep 28, 2015 · 7 comments
Closed

BTags does not work with C++ #17

walkingsparrow opened this issue Sep 28, 2015 · 7 comments
Labels

Comments

@walkingsparrow
Copy link

BTags works for my Python files, but on C++ files, I got "Failed to extract tags".

@walkingsparrow
Copy link
Author

Not sure why you want me to check Python. Python works. But C++ does not
work.

2015年9月28日星期一,Junegunn Choi notifications@github.com 写道:

  • See the output of :echo &filetype from vim, it should be python
  • Check if ctags -f - --sort=no --excmd=number --language-force=python
    FILENAME works


Reply to this email directly or view it on GitHub
#17 (comment).

@junegunn
Copy link
Owner

Yeah, I misread the comment. Looks like cpp is not a valid type for ctags command.

ctags -f - --sort=no --excmd=number --language-force=cpp FILENAME
ctags: Unknown language "cpp" in "language-force" option

@walkingsparrow
Copy link
Author

I see. It seems one possible solution would be to force ctags to use c
tags for c++.

2015年9月28日星期一,Junegunn Choi notifications@github.com 写道:

Yeah, I misread the comment. Looks like cpp is not a valid type for ctags
command.

ctags -f - --sort=no --excmd=number --language-force=cpp FILENAME
ctags: Unknown language "cpp" in "language-force" option


Reply to this email directly or view it on GitHub
#17 (comment).

@junegunn junegunn reopened this Sep 29, 2015
@junegunn
Copy link
Owner

Hmm, I just decided not to use the option, ctags seems to do good enough job inferring the right type for the file, even checking the she-bang line.

http://ctags.sourceforge.net/ctags.html

Unless the −−language−force option is specified, the language of each source file is automatically selected based upon a mapping of file names to languages. The mappings in effect for each language may be display using the −−list−maps option and may be changed using the −−langmap option. On platforms which support it, if the name of a file is not mapped to a language and the file is executable, the first line of the file is checked to see if the file is a "#!" script for a recognized language.

@vpshastry
Copy link

Instead of providing cpp provide c++ in generating ctags.
--language-force=c++ that should work.

@vpshastry
Copy link

making it --language-force=auto solved it for me.

ctags -f - --sort=no --excmd=number --language-force=auto %s', expand('%:S')

@JohanChane
Copy link
Contributor

Work for me.

printf('ctags -f - --sort=yes --excmd=number --language-force=%s %s 2> %s %s', &filetype == 'cpp' ? 'c++' : &filetype, escaped, null, sort)

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

No branches or pull requests

4 participants