Hello,

I've got a problem with the PHP Tools for Visual Studio Code extension. I'm running version 1.51.16099, in a Windows environment, connected to a server directly at the root of a WordPress installation (using Remote SSH: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh).

The problem is that some plugin in my workspace has installed the PHP Wordpress Stubs (https://github.com/php-stubs/wordpress-stubs) and, when I click on "Go to definition" on any WordPress function, your extension will always bring me to the stub definition instead of the native one (that is present in the workspace and indexed).

I've tried to exclude the folders from indexing, in both files.exclude and files.watcherExclude settings (on the remote server where the running extension is installed), trying three different glob patterns:

  1. **/php-stubs/**/*
  2. **/php-stubs/*/**
  3. php-stubs

It doesn't work.

How can I solve this issue?

Regards,
Daniele

    DanDip Thank you for the question.

    We prioritize packages in vendor folder for IntelliSense (because that's usually what gets auto-loaded). It seems for performance reasons, "files.exclude" setting is ignored within the vendor folder.

    Is there a reason you keep the php-stubs package installed?

      8 days later

      The only reason I keep php-stubs is because it is installed by third party packages and I cannot touch them.

      The files.exclude directive is ignored by you or VSCode? How can I solve this issue?

      I would like to solve the problem because it slows down my workflow when digging into code.

      Regards,
      Daniele

        11 days later

        Hello. Any suggestion?

          Hello Daniele,

          Sorry for the late reply. I don't have a workaround for this now. Preferably, we're always jumping to the function in vendor.

          I'll review if it makes more sense to prefer functions outside of vendor or both - so we can show both declarations. We can make this working in the next update.

            Hello Jakub,

            cool! It would be useful also if you let me choose which definition to go to when multiple are detected.

            Looking forward for a fix.

            Thank you,
            Daniele

            a month later

            DanDip I think Visual Studio Code always asks which one, if there are two or more definitions.

              Write a Reply...