When working in a Drupal 8 project and using the PHPComplete plugin for omi completion I am see the following error.

Error detected while processing function phpcomplete#CompletePHP..phpcomplete#GetCurrentNameSpace..phpcomplete#GetTaglist:
line   21:
E431: Format error in tags file "/Users/kepford/bin/dotfiles/vim/bundle/vimrc/bundle/vim-plugin-for-drupal/tagfiles/drupal8.tags"
Press ENTER or type command to continue
Error detected while processing function phpcomplete#CompletePHP..phpcomplete#GetCurrentNameSpace..phpcomplete#GetTaglist:
line   21:
Before byte 648011
Press ENTER or type command to continue

I have confirmed that PHPComplete is working properly by testing it in other PHP projects such as Sculpin. I also deleted the drupal8.tags file and completion actually worked.

Comments

kepford created an issue. See original summary.

kepford’s picture

Issue summary: View changes
kepford’s picture

Issue summary: View changes
StatusFileSize
new31.28 KB
Metal3d’s picture

StatusFileSize
new25.3 KB

I have exactly the same problem and finding a solution about drupal8.tags that have too long lines. The lines referencing CKEDITOR are very too long. So, I opened drupal8.tags file and I called:

:%s/.*CKEDITOR.*//g
:g/^$/d

The resulting file has now no CKEDITOR references and no blank lines. Then, it works:

phpcomplete ok

kepford’s picture

That seem's to have resolved the issue for me. I'll run this for a while and one of us can submit a patch :) Thanks @Metal3d

benjifisher’s picture

Status: Active » Needs review
StatusFileSize
new1.35 KB

Thanks for reporting and diagnosing the problem. The tags file for D8 includes tags for several minified javascript files, and ctags generates very long lines from these. The attached patch updates the drush vimrc-tag-gen command to exclude those. (It also fixes an embarrassing mistake, where I used += instead of array_merge() on simple arrays.) Besides files named "*.min.js" or "*-min.js", we now exclude "*/ckeditor/lang/*.js", from which ctags generates the long lines that you noticed.

If you have ctags installed on your system (brew install ctags if you use a Mac and Homebrew) then you can test this patch with

drush help tags
drush -v tags --include-js=yes --include-test=yes --make-portable

I have already updated the tags files included with this project: see #2840859: Update tags files for Drupal 8.2.4, 7.53, and 6.38.

rodrigoaguilera’s picture

Version: 7.x-1.1 » 8.x-1.x-dev
Status: Needs review » Fixed

I tried to reproduce the issue by doing the following:

1 - Without applying the patch: open core/modules/user/src/Plugin/Block/UserLoginBlock.php and do omnicompletion (C-x C-o) in front of "$this->" and I can see suggestions for 2 methods and 1 variable.
2 - On a drupal 8 root run "drush -v tags --include-js=yes --include-test=yes --make-portable". This generates a "tags" file that I use to overwrite bundle/vim-plugin-for-drupal/tagfiles/drupal8.tags
3 - Now I have a drupal8.tags with long lines and I try step 1 with same results but I expect a failure.
4 - I install phpcomplete.vim and repeat step 1 with same results. I expected that by installing this plugin I could see methods from the class I am extending but I guess that needs generating a different ctags.
5- Instead of generating the tags file I reverted to and old version with "git checkout 971eeb6 bundle/vim-plugin-for-drupal/tagfiles/drupal8.tags" and I was able to reproduce it. This difference is probably because I am using ctags 5.9~svn20110310-11 from debian stretch and the drupal8.tags file states that is being generated with ctags 5.8.

I can confirm that applying the patch generates a tags file without the long lines.
Supertab also autocompletes fine including all words from the drupal8.tags file.

Thanks for for your help.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.