Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sublime text 3, indexing, and goto symbol/goto definition

so I downloaded sublime text 3 which allegedly "Sublime Text now scans the files in your project, and builds an index of which files contain which symbols. This backs the new features Goto Definition and Goto Symbol in Project".

I created a new project containing the source code of zend framework...I then attempt to do goto definition and goto symbol but they are all still only allow you to "Goto" definitions/symbols in the current file instead of the entire project.

How exactly should I configure sublime text 3 such that I can use the goto definition/symbol to any method in the project and not just the current file (akin to Eclipse's Ctrl + Shift + M Open method feature).

like image 649
kamikaze_pilot Avatar asked Apr 06 '13 03:04

kamikaze_pilot


People also ask

What is indexing in sublime?

Sublime Text includes an indexing engine that scans all of the files and folders in a window/project and uses that information to provide the ability to jump to definitions and provide context-aware completions 4050. Features. Goto Definition.

How to stop indexing in Sublime Text?

To see when files are being indexed, you can enter sublime. log_indexing(True) in Sublime Text's console. This will trigger Sublime Text to start logging relevant information whenever it indexes files. To disable file indexing altogether, you can set the index_files setting to false.


2 Answers

First off, make sure the relevant folders are added to your project by checking that they appear in the side bar under FOLDERS (which you can toggle using -K -B). If the Zend folder isn't there, add it by going to Project » Add Folder to Project....

Then you should use Goto » Goto Symbol in Project... (or --R). Goto Definition should search in the whole project. At least this is what it behaves like for me on Sublime 3 build 3019 for OS X.

Replace with CTRL and with SHIFT if on Windows.

like image 82
Dan Avatar answered Oct 04 '22 22:10

Dan


Assuming this is not a shortcut issue (You can test this by trying to find symbol from the menu)

Try:

  1. Quit Sublime Text 3.
  2. Clear out the Sublime Text 3 Index folder
    • In OS X, delete the contents of ~/Library/Application Support/Sublime Text 3/Index
    • In Windows, delete the contents of AppData\Local\Sublime Text 3\Index\
  3. Open ST3 and your project
    • Open Console (View -> Show Console)
    • Check for errors

Most likely after step 3, your project will be back to normal, but if it isn't check what the problem is while indexing and try to search for that specific problem.

EDIT: Depending on the size of your project rebuilding cache might take looong

like image 27
Ajk_P Avatar answered Oct 04 '22 22:10

Ajk_P