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
Tern Eclipse Javascript Support in PHP Files #411
Comments
If your PHP editor is based on JSDT for JavaScript, it should work, but never really tested. Which plugins do you use for PHP? I think http://www.zend.com/fr/products/studio works like this. @kaloyan-raev could you confirm us that tern works inside zend studio please? |
Thanks for the quick reply. I installed Zend Studio trial just now to test it. Enabled JS support which installed Tern libraries. Same results (Tern code hinting works in .js file, but not in .php file inside script tag). |
@kisaloyan-raev could you help me please about this issue. Thanks! |
@angelozerr Sorry, I missed the previous comments. @mniewrzal Can you help here? |
Hi, |
Turns out that in tern.eclipse.ide.jsdt.ui proposal computer tern.eclipse.ide.jsdt.ui.contentassist.TernContentAssistProcessor needs additional content type org.eclipse.php.core.phpsource. I will prepare patch for this. |
Added content type to support mixed files (HTML+JS+PHP)
Tern Eclipse Javascript Support in PHP Files #411
@rrefsland once https://opensagres.ci.cloudbees.com/job/tern.java/877/ will be finished, please try to install tern.java 1.2.0-SNAPSHOT https://github.com/angelozerr/tern.java/wiki/Installation-Update-Site Thanks @mniewrzal for your job! |
Excellent.....will do. I'll try it out this weekend. |
I installed the updates to 1.2.0. It improved a little. Ex: In a PHP file.....Starting out with "$" will popup JQuery (that's an improvement). But after the selector period "$()." no methods show. In a javascript file, $(). will display all available methods. |
@rrefsland @kaloyan-raev have you an idea? |
@mniewrzal could you take at this one too? |
That's strange, it should work without converting your project to JavaScript project. |
Problem is probably only with .php files. When I will be sure that this is a problem I will try to fix situation. Today I had only a moment to verify problem. |
[Edited comment, the reply via email with screenshots didn't quite work as expected.....] Culprit was Eclipse adding an extra "<" in front of the script tag (along with an html comment inside by default). Ex: This disabled Tern assist: <<script type="text/javascript"> Tern works fine with clean < script > tags. Thanks guys. |
@rrefsland if I understand your problem, when you have It replaces HTML code with spaces and keep JS code and push this content to the tern server. I have not supported To fix the problem, https://github.com/angelozerr/tern.java/blob/master/core/tern.core/src/tern/server/protocol/html/HtmlHelper.java#L50 should be improved to replace Any contribution are welcome! |
@angelozerr Just to summarize: Tern does not handle a script tag with two Anyhow, case closed! I'll take a look and see if I can help. |
Hi,
Is there a way to enable Tern javascript support for PHP files? Namely autocomplete with Tern's JQuery module.
Tern autocompletes fine with .html files (inside script block) and .js files.
However, php files with script block do not autocomplete at all.
Thanks.
The text was updated successfully, but these errors were encountered: