atom-wordpress-api
atom-wordpress-api copied to clipboard
WordPress Autocomplete?
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?
Same issue here.
After you install the package you need to quit and reopen Atom.
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.
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.
The autocomplete does appear, but it's not complete:
It should have had the -> identifier like below and it did not:
Did anyone resolve this? I've restarted Atom.
I've gotten the latest and it still appears to not work properly.
I try to use autocomplete but not work, not appears nothing. How do you get $wpdb function?
I've found that I had to disable autocomplete-php to get this to work
Thank you @Jinksi, that solved it for me!
@lolitaloco - another similar package that works with autocomplete-php is atom-wordpress I've found that it autocompletes more reliably as well.
Some of them work, some of them do not. For example, wp-config works, but theloop doesn't.
I have just updated the plugin please update and let me know if the issue still there.
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):
@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.
It starts to work for me after I disabled the autocomplete-atom-api package from Core Packages
@4selin Thank you, I will investigate.