Page 1 of 1

VS2017 intellisense with mix of PHP and JS

PostPosted: August 15th, 2017, 4:53 pm
by goodman98155
In VS 2017 any JS inside of <Script type = text/javascript> in PHP files does not display as formatted/color-coded/intellisensed. It is just grey text. The PHP code is formatted nicely.
Is this something I need to adjust on my end or maybe a VS2017 thing? JS looks normal in VS2015.

Re: VS2017 intellisense with mix of PHP and JS

PostPosted: August 22nd, 2017, 11:12 am
by Miloslav Beno
Hello,

Since VS2017 Update 3 JS should work as expected in php files with all the advanced language features. Previous version of VS had some issue with JS in PHP code.

The only case when text gets grey and languages features are turned off is when php code is present inside javascript code. Unfortunatelly JS from VS can't handle this.

Try to update, if the issue will be still there please let me know.

Thank you!

Re: VS2017 intellisense with mix of PHP and JS

PostPosted: March 3rd, 2018, 10:40 am
by Daniel Essl
Hallo

I have the same Problem
Visual Studio Community 2017 V 15.5.7
PHP Tools for Visual Stuido Version 1.26.10589.2017

BR
Dani

Re: VS2017 intellisense with mix of PHP and JS

PostPosted: March 4th, 2018, 3:17 am
by AndyM84
Is there a fix planned for this?

Re: VS2017 intellisense with mix of PHP and JS

PostPosted: March 5th, 2018, 9:24 am
by Miloslav Beno
Hi Andy!

Long time no see:-) How are you? I hope everything is fine.

Anyway we are aware of this. We've even solved it for Smarty and Twig editors, but PHP editor is more complicated. I'm not able to estimate when this might be finished, because it requires to completly reimplement how PHP Editor integrates with HTML, CSS and JS in VS2017.

I will be informing about the progress on this

Re: VS2017 intellisense with mix of PHP and JS

PostPosted: March 5th, 2018, 5:59 pm
by AndyM84
Hi Miloslav! Long time indeed, but that's only because you've all been doing so good a job that I hadn't found a reason to be annoying. ;) Hopefully things are well for all of you too.

Thanks for the update, it's not a HUGE problem but it is pretty annoying having to inject session tokens everywhere so the editor continues working. Best of luck!

Re: VS2017 intellisense with mix of PHP and JS

PostPosted: March 31st, 2018, 1:20 pm
by AndyM84
Just to add something to this that MIGHT be helpful (but probably isn't), I also get a similar issue when I'm inserting PHP into HTML. If I write out the <?php by hand without the closing tag first, any remaining HTML will lose its coloring up to the next PHP tag. HOWEVER! If I paste a complete tag set (<?php ?>), the issue doesn't appear.

Shame I don't live even on the same continent, would love to get my hands dirty on things like this!

Re: VS2017 intellisense with mix of PHP and JS

PostPosted: April 11th, 2018, 7:27 pm
by goodman98155
This is no longer a problem as of the April 11th v 1.27. Fixed for me- thank you so much!!

Re: VS2017 intellisense with mix of PHP and JS

PostPosted: April 19th, 2018, 5:09 am
by AndyM84
Just to further cement myself into the "annoying" column, I found an issue in the latest version that's just a slightly more complicated version of what was happening before:

Image

If it's not clear from the GIF, using the rectangular editing feature in VS seems to break the PHP/HTML mix the same as it used to, whereas non-rectangular is working quite well.

Please don't hate me!

Re: VS2017 intellisense with mix of PHP and JS

PostPosted: April 19th, 2018, 1:40 pm
by goodman98155
AndyM84 wrote:Just to further cement myself into the "annoying" column, I found an issue in the latest version that's just a slightly more complicated version of what was happening before:


If it's not clear from the GIF, using the rectangular editing feature in VS seems to break the PHP/HTML mix the same as it used to, whereas non-rectangular is working quite well.

Please don't hate me!


LOL- yes I have seen that as well. As I recall, closing the file and reopening is the workaround. It would be nice to have that fixed.