Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress Autocomplete? #11

Open
clockwiseq opened this issue Jun 25, 2015 · 17 comments
Open

WordPress Autocomplete? #11

clockwiseq opened this issue Jun 25, 2015 · 17 comments

Comments

@clockwiseq
Copy link

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?

@pbellon
Copy link

pbellon commented Jul 1, 2015

Same issue here.

@bennettscience
Copy link

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

@clockwiseq
Copy link
Author

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.

@colorful-tones
Copy link

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.

@clockwiseq
Copy link
Author

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

@ethanclevenger91
Copy link

Did anyone resolve this? I've restarted Atom.

@clockwiseq
Copy link
Author

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

@sergiohdob
Copy link

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

@Jinksi
Copy link

Jinksi commented Sep 21, 2015

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

@annalinneajohansson
Copy link

Thank you @Jinksi, that solved it for me!

@Jinksi
Copy link

Jinksi commented Oct 2, 2015

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

@strider72
Copy link

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

@azizur
Copy link
Owner

azizur commented Mar 6, 2016

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

@clockwiseq
Copy link
Author

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

@azizur
Copy link
Owner

azizur commented Mar 8, 2016

@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.

@4selin
Copy link

4selin commented Oct 22, 2016

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

@azizur
Copy link
Owner

azizur commented Oct 23, 2016

@4selin Thank you, I will investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests