abingham / emacs-ycmd

Emacs client for ycmd, the code completion system.
MIT License
384 stars 46 forks source link

How to generate tags file which can be recognized by ycmd using GNU GLOBAL? #445

Closed moyotar closed 6 years ago

moyotar commented 6 years ago

Firstly, through looking up ycmd's varibles about tags, I set ycmd-tag-files to auto and the ycmd-default-tags-file-name to GTAGS(I use GNU GLOBAL as tagging system). I found it doesn't work. Secondly, by viewing the history issue #150 , I realized it that tags file should be generated with --fields=+l option using ctags. So, How to generate tags file which can be recognized by ycmd using GNU GLOBAL? Additionally, I use pygmentsand universal ctags as plug-in parser in a python project.

ptrv commented 6 years ago

See here in YouCompleteMe readme the only supported format is with exubarant ctags. GNU Global is not supported.

moyotar commented 6 years ago

@ptrv Ok. Just now I used command ctags -e -R --fields+=l to generate ‘TAGS’ file, and set ycmd-default-tags-file-name to TAGS. But finally it didn't collect identifiers from TAGS. I found below errors.

Error loading tags-file: (wrong-type-argument stringp nil)

ptrv commented 6 years ago

you shouldn't use the -e option. That is not supported for ycmd. That's why you can leave the default value of ycmd-default-tags-file-name. Ctags generates then a file called tags and not TAGS

moyotar commented 6 years ago

d:/WorkSpace//TAGS and d:/WorkSpace/tags are the same file Error loading tags-file: (user-error File d:/WorkSpace/TAGS is not a valid tags table)

There‘s no TAGS in this directory. I use the default value of ycmd-default-tags-file-name. It seems tags file would be turn to TAGS automatically

moyotar commented 6 years ago

@ptrv Help me solve this.

abingham commented 6 years ago

d:/WorkSpace//TAGS and d:/WorkSpace/tags are the same file Error loading tags-file: (user-error File d:/WorkSpace/TAGS is not a valid tags table)

What is reporting this? ycmd, some emacs package, or what?

moyotar commented 6 years ago

How to know the package which report this?

abingham commented 6 years ago

Where are you seeing it? Is ycmd printing it in the ycmd-server buffer?

On Wed, Sep 27, 2017 at 8:32 AM moyotar notifications@github.com wrote:

How to know the package which report this?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/abingham/emacs-ycmd/issues/445#issuecomment-332422859, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE1eBvSv9na_q_hGvHXI5H53OGslWK4ks5smev4gaJpZM4PaavE .

moyotar commented 6 years ago

In *Messages* buffer.

moyotar commented 6 years ago

@abingham Maybe it doesn't affect ycmd. In *ycmd-server*, I find nothing about tags file.

ptrv commented 6 years ago

I think the problem is related to the case insensitive file system. If you have both files tags and TAGS Emacs will always find TAGS first, even if you have spacified tags. I had the same problem on MacOS with case insensitive file system. So either remove TAGS or set a different file name for the tags file for ycmd with the option ycmd-default-tags-file-name. How exactly you have to create the tags file please look up in the ycmd or youcompleteme project. You cannot use ctags with the -e option.

moyotar commented 6 years ago

I used ctags -f "mytags" -R --fields=+l to generate tags file and set ycmd-default-tags-file-name to mytags. But, it didn't collect any thing from tags file and had nothing output about tags file.