Code compile check |
Veteran
|
How would that work? The only way to check for runtime errors in code is to, well, run it. In most cases, randomly running your code like this would be a bad thing.
|
||||||||||||
|
Guru master
|
The closest thing you can come to a runtime code analyzer right now is by using the Zend Code Analyzer. It's included in Zend Studio and it checks your code on a large number of coding mistakes and so on. It can be used as an integration tool in PhpED (that's how I do it). Unfortunately this tool is only included in Zend Studio and not available separately, so you could download a trial version and just get the ZendCodeAnalyzer.exe file from the installation folder and add it to PhpED.
|
||||||||||||
|
|
What the checker in EnginSite does is parsing through the entire file and indicating unknown keywords, missing braces, missing semicolons, falsely crafted if and switch statements, etc. PHPEd does this already, but it indicates any error only by some squiggly line that for a missing or extra brace can be fairly small and the red dash somewhere in the right scroll bar.
I think that is not obvious enough and a bit more verbose reporting will help a lot. The squiggly line indicates only that something is broken, but there is no indication as to what. I find it quite annoying to go a dozen scripts deep into my project just to find out that I missed some equal sign somewhere. Yea, I know, it is my fault for writing buggy code, but it happens. |
||||||||||||
|
Veteran
|
So what you're really asking for is just a way to make errors more obvious. On that, I agree, and I believe it's been requested a few times in the past.
I'd really like to have a separate Check Syntax command that simply selects the first syntax error and generates an explanatory error message. I use a similar command all the time in BBEdit and love it. Any way to do this in PhpED? |
||||||||||||
|
Guru master
|
Which is exactly what ZendCodeAnalyzer does (and more)... just check into it, it's perfectly usable as an integration tool.
|
||||||||||||
|
|
OK, while forking around in NuSphere I did come across the Instant Error Analysis function (CTRL+ALT+V), which is more like what I am looking for, but it doesn't detect unknown code words.
So, how do I integrate the ZendCodeAnalyzer into PHPEd Standard? |
||||||||||||
|
Veteran
|
Ramon, does Instant Error Analysis do anything for PHP code? Because the Help says "Click to run html error analysis. The check is performed with CSE HTML Validator Lite", I have not even bothered to use it
|
||||||||||||
_________________ |
|
I removed a curly brace of an if block and it found that, but when I added an extra "a" into a PHP keyword there was no error message in the log tab. If it would have been an HTML validator checking I'd expect to see a few dozen errors reported when throwing PHP code at it.
I tried it without checking what it checks, but since I am using a PHP IDE I'd think that such a feature checks PHP code, not just HTML. And besides that, the Standard version supposedly does not have an HTML validator. That is no big deal as there are quite a few free ones that NuSphere really could have included, same applies for PHPDoc. My guess is that this was done to artificially make the Professional version look, well, more professional. That is a different story and the folks from NuSphere already got an earful for that. |
||||||||||||
|
Veteran
|
The problem is that Zend Studio is licensed software, so pulling the analyzer tool from the trial version for use with PhpED is almost certainly a license violation -- and, consequently, a risky move with my employer (not to mention, an ethically challenged move). What really needs to happen is for NuSphere to either make their own version, or for them to license the Zend tool for inclusion with PhpED. |
||||||||||||||
|
|
Or license it from Luckasoft, because that one works great.
|
||||||||||||
|
Guru master
|
I can imagine that being a problem for people, although I don't know their EULA. As I have a perpetual license on Zend Studio I don't keep that sort of things in mind. Made the mistake of going for that first, before I decided to go for PhpED |
||||||||||||||
|
Code compile check |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by