Sublime Forum

Find references not working across the project but only on opened files

#1

Find references (panel that appears on hover over, say, an exported function) only finds references on open files rather than searching in the whole project.

It used to work but not sure what happened the last few weeks or months. Does anyone know whats going on here pls?

To Reproduce
Steps to reproduce the behavior:

  1. Just find for references of an exported function that is used elsewhere but that file is not open (tested on a React project js/jsx files)
  2. It will not find references for files that are closed but if you open a file that does use the reference then it will show relevant references

Expected behavior
Previously, it used to search the whole project and was very useful. Not sure when it started but might have been a few weeks/ or even months as I was wondering why references are not being found across the project.

Environment (please complete the following information):

  • OS: macOS 14.2.1
  • Sublime Text version: 4169

Example of what I am talking about (the references function)

0 Likes

#2

That functionality is being provided by a 3rd party plugin. Perhaps check that plugin’s configuration?

0 Likes

#3

The solution is to define a jsconfig.json file.

See: https://github.com/sublimelsp/LSP/issues/2396

0 Likes

#4

I am facing the same problem with a Python project, running the same version of Sublime Text.
Look at the references when I only have one file open, references from only that file show up
When I open another file that I know has references to this function references in those file show up

and I dont think these references/definitions come from the third party plugin as mentioned on LSP issue page linked above.

0 Likes

#5

Well I fixed my issue with javascript/react by defining a jsconfig.json file and in there I define what folders to search. I also did not add or enable too many folders as otherwise I get other errors.

Not sure what you would do for Python projects though!

0 Likes