A page on d.o summarizing this would be really great!<br>Also a blog post would get it in Google for future searches!<br><br><div class="gmail_quote">On Fri, Jul 31, 2009 at 5:58 PM, Sam Tresler <span dir="ltr"><<a href="mailto:sam@treslerdesigns.com">sam@treslerdesigns.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You know... it said that at the top of the <a href="http://api.drupal.org" target="_blank">api.drupal.org</a> page, but I guess it didn't occur to me to actually look... Thanks.<br>
<br>
Works like a charm. I'd really rather skip the first incarnation I had, and just have the hooks loaded. I'll update the vim docs here shortly, but for the record.<br>
<br>
<br>
$ cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib co -r DRUPAL-6--1 -d drupal6 contributions/docs/developer/hooks<br>
$ ctags -R -o drupal6.tags hooks<br>
$ mv drupal.tags ~/.vim<br>
<br>
(make the .vim directory if you need to)<br>
<br>
Then add this to ~/.vimrc<br>
<br>
if has("autocmd")<br>
" Drupal *.module and *.install files.<br>
augroup module<br>
autocmd BufRead,BufNewFile *.module set filetype=php<br>
autocmd BufRead,BufNewFile *.install set filetype=php<br>
set tags=.vim/drupal6.tags<br>
augroup END<br>
endif<br>
<br>
And you have code-hinting for drupal core in vim. Just remember to update it as you change versions. But it sounds like in Drupal 7 this can scrape directly from .api.php files; I haven't even looked at those yet.<br>
<br>
Now what was I doing before this diversion....<br>
<br>
-S<br>
<br>
<br>
<br>
<br>
Neil Drumm wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
6.x and lower: <a href="http://cvs.drupal.org/viewvc.py/drupal/contributions/docs/developer/hooks/?pathrev=DRUPAL-6--1" target="_blank">http://cvs.drupal.org/viewvc.py/drupal/contributions/docs/developer/hooks/?pathrev=DRUPAL-6--1</a><br>
7.x: *.api.php in module directories.<br>
<br>
-Neil<br>
<br></div><div class="im">
On Fri, Jul 31, 2009 at 2:03 PM, Sam Tresler <<a href="mailto:sam@treslerdesigns.com" target="_blank">sam@treslerdesigns.com</a> <mailto:<a href="mailto:sam@treslerdesigns.com" target="_blank">sam@treslerdesigns.com</a>>> wrote:<br>
<br>
Thanks Neil,<br>
Some further digging and I found out that php code completion in<br>
vim can map to a ctags output file, which is pretty easy to generate.<br>
<br>
ctags -R -o drupal6.tags --langmap=php:.module *<br>
<br>
then load it in vim<br>
<br>
:set tags=drupal6.tags<br>
<br>
and you have code complete for every function in core.<br>
<br>
However, this unfortunately doesn't get code complete on hooks, as<br>
they aren't actually named in core, but constructed from<br>
modulename_function().<br>
<br>
So, I guess my next question is where are the hook function<br></div>
definitions from <a href="http://api.drupal.org" target="_blank">api.drupal.org</a> <<a href="http://api.drupal.org" target="_blank">http://api.drupal.org</a>> generated?<div class="im"><br>
<br>
Thanks in advance.<br>
<br>
-S<br>
<br>
<br>
<br>
<br>
Neil Drumm wrote:<br>
<br>
<a href="http://api.drupal.org/api/function_dump/6" target="_blank">http://api.drupal.org/api/function_dump/6</a> might have worked at<br>
some point. I honestly haven't paid any attention to that page,<br>
which might integrate with IDEs; apparently no one else has either.<br>
<br>
This list is already available in JSON format in the development<br>
version of API module. That or another format should be present<br>
in the future for an api_filter module to provide an input<br>
format filter without running the api module.<br>
<br>
-Neil<br>
<br>
On Fri, Jul 31, 2009 at 12:26 PM, Sam Tresler<br>
<<a href="mailto:sam@treslerdesigns.com" target="_blank">sam@treslerdesigns.com</a> <mailto:<a href="mailto:sam@treslerdesigns.com" target="_blank">sam@treslerdesigns.com</a>><br></div>
<mailto:<a href="mailto:sam@treslerdesigns.com" target="_blank">sam@treslerdesigns.com</a> <mailto:<a href="mailto:sam@treslerdesigns.com" target="_blank">sam@treslerdesigns.com</a>>>><div class="im">
<br>
wrote:<br>
<br>
I am working on a drupalcomplete.vim file and would like to<br>
generate<br>
an list of all of Drupal 6 (and eventually 5,7, etc) functions,<br>
objects, and anything else that might warrant code completion.<br>
<br>
I believe that <a href="http://api.drupal.org" target="_blank">api.drupal.org</a> <<a href="http://api.drupal.org" target="_blank">http://api.drupal.org</a>><br>
<<a href="http://api.drupal.org" target="_blank">http://api.drupal.org</a>> scrapes this<br>
<br>
automatically from core. I can manipulate the data to match the<br>
format I need no problem, but I thought I would ask here before I<br>
went about finding my own way to scrape the data from a cvs<br>
checkout.<br>
<br>
This was broached before here<br>
<a href="http://lists.drupal.org/pipermail/development/2009-February/032090.html" target="_blank">http://lists.drupal.org/pipermail/development/2009-February/032090.html</a><br>
but appears stalled.<br>
<br>
yes, I have too much time on my hands currently.<br>
<br>
Cheers. -Sam<br>
<br>
<br>
<br>
<br>
-- Neil Drumm<br>
<a href="http://delocalizedham.com" target="_blank">http://delocalizedham.com</a><br>
<br>
<br>
<br>
<br>
-- <br>
Neil Drumm<br>
<a href="http://delocalizedham.com" target="_blank">http://delocalizedham.com</a><br>
</div></blockquote>
</blockquote></div><br><br clear="all"><br>-- <br>Khalid M. Baheyeldin<br><a href="http://2bits.com">2bits.com</a>, Inc.<br><a href="http://2bits.com">http://2bits.com</a><br>Drupal optimization, development, customization and consulting.<br>
Simplicity is prerequisite for reliability. -- Edsger W.Dijkstra<br>Simplicity is the ultimate sophistication. -- Leonardo da Vinci<br>