Hi,

99% of the time all function's won't resolve with the devsense pro vscode plugin.
It doesn't say processing anymore. I've already cleared the vendor cache.

This results in a lot of errors: https://x.gnx.li/6f21gCNR

I mainly work with laravel and working with version >= 11

The weird thing is that sometimes (not a lot) it does work and the autocomplete also works. But 99% of the time it doesn't. Not sure what I'm doing wrong or what I can do to fix this 🤔

Cheers!

    SamSerrien Hi and thank you for reporting the issue.

    I'm sorry for the inconvenience!

    Do you have a full list of unknown functions/classes? (You can get it from Problems, filter "unknown", select all, and right click -> Copy)

    It seems like only functions are affected.

      SamSerrien thank you!

      They all seem to be functions from Laravel's vendor/laravel/framework/src/Illuminate/Foundation/helpers.php file,
      and Eloquent Builder methods.

      It may happen if the file (helpers.php) was accidentally edited and has a syntax error for example.

      Do you use an ide_helper? They sometimes generate an invalid stubs that may confuse our extension a bit. (that would cause the Eloquent Builder methods issues).

      Does it help if you close all the tabs in VSCode? and re-open them.

      JakubMisek It's a freshly "composer installed" laravel vendor folder. Even if I just opened VS code with no tabs open I have all those errors. I don't use any ide_helper, or debugbar or whatever. Clean VScode with devsense and a clean laravel project. 🤔

        JakubMisek If I install a new empty laravel project ("composer create-project laravel/laravel test") I also get the same errors: https://x.gnx.li/KBZgW3G4. So this project has no extra packages or anything.

          It's not only with laravel btw. I also use KirbyCMS and it has the same problem, global and class functions are not recognised. https://x.gnx.li/yQ5TTwsQ

            Thank you for the details.

            Is there any error in VSCode's OUTPUT -> PHP Language Server

              SamSerrien It seems like it didn't find composer.json and installed.json files. It should look like this:

              Aren't your vendor files excluded from the VSCode files view?

                JakubMisek My vendor is exluded from the sidebar view yes (files.exclude {...}), could that be the problem? I had no idea the sidebar view and whatever scans the plugin does are related 🤔

                SamSerrien it could be the problem, but, it's our problem :) we didn't expect that and as a result, we probably ignored the composer packages - I'll prepare some tests to see if we're on the right track.

                  SamSerrien is the vendor folder somewhere outside the root of your VSCode workspace?

                    JakubMisek Nope. In the meanwhile I tested it and If I make the folder visible in my sidebar it works. If I hide it it doesn't 😅 So you were spot on with that one.

                    SamSerrien question - is the composer.json included in the workspace? :)

                      Fixed and preparing pre-release (the one after 1.51.15986), thanks!

                        Write a Reply...