SublimePHPCompanion icon indicating copy to clipboard operation
SublimePHPCompanion copied to clipboard

find_use expand_fqcn and goto_definition_scope don't work

Open thatdoorsajar opened this issue 9 years ago • 58 comments

I have closed sublime deleted index, opened sublime and run the GoTo Project Symbols which has reindexed sublime successfully. find_use expand_fqcn and goto_definition_scope are still not working on any assigned key combo or through running the commands from the Command Palette.

import_namespace and insert_php_constructor_property work as expected so the package is working.

find_use and expand_fqcn don't have any output in the console or bottom bar when they are run.

goto_definition_scope has no output in the console but it does say "Unable to find {ClassName}" in the bottom bar when run.

I was successfully running this package on a different machine but this new one no luck! Any suggestions?

thatdoorsajar avatar May 22 '16 10:05 thatdoorsajar

Same here, using latest dev build (which right now is 3113)

elboletaire avatar May 26 '16 10:05 elboletaire

Ditto. Same issue, using ST3 v3114 and latest from PC.

jleger98 avatar May 27 '16 17:05 jleger98

Did anyone found a workaround?

hughsaffar avatar Jun 01 '16 14:06 hughsaffar

@hughsaffar not for me atm

thatdoorsajar avatar Jun 01 '16 15:06 thatdoorsajar

Same problem here, with build 3113

iamanders avatar Jun 03 '16 07:06 iamanders

I did some digging around in the code. Seems like the row below is always returning an empty array, even when hardcoded a symbol that exists in my project.

files = window.lookup_symbol_in_index(symbol)

https://github.com/erichard/SublimePHPCompanion/blob/master/php_companion/utils.py#L18

Is this a Sublime bug maybe? This is above my Sublime skills, otherwise I would do a PR.

EDIT: Maybe related to this? https://github.com/sublimehq/Packages/issues/410

iamanders avatar Jun 07 '16 08:06 iamanders

Sorry guys For not replying here. I just don't see what I can do as I can't reproduce the problem on my machine.

As @iamanders say, it could be a Sublime bug with the index engine. Hopefully the next build will fix this.

erichard avatar Jun 09 '16 07:06 erichard

It's too bad work without this feature, it has saved me a good time.

leandromatos avatar Jun 30 '16 07:06 leandromatos

Just upgraded to the last beta build (3118) and the problem remains.

iamanders avatar Jun 30 '16 14:06 iamanders

Maybe an issue is referenced in sublime core issue tracker. Please take a look at https://github.com/SublimeTextIssues/Core

erichard avatar Jul 03 '16 15:07 erichard

It works for me now, using 3118 under both Windows and Linux :\

elboletaire avatar Jul 04 '16 10:07 elboletaire

Thats weird, works for me too now! Same version (3118) as my last comment. Don't think I have made any config changes, or installed/removed any plugins since then. Really happy that it's working now.

iamanders avatar Jul 04 '16 10:07 iamanders

Same here, it was not working yesterday. It works today... really weird.

elboletaire avatar Jul 04 '16 11:07 elboletaire

This seemed to be an issue with Sublime Text core. Now working in Sublime Text Dev Build 3118 - https://www.sublimetext.com/3dev

thatdoorsajar avatar Jul 04 '16 11:07 thatdoorsajar

Still not working here ...

leandromatos avatar Jul 06 '16 23:07 leandromatos

did not work for me as well. I'm on a MBP.

jleger98 avatar Jul 06 '16 23:07 jleger98

I disabled all plugins and does not work!

Is there a way to force a reindex of the Sublime files?

leandromatos avatar Jul 07 '16 00:07 leandromatos

This seemed to be an issue with Sublime Text core. Now working in Sublime Text Dev Build 3118 - https://www.sublimetext.com/3dev

I don't think so if there weren't sublime text update. With build 3118 was NOT working, and a few days later it was working.

And as some users indicate, it's not working for them.

elboletaire avatar Jul 07 '16 09:07 elboletaire

@leandromatos The only way I know to force a reindex

  1. Close ST
  2. Delete existing index ($HOME/.config/sublime-text-3/Index)
  3. Open a directory or a project
  4. The search console must say recreating index at some point
  5. The status bar show the indexation process (a growing percentage)

Please make sure you don't have any settings that prevent the indexation like index_files or index_exclude_patterns.

erichard avatar Jul 26 '16 16:07 erichard

@erichard A sublime-text-3 folder not exists in ~/.config =(

leandromatos avatar Jul 26 '16 18:07 leandromatos

@erichard The index directory path is ~/Library/Application Support/Sublime Text 3/Index.

But, I removed the directory and the error continued: Unable to find ClassName.

leandromatos avatar Jul 26 '16 18:07 leandromatos

Followed the steps, got a recreated index message, but still no go when i hit my keybinding for "find_use"

{ "keys": ["f10"], "command": "find_use" },

Using Dev version 3119 of SL3

I am not however getting the error leandromatos is getting.

In the console I am seeing: Unable to open /Users/joel/Library/Application Support/Sublime Text 3/Packages/Default/Default (OSX).sublime-keymap

looking in that directory, there is no Default folder. Seems like that might be an issue? Not sure how to re-create.

jleger98 avatar Jul 26 '16 19:07 jleger98

ok, actually found that default (OSX).sublime-keymap in the User folder, created a default folder and copied it over. now I no longer get that error, but still "find_use" does not work.

jleger98 avatar Jul 26 '16 20:07 jleger98

I had the same issue even after installing 3119. I removed the PHPCompanion package and reinstalled and the problem went away.

Gimcrack avatar Jul 26 '16 23:07 Gimcrack

@Gimcrack I tried this, but doesn't work!

leandromatos avatar Jul 27 '16 00:07 leandromatos

This problem appears today, I have no idea why.

Tried to add a {} in the User settings of the package (which was even not created in my case), and everything is now working again as expected.

I remembered that I've already have seen this workaround for another package, but I am not able to remember which one or where did I find the solution.

Hope this could help someone :)

bgatellier avatar Jul 28 '16 09:07 bgatellier

@bgatellier 's way not working for me either, tried everything mentioned in this thread, still not working, any updates?

lessmind avatar Aug 05 '16 07:08 lessmind

I tried a few of the fixes above with no avail. The console doesn't show any activity. What I did learn is that I select the method (instead of the class) it "works." Rather it fires, but doesn't import properly.

In the Example below if I select the method getStates, and then fire expand_fqcn it adds the path to the method.

Before: $states = Geo::getStates();

After: $states = Geo::App\Helpers\getStates();

Also if I fire find_use it will import use App\Helpers\getStates instead of App\Helpers\Geo

bobby-drk avatar Aug 15 '16 13:08 bobby-drk

I have tried everything in this thread to no avail, I'm running Sublime Text 3 Build 3114.

benjivm avatar Sep 15 '16 19:09 benjivm

What did it for me was removing vendor from "folder_exclude_patterns":["vendor",]

nickclasener avatar Sep 25 '16 22:09 nickclasener