Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Access a Class through "Ctrl+Click" in Sublime Text 3

I've got this class as an example:

Which plugin do I use to be able to click on:

PHPUnit_Framework_TestCase

And get to the class?

class PracticeTest extends PHPUnit_Framework_TestCase {
    public function testHelloWorld() {
        $greeting = 'Hello, World.';
        $this->assertTrue($greeting === 'Hello, World.');
    }
}

Right now I have to manually search for it. I know PHPStorm has this functionality and I believe Sublime must have a plugin for it.

Thanks a lot.

like image 547
LoveAndHappiness Avatar asked Mar 15 '23 11:03

LoveAndHappiness


2 Answers

Click on class name that you want to jump and press f12.

like image 155
Rabin Bhandari Avatar answered Apr 06 '23 20:04

Rabin Bhandari


Avalance pointed in the comments to a threat that hinted to SublimeCodeIntel.

And indeed SublimeCodeIntel allows for the behaviour I needed:

See here: https://github.com/SublimeCodeIntel/SublimeCodeIntel#using

The solution to jump to definition is this:

For Mac OS X:

Jump to definition = Control+Click
Jump to definition = Control+Command+Alt+Up
Go back = Control+Command+Alt+Left
Manual Code Intelligence = Control+Shift+space

For Linux:

Jump to definition = Super+Click
Jump to definition = Control+Super+Alt+Up
Go back = Control+Super+Alt+Left
Manual Code Intelligence = Control+Shift+space

For Windows:

Jump to definition = Alt+Click
Jump to definition = Control+Windows+Alt+Up
Go back = Control+Windows+Alt+Left
Manual Code Intelligence = Control+Shift+space
like image 21
LoveAndHappiness Avatar answered Apr 06 '23 22:04

LoveAndHappiness