Gabor de Mooij
Gabor de Mooij

Reputation: 3007

how to connect to php parser in netbeans platform

I am writing a code completion plugin for a PHP library in Java / Netbeans Platform. I need to find a way to obtain a reference to one of the PHP modules so I can interpret part of the source, anyone experience with this kind of problem?

Cheers and thanks in advance Gabor

Upvotes: 11

Views: 595

Answers (2)

Jens A. Koch
Jens A. Koch

Reputation: 41737

You would use the org.netbeans.modules.php.api and some other core stuff and implement a new CompletionProvider. (MyCompleter implements CompletionProvider)

import org.netbeans.modules.php.api.phpmodule.PhpModule;
import org.netbeans.modules.php.api.util.UiUtils;
import org.netbeans.modules.php.api.executable.PhpInterpreter;

and maybe Tokenizer and Completion could be usefull

Tokenizer

import org.netbeans.api.lexer.Token;
import org.netbeans.api.lexer.TokenSequence;

Completion

import org.netbeans.spi.editor.completion.CompletionProvider;
import org.netbeans.spi.editor.completion.CompletionResultSet;
import org.netbeans.spi.editor.completion.CompletionTask;
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery;
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask;

Upvotes: 1

Berti
Berti

Reputation: 76

In Netbeans, PHP support is initially chosen in the version you decide to download. However, you can add PHP support like you describe after the fact through Netbean's plugin functionality. Just go to Tools>Plugins and click on the Available Plugins tab at the top. There you will see a host of PHP related plugins, from Manual references to Framework specific helpers that you can install. You can also install individual plugins downloaded from here manually through another tab in the same menu interface.

See here to look at the table for download options... Notice the far right, with all the dots, that's All. Only way to start out with Java + PHP support is install support for all other languages too. A little hefty if you have focused development needs, which is probably why you skipped this.

Hope this helps!

Netbeans Downloads

Upvotes: 0

Related Questions