How to add comments to an Exuberant Ctags config file?

后端 未结 4 1965
梦如初夏
梦如初夏 2021-02-03 21:44

What character can I use to put comments in an Exuberant Ctags .ctags file?

I would like to add comments with explanations, and perhaps to disable some rege

4条回答
  •  不要未来只要你来
    2021-02-03 22:00

    You can't! I looked through the source code (thanks to apt-get source). There are no checks for lines to ignore. The relevant code is in parseFileOptions() in options.c

    But sometimes comments are a neccessity, so as a workaround I put a comment in as a regexp, in such as way that it is unlikely to ever match anything.

    --regex-coffee=/^(COMMENT: Disable next line when using prop tag)/\1/X,XXX/
    

    The ^ helps the match to fail quickly, whilst the ( ) wrapper is purely for visual effect.

    Your comment should be a valid regexp, to avoid warnings on stderr. (That means unescaped /s must be avoided, and if you use any [ ] ( or )s they should be paired up.) See Tom's solution to avoid these restrictions.

提交回复
热议问题