I'm having an issue that PHP Tools is complaining about missing arguments in a constructor.
I've attached a screenshot of the issue: https://share.cleanshot.com/nR6pZF1h
Here the PartnerBuilder class complains for the arguments CountryService and EmailFactory but these arguments are not part of the PartnerBuilder class as you see on the left side of the editor?
I tried the following:

  • Running the PHP Tools command to clear the vendor/cache
  • Restarting VS Code

I'm running the latest extension of PHP Tools.

What could cause this issue? I've seen this in the past with other classes.

    FilipVanReeth Thank you for reporting the issue.

    Isn't there another PartnerBuilder class? If you navigate to the definition (F12), it should point to the class it thinks it is.

      JakubMisek I think I found the issue. I use CoPilot and it seems that when CoPilot proposes updates on the class that PHP Tools takes these arguments into account. This results in multiple class arguments on the documentation tooltip. When I start a new CoPilot chat and then reload VS Code it fixes the issue. Is there an option that PHP Tools doesn't take the PHP code in the CoPilot chat into account?

      I hope this can help in resolving the issue?

      FilipVanReeth thank you for looking into that!

      We generally look into generated documents (because we also analyze them for errors). Although their content should be dismissed once they are closed. Is the generated code right in the still-opened CoPilot chat window?

        JakubMisek Indeed. When I open a new CoPilot chat window and reload VS Code the error is gone.

          @JakubMisek Is there a VS Code setting where I can set that PHP Tools ignores the Copilot chat code?

            a month later

            Sorry for the late reply!

            We should exclude the copilot documents by default (we need to fix this). As a workaround, users can use "files.exclude" setting with a pattern matching the copilot's generated document names. Anyways; we'll try to fix this in the next update.

              We have fixed the problem with the code generated by Copilot; the fix will be available in the next update.

              Thanks!

                Write a Reply...