Author Topic: Win7x64 B5: List References showing NO REFERENCES files  (Read 2897 times)

TKasparek

  • Senior Community Member
  • Posts: 246
  • Hero Points: 29
Win7x64 B5: List References showing NO REFERENCES files
« on: September 22, 2014, 04:41:32 PM »
I'm having an issue with list references showing some files that don't actually contain a reference. It also seems to have trouble when a files path contains a space. See attached image.

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: Win7x64 B5: List References showing NO REFERENCES files
« Reply #1 on: September 23, 2014, 03:29:03 PM »
That looks like normal behavior.  When you have the option to find reference incrementally enabled (Tools > Options > Editing > Context Tagging > References > Find reference incrementally), when SlickEdit encounters a file that contains the symbol (a string match) that references is searching for, it searches the actual occurrences and does symbol lookups in order to determine if it matches the symbol you are searching for references to (same class, etc).  If nothing matches, it leaves the file in the list and marks it as having "NO REFERENCES...".   This also happens if you manually try to expand a node in the references tree.

In the normal mode, files like this would still be added to the tree, but when References is initially cycling through matches, it removes the files that have no references.  The reason that it leaves them behind in incremental mode and when you expand a file manually is so that you don't have tree nodes disappear out from under you when you are exploring symbol references manually.

That said, the real question is why the references in the files that show "NO REFERENCES..." do not match.  I can say with certainty, it has nothing to do with spaces in directory or file names.  99% of the time, it is on account of C preprocessing making the code unrecognizable.  The other 1% of the time, it has to do with C++ namespace or template resolution cases that are just plain difficult for anything but a compiler to deal with (and not easy for compilers either).

Open one of those files, look at the Defs tool window to verify that the symbols in that file are tagged as expected (including the class names), then go to one of the occurrences of the symbol you are looking for and look at the Preview tool window.  If the symbol is not found, or it does not find the same symbol that you were doing references to, then the question is what does it find, and why does it find something other than what it should?  Again, that usually goes back to preprocessing, templates, or namespaces.  Since it looks like the code you have there is plain C, I'm going to narrow that down to preprocessing.

That's about all the help I can give you on this one without seeing the source code.

TKasparek

  • Senior Community Member
  • Posts: 246
  • Hero Points: 29
Re: Win7x64 B5: List References showing NO REFERENCES files
« Reply #2 on: September 23, 2014, 03:57:12 PM »
A few things to add real quick:
I have "Find reference incrementally" turned off; I just verified this.
I don't have a file called Console, that is part of the directory name.
This is a small project but has 15 files in it.

The two files that show NO REFERENCES there; if you look at the paths, they are weird. One only goes to "c:\...\Console" and considers that a file (last one) and the other starts at Tools (part of a directory name) and continues to the file, which is the file shown first.

I can't open those files, as they technically don't exist per the path they show.
This seems to happen for me about 75% of the time.

~Tom

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: Win7x64 B5: List References showing NO REFERENCES files
« Reply #3 on: September 23, 2014, 05:17:20 PM »
I did find it odd that you had a file with no extension, but did not notice the broken path.  This problem will be fixed in the next build.  Thanks for the details.