Issue with String Concatenation and Lag

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

Issue with String Concatenation and Lag

Postby AndyM84 » August 6th, 2012, 3:32 pm

First and foremost, I want it to be clear that I love you. Been looking for an alternative to VS.PHP for years now, stumbled upon this today with a coworker and we'll be buying a group of commercial licenses if things keep going like this through the trial.

With that bit of gushing out of the way, I have found two tiny issues that don't stop me from working but are somewhat uncomfortable.

1) When concatenating strings, if I use {} inside of double quotes (ex, "Hi {$var}") it screws up the smart indentation for the rest of the file, have to switch to doing it with "Hi " . $var instead

2) Sometimes when pulling a singleton instance, VS will lag on subsequent lines using said instance and not give me proper intellisense. This issue clears itself after a minute or so, but it's a little annoying. Example below

Code: Select all
$query = n2f_database::getInstance()->query("SELECT `id` FROM `blah` WHERE `email` = ?");
$query->addParam('email', $email, N2F_DBTYPE_STRING);


By the time I get through writing "addParam(" it slows down significantly, sometimes as slow as one character per second.

I'm running Windows 7 Ultimate x64, VS 2010 with all latest patches. Have 6GB of RAM, a quad-core AMD 2.9GHz CPU. Let me know if any other information would be useful.

Thanks for the awesome product!

Andrew
User avatar
AndyM84
 
Posts: 69
Joined: August 6th, 2012, 3:24 pm
Location: Boston, MA, USA

Re: Issue with String Concatenation and Lag

Postby Miloslav Beno » August 6th, 2012, 4:46 pm

Hi Andrew,

Thank you so much for that positive response for our extension! It makes us very happy.

1.) We were able to replicate this, it'll be fixed!

2.) This looks like a case that our code analysis has a lot of work to do. Sometimes when there isn't PHP Doc comment with type information, our engine needs to perform lot of operations. I see that piece of code you've sent us comes from N2 framework, we'll download it and profile it. When we'll be able to replicate the issue we'll fix it ASAP.

We'll be also happy to fix any other issue you might find.

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: Issue with String Concatenation and Lag

Postby AndyM84 » August 6th, 2012, 5:18 pm

Hi Miloslav,

I should note, I am one of the founders of N2 Framework, so if you have any questions feel free to let me know.

The code in question concerns a singleton instance of n2f_database which then provides an n2f_database_query object with a new SQL query. There is good phpDoc information for those sections of code, but perhaps we did it in a way that isn't helpful for the tools.

Thanks again,

Andrew
User avatar
AndyM84
 
Posts: 69
Joined: August 6th, 2012, 3:24 pm
Location: Boston, MA, USA

Re: Issue with String Concatenation and Lag

Postby Jakub Misek » August 6th, 2012, 6:07 pm

Hi Andrew,

1. The issue with '}' has been fixed. It also affected brace matching and syntax highlighting. The fix will be included in the next update.

2. I've tested N2 Framework, latest stable (Yverdon v0.5). All the declarations are really nicely commented and it works with IntelliSense for me. One possible cause of lagging can be the initial caching of source files (which progress can be found in status bar of VisualStudio).
I'll continue with checking the issue. If you are working on specific opensource project built on n2, I can check it too.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Issue with String Concatenation and Lag

Postby AndyM84 » August 6th, 2012, 6:16 pm

Good to know! I'm using v0.8B right now (actually pulling it from the trunk so it's a bit more up-to-date) and all of those same phpDoc comments are intact, so it could just also be the size of the project I'm working on. It's not open source, unfortunately, but I wouldn't be surprised if its size was the culprit here. Regardless, it's something that I figured you'd at least want to look into.

Thanks again guys, so amazing actually having a team respond to you (the VS.PHP people were TERRIBLE last I used it).
User avatar
AndyM84
 
Posts: 69
Joined: August 6th, 2012, 3:24 pm
Location: Boston, MA, USA

Re: Issue with String Concatenation and Lag

Postby Jakub Misek » August 6th, 2012, 6:30 pm

Thanks!

I will try the latest version I find and try to replicate the issue.

I would have few more questions that would help me analyse the issue :)

If you hit F12 with caret on 'n2f_database' symbol, does it jump directly to that class declaration or does it give you multiple results in "Find Symbol Results" window?

If you hit F12 on '$query' symbol, do you see single result as well? Are there any other assignments to '$query' variable?

Thank you.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Issue with String Concatenation and Lag

Postby AndyM84 » August 6th, 2012, 6:36 pm

In both of those instances it went to the single instance I expected after pressing F12.
User avatar
AndyM84
 
Posts: 69
Joined: August 6th, 2012, 3:24 pm
Location: Boston, MA, USA

Re: Issue with String Concatenation and Lag

Postby AndyM84 » August 6th, 2012, 7:02 pm

Not sure if this is of interest, but something else I've noticed while working through this same project:

Whenever I begin invoking an object method and am filling in parameters, I get intermittent intellisense for constants and variables unless the variable is itself an object. If it is an object, after entering the -> I am given the appropriate intellisense list for that object's viewable properties. Sometimes it does it, sometimes it doesn't. It also sometimes shows a list of methods on the object for the method while in that same position, as if it's stuck on the list thinking it's still giving you the list of methods for that object.

I hope that makes sense...?
User avatar
AndyM84
 
Posts: 69
Joined: August 6th, 2012, 3:24 pm
Location: Boston, MA, USA

Re: Issue with String Concatenation and Lag

Postby Jakub Misek » August 6th, 2012, 9:38 pm

AndyM84 wrote:In both of those instances it went to the single instance I expected after pressing F12.

Thanks. I guess F12 does not lag. Do you observe the lagging always or only in first few seconds - minute after opening your website?
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Issue with String Concatenation and Lag

Postby Jakub Misek » August 6th, 2012, 9:40 pm

AndyM84 wrote:Not sure if this is of interest, but something else I've noticed while working through this same project:...

I found the bug - if I'm typing method parameters, IntelliSense shows me symbols that showed me in previous IntelliSense. I guess that's it. This will be fixed asap.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Next

Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 35 guests

cron

User Control Panel

Login

Who is online

In total there are 35 users online :: 0 registered, 0 hidden and 35 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 35 guests