PHP Automatic Syntax Check - On Cursor Movement

Let us know what you would like to see in the next version of this software

Moderator: kfury77

Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.

  • Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
  • Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
  • Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".

Please note that we DO READ all suggestions, even if a reply is not posted. Thanks!

PHP Automatic Syntax Check - On Cursor Movement

Postby Will Fastie » Wed Jun 14, 2017 6:16 am

When automatic syntax checking is enabled in Rapid PHP, syntax is checked whenever the line count of the file changes.

Instead, check the syntax whenever the editor insertion point moves away from a line that has changed.

I define a changed line as follows:
  • A new line, one that was just added by typing or pasting.
  • A deleted line.
  • A line in which the character length has changed since the insertion point was moved into it.
I believe this will eliminate the need to manually request a syntax check and will not add any significant checking overhead.
Will
Will Fastie
 
Posts: 17
Joined: Mon Jan 31, 2005 6:47 pm
Location: Timonium, MD USA

Re: PHP Automatic Syntax Check - On Cursor Movement

Postby Aivars » Fri Jun 16, 2017 11:34 am

That's a good point, this has been bothering me as well, I will create a ticket with the request.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 1989
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: PHP Automatic Syntax Check - On Cursor Movement

Postby Will Fastie » Fri Jun 16, 2017 2:31 pm

If this idea ever gets to the implementation stage, I'll be happy to help test.
Will
Will Fastie
 
Posts: 17
Joined: Mon Jan 31, 2005 6:47 pm
Location: Timonium, MD USA

Re: PHP Automatic Syntax Check - On Cursor Movement

Postby Will Fastie » Thu Jul 06, 2017 2:37 pm

I wanted to update my original suggestion. I wrote:
... check the syntax whenever the editor insertion point moves away from a line that has changed.

Then I defined "changed" as meaning adding, deleting, or editing a line.

My new thought is that adding or deleting a blank line should not count as an added or deleted line because blank lines do not affect syntax in PHP (or CSS, HTML, JS, etc.).

I mention this because I have noticed that the pink highlight for an error line can vanish quickly when typing continues. I would like that highlight to remain as long as possible, so I thought about the conditions under which the highlight would be removed. I think that should be when the next syntax check happens and that means it is important make sure that no extraneous syntax checks are initiated to give the coder has as much time as possible to notice that an error has been found.

I can't speak to Blumentals' code and I might be wrong about this, but I think the idea of only invoking a syntax check when something has actually changed will reduce syntax checking overhead. The definition of "changed" means that the modification is one that can affect syntax and my new realization is that adding or deleting blank lines does not affect syntax, a statement that applies not only to PHP but also to CSS, HTML, and JS.

Finally, if a line with an error is highlighted (which in my scenario means that no subsequent syntax check has been invoked) and the user saves/closes the file, automatically run a syntax check. I have not carefully thought out the implications of this. I don't want the editor telling me I can't close the file but I also don't want to close a file thinking everything is okay when it isn't.
Will
Will Fastie
 
Posts: 17
Joined: Mon Jan 31, 2005 6:47 pm
Location: Timonium, MD USA

Re: PHP Automatic Syntax Check - On Cursor Movement

Postby Aivars » Tue Jul 18, 2017 2:25 pm

I like the idea of syntax checking on save, probably right after the save. It's a logical place to check for syntax errors because generally people will save their code after completing a line or a group of lines that they expect to be correct. We will add it to the next big version.

About the blank lines, we will give it a thought. Like you said, we must consider the implications.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 1989
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron