BUG - RAPID - PHP AutoComplete Errs

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.

  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;

BUG - RAPID - PHP AutoComplete Errs

Postby Will Fastie » Tue Jun 26, 2018 6:25 pm

AutoComplete for PHP makes suggestions that it should not know about:

Image

The example above shows the cursor inside a method in which nothing has been defined, including the variable $dbw. I have typed the arrow and AutoComplete is suggesting methods and properties from a class named db_writer. But how has this happened when there is no context to suggest it? How does AutoComplete know that $dbw will refer to db_writer? It should not.

$dbw is a variable I often use when creating an instance of db_writer. Such instances occur elsewhere in this particular module. So I tried this:

Image

As can be seen, AutoComplete is now correctly showing the methods for the class admin_list_table.

This tells me that AutoComplete is looking outside the scope of the current method and inferring that $dbw will refer to the class db_writer.

I consider this an error. Other tools, including VS Code, do not make this mistake.

Note: I am beginning to mention Visual Studio Code in some of my contributions to the forums. It should not be assumed that I do so because VS Code is better than Rapid PHP. In this case, VSC's autocomplete is more annoying than Rapid's because it makes suggestions that are very unlikely even if syntactically or semantically possible. When Rapid PHP's AutoComplete does not make errors as described above, it is extremely accurate, more so than VSC's. I mention VSC because, being free, it is always installed on my primary PC.
Will
WebDesignBuild.biz, Fastie.com
User avatar
Will Fastie
 
Posts: 160
Joined: Mon Jan 31, 2005 6:47 pm
Location: Timonium, MD USA

Re: BUG - RAPID - PHP AutoComplete Errs

Postby Aivars » Tue Jun 26, 2018 6:35 pm

It's hard to tell what's going on there exactly without the context (source of the project). If you want to, you can try to make a simple source/project that replicates this problem so that I can create a bug report.
Anyhow auto-complete is being improved in every major version and it's an ongoing process which due to the dynamic nature of PHP is probably neverending.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: BUG - RAPID - PHP AutoComplete Errs

Postby Will Fastie » Tue Jun 26, 2018 6:56 pm

I took the file I happened to be working with and made a project with just that one file in it. This file DOES NOT include the db_writer class, so Rapid can't be getting any information from it.

Image

This example provides more information. In the previous example AutoComplete listed 8 methods and properties and in this example it lists only 3. Those three happen to be the only ones that are mentioned in the file ordering.php. Therefore, AutoComplete must be picking up usage of $dbw from this single file and using that for suggestions.

I see that the icon next to the suggestions is the magnifying glass and I'm assuming that means the usages were found. That makes sense, I guess. But in my first example, it was showing icons for methods and properties, which means it was somehow seeing the class even though there was no context in the method for it.
Will
WebDesignBuild.biz, Fastie.com
User avatar
Will Fastie
 
Posts: 160
Joined: Mon Jan 31, 2005 6:47 pm
Location: Timonium, MD USA


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: No registered users and 15 guests

cron