Skip to content

Conversation

@complex857
Copy link

I was working on a PHP code completion plugin for vim and to make tag files more useful i needed the docblock comments for the individual tags.
The body of the docblock comment is just copied in as-is (with replacing the \n \r \t with the string literals "\n" "\r" "\t" so they still on one line). These comments can be used to show as documentation for the completions, or parse them for return types for methods, or types of properties and parameters. To make this work I've added a new extension field named docblock and modified the php.c to capture comments that look like docblocks as it reads sees them and add them to the tag entries.
Without having these in the tag file the plugin would have to look up the tags in their source files and that's a big performance hit.

I'm not sure if you find this useful or not, but your rewritten PHP parser is tremendously useful for me, so i wanted to contribute. (The commit dcfdff7 is unrelated to the docblock feature, but I've found that useful too and can't exclude from this pull request, you can cherry-pick though).

dudu added 5 commits January 13, 2014 21:45
The command field for the namespace tags was containing the previous
line from the file because I've forgot to delete old code for function
parameter's default value.
The previous commit was supposed to fix the issues caused by this.
If you compiled the code with -O2 or higher the tag lines for namespaces
contained the previous line as the command field, but this caused other
problems for other people too, see:
http://sourceforge.net/p/ctags/bugs/312/

Alternatively, you could define FILE_WRITE in every file where
this bug manifests too, but this patch makes it easier to fix these kinds
of errors.
The patch was inspired by the homebrew's ctags recipe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants