atom-wordpress-api icon indicating copy to clipboard operation
atom-wordpress-api copied to clipboard

WordPress Autocomplete?

Open clockwiseq opened this issue 9 years ago • 17 comments

I've added the wordpress-api to Atom and have a .php file open that I created for a plugin and I have yet to see any auto-complete. Am I missing something?

clockwiseq avatar Jun 25 '15 23:06 clockwiseq

Same issue here.

pbellon avatar Jul 01 '15 13:07 pbellon

After you install the package you need to quit and reopen Atom.

bennettscience avatar Jul 21 '15 20:07 bennettscience

I closed the application, reopened it, still no auto-complete for wordpress. I also rebooted my PC and tried again and no luck. I'm trying the following:

function MyWordPressTest($somevar) {
    global $wpdb;
    $tablename = $wpdb->prefix.MYTABLE_VARIABLE;
    $sql = $wpdb->prepare("SELECT * FROM $tablename WHERE id = %d", 34);
}

When I type $wpdb-> nothing pops up.

clockwiseq avatar Jul 22 '15 02:07 clockwiseq

I started digging into the package, and first file I opened was this: https://github.com/azizur/atom-wordpress-api/blob/master/grammars/wordpress.cson

Based on that...I think that the file has to be a save/opened .php file. If you just Cmd+N to open/start a new file, and start typing it won't show.

colorful-tones avatar Aug 02 '15 15:08 colorful-tones

The autocomplete does appear, but it's not complete:

wordpress-autocomplete-not

It should have had the -> identifier like below and it did not:

wordpress-autocomplete-should-be

clockwiseq avatar Aug 02 '15 19:08 clockwiseq

Did anyone resolve this? I've restarted Atom.

ethanclevenger91 avatar Sep 09 '15 21:09 ethanclevenger91

I've gotten the latest and it still appears to not work properly.

clockwiseq avatar Sep 09 '15 21:09 clockwiseq

I try to use autocomplete but not work, not appears nothing. How do you get $wpdb function?

sergiohdob avatar Sep 19 '15 18:09 sergiohdob

I've found that I had to disable autocomplete-php to get this to work

Jinksi avatar Sep 21 '15 22:09 Jinksi

Thank you @Jinksi, that solved it for me!

annalinneajohansson avatar Oct 01 '15 13:10 annalinneajohansson

@lolitaloco - another similar package that works with autocomplete-php is atom-wordpress I've found that it autocompletes more reliably as well.

Jinksi avatar Oct 02 '15 06:10 Jinksi

Some of them work, some of them do not. For example, wp-config works, but theloop doesn't.

strider72 avatar Jan 19 '16 18:01 strider72

I have just updated the plugin please update and let me know if the issue still there.

azizur avatar Mar 06 '16 17:03 azizur

I just did a fresh install of Atom, installed the wordpress-api package, closed atom, opened a php file in atom, and then typed $wpdb->pre, and this was the result (still not correct):

image

clockwiseq avatar Mar 06 '16 20:03 clockwiseq

@clockwiseq I am yet to make some time to fix the issue properly.

What you are asking require being able to do reflection on $wpdb using PHP to find all the possible autocompletion. This is not possible at the moment. This will make the package even more complicated.

If anyone fancy a challenge to look into this and come up will a proposal I am keen to hear it.

azizur avatar Mar 08 '16 16:03 azizur

It starts to work for me after I disabled the autocomplete-atom-api package from Core Packages

4selin avatar Oct 22 '16 09:10 4selin

@4selin Thank you, I will investigate.

azizur avatar Oct 23 '16 09:10 azizur