VS2017 intellisense with mix of PHP and JS

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

VS2017 intellisense with mix of PHP and JS

Postby goodman98155 » August 15th, 2017, 4:53 pm

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.
goodman98155
 
Posts: 7
Joined: July 5th, 2016, 3:28 pm

Re: VS2017 intellisense with mix of PHP and JS

Postby Miloslav Beno » August 22nd, 2017, 11:12 am

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!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: VS2017 intellisense with mix of PHP and JS

Postby Daniel Essl » March 3rd, 2018, 10:40 am

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
You do not have the required permissions to view the files attached to this post.
Daniel Essl
 
Posts: 4
Joined: March 3rd, 2018, 10:35 am

Re: VS2017 intellisense with mix of PHP and JS

Postby AndyM84 » March 4th, 2018, 3:17 am

Is there a fix planned for this?
User avatar
AndyM84
 
Posts: 69
Joined: August 6th, 2012, 3:24 pm
Location: Boston, MA, USA

Re: VS2017 intellisense with mix of PHP and JS

Postby Miloslav Beno » March 5th, 2018, 9:24 am

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
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: VS2017 intellisense with mix of PHP and JS

Postby AndyM84 » March 5th, 2018, 5:59 pm

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!
User avatar
AndyM84
 
Posts: 69
Joined: August 6th, 2012, 3:24 pm
Location: Boston, MA, USA

Re: VS2017 intellisense with mix of PHP and JS

Postby AndyM84 » March 31st, 2018, 1:20 pm

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!
User avatar
AndyM84
 
Posts: 69
Joined: August 6th, 2012, 3:24 pm
Location: Boston, MA, USA

Re: VS2017 intellisense with mix of PHP and JS

Postby goodman98155 » April 11th, 2018, 7:27 pm

This is no longer a problem as of the April 11th v 1.27. Fixed for me- thank you so much!!
goodman98155
 
Posts: 7
Joined: July 5th, 2016, 3:28 pm

Re: VS2017 intellisense with mix of PHP and JS

Postby AndyM84 » April 19th, 2018, 5:09 am

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!
User avatar
AndyM84
 
Posts: 69
Joined: August 6th, 2012, 3:24 pm
Location: Boston, MA, USA

Re: VS2017 intellisense with mix of PHP and JS

Postby goodman98155 » April 19th, 2018, 1:40 pm

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.
goodman98155
 
Posts: 7
Joined: July 5th, 2016, 3:28 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 46 guests

cron

User Control Panel

Login

Who is online

In total there are 46 users online :: 0 registered, 0 hidden and 46 guests (based on users active over the past 5 minutes)
Most users ever online was 256 on March 28th, 2024, 9:42 am

Users browsing this forum: No registered users and 46 guests