我是一個ctags新手,使用PHP編碼。我發現這個ctags的文件在線:我的.ctags文件有什麼問題?
-R
--exclude=.svn
--tag-relative=yes
--PHP-kinds=+cfpd
--regex-PHP=/abstract\s+class\s+([^ ]+)/\1/c/
--regex-PHP=/interface\s+([^ ]+)/\1/c/
--regex-PHP=/(public\s+|static\s+|protected\s+|private\s+)\$([^ =]+)/\2/p/
--regex-PHP=/const\s+([^ =]+)/\1/d/
--regex-PHP=/final\s+(public\s+|static\s+|abstract\s+|protected\s+|private\s+)function\s+\&?\s*([^ (]+)/\2/f/
不過,我得到這個錯誤:
$ ctags
ctags: Warning: Unsupported parameter 'p' for --PHP-kinds option
從實驗我看到要定義的p
需求,而事實上它是在定義文件的第七行。那麼爲什麼錯誤被拋出?
編輯: 的ctags的文件來from here,這是從this terrific article鏈接。
這裏是我的配置的輸出:
$ ctags --version
ctags: Warning: Unsupported parameter 'p' for --PHP-kinds option
Exuberant Ctags 5.6, Copyright (C) 1996-2004 Darren Hiebert
Compiled: Jan 6 2007, 02:10:54
Addresses: <[email protected]>, http://ctags.sourceforge.net
Optional compiled features: +wildcards, +regex
$ cat ~/.ctags
-R
--exclude=.svn
--tag-relative=yes
--regex-PHP=/abstract\s+class\s+([^ ]+)/\1/c/
--regex-PHP=/interface\s+([^ ]+)/\1/c/
--regex-PHP=/(public\s+|static\s+|protected\s+|private\s+)\$([^ \t=]+)/\2/p/
--regex-PHP=/const\s+([^ \t=]+)/\1/d/
--regex-PHP=/final\s+(public\s+|static\s+|abstract\s+|protected\s+|private\s+)function\s+\&?\s*([^ (]+)/\2/f/
--PHP-kinds=+cpdf
$ ctags
ctags: Warning: Unsupported parameter 'p' for --PHP-kinds option
$
請鏈接,您發現該文件的來源。 – hakre 2012-04-13 00:31:26
字符類中有哪些字符:該行上的[^ =]'?如果有一個選項卡,請嘗試用'\ t'替換它。 – sarnold 2012-04-13 00:38:07
謝謝你,我用文件源編輯了這個問題。 – dotancohen 2012-04-13 00:44:45