Kristoffer thank you for reminding me;

It should not happen when the type $module can be inferred - I'll check what's going on )

    Kristoffer we can't replicate the issue. The "find all references" command takes the type into account, so there might be something else unexpected happening?

      There might be something wrong with our settings.
      If i put an error in some file, by calling a random not-existing function the error shows up in the problems panel.
      However, when i close the file the error disappears.

      Any idea what settings might be worth looking into?

      This is our settings.json:

      {
      "files.exclude": {
      "/node_modules": true,
      },
      "files.watcherExclude": {
      "
      /.git/objects/": true,
      "
      /.git/subtree-cache/": true,
      "
      /node_modules//": true,
      },
      "php.version": "8.2.1",
      "php.problems.exclude" : {
      "
      /shared/vendor/**" : true,
      "/": [410]
      },
      "php.stubs": [
      "
      ",
      "imagick",
      "gmp"
      ],
      "editor.codeLens": false
      }

        I figured it out: The setting "php.problems.scope" was set to "opened" (by default).
        Changed it to "user" and both the probems-panel and "find all references" started working as expected.

        8 days later

        I still have this problem:

        Find All References

        It shows method-calls on other objects with the same method-name. This is even when the classes are in different namespaces.

        I tried to set up a small example in a new codebase but it worked. So basically I can only demonstrate this in our huge work codebase.

          kburton-dev thank you for reminding us.

          I'll try to replicate the issue.

            2 years later

            Hi, Still have the 'Find all references' issue that searche a function on other classes. Any solution ? thank you.

              recherchedev Thank you for pointing this out,

              Do you have a more specific example? This feature depends on how well the editor resolves the type of class.

                10 days later
                • Edited

                Hello! Why is behavior different when click on reference on top of methods and when "Go to references"?
                In first case it show only places where the method is called and in second case it shows all related places.

                Here it is "Locations(1)" in title;

                And here it's "References (3)" in title.

                  Maxim Thank you for the question.

                  I think it's for historical reasons. The first one does not show definitions and should be called "Usages" instead.

                    Write a Reply...