erichard / SublimePHPCompanion

A Sublime Text plugin that provides cool stuff for PHP 5.3+ coding session.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Find Use" shows nothing

Pictor13 opened this issue · comments

Since some time the "Find Use" functionality completely stopped working on my Sublime Text 3.2.

Steps I follow:

  • select the classname in the PHP file
  • fire the "Find Use" command from Sublime's command palette
  • nothing happens.

Usually I would expect the list of possible choices to appear; but it doesn't.
And there is no error in the console from Sublime.

I can't debug, I can't see any error; just the command runs and sorts no effects.

How can I solve, or debug, the issue?

ST version: 3.2.1 Build 3207
OS version: macOS 10.14.3 (Mojave)

Looks like the issue is happening because of the folders excluded out of the indexing, in the general SublimeText settings (index_exclude_patterns).
Folders like vendor/, where Composer installs all the dependencies, won't be searched for classes' FQDN.

I understand why, technically, but still am wondering if there's a way to workaround this limit, since indexing has been disabled for other reasons, but the "Find Use" is something that is always needed regardless of excluded folders.

Or, at least, the plugin should probably log something/anything when is not able to find a class. Because just silently failing was feeling like a bug; like something that just do not work, more than something that didn't find results.

I had the same issue not only with 'find_use', but with 'goto_definition_scope' as well.

What I did was extract it using PackageResourceViewer in the Packages folders and the commands started working again.

@RossTsachev Sounds weird; there should be no difference between a package and its extracted version.
You sure that wasn't just because of needing to restart Sublime in order to make it work? 🤔

Anyway with "the commands started working again" you mean that it would work even with paths that match the index_exclude_patterns?

@Pictor13 PHP Companion find classes in the index when you use find_use, so there is no way that it can match something that is excluded by index_exclude_patterns.

@Pictor13 , the paths that match the index_exclude_patterns are not included in the results.

Some of the commands were working before I extracted the package, just not the ones searching other files.

@erichard tnx for the confirmation!
@RossTsachev still sounds weird, given that the source code is exactly the same. If you find more insight I suppose that could be some bug with the (new?) version of SublimeText or PackageControl.

I close the issue here, since the reason for the problem has been identified. 👍