Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sublime plugin - Find and go to function definition [closed]

Tags:

I am trying to find a plugin on Sublime Text 3. Using this plugin I can click a function and go to the definition of this function within my project.

Does this plugin exist? Can you please provide a link? Hope it works on Javascript file, which I am learning right now.

I found this one here, but it does not work. https://github.com/timdouglas/sublime-find-function-definition

I cannot find this plugin in Package Install.

like image 757
Nicolas S.Xu Avatar asked Apr 17 '14 06:04

Nicolas S.Xu


People also ask

How to go to function definition in Sublime?

You can go directly to a function declaration in a file by using Goto > GoTo Symbol or using the keyboard shortcut; cmd + r (Mac) or ctrl + r (Windows). Now simply start typing the name of the function you want to jump to.

How to find function in Sublime Text?

sublime-find-function-definitionHighlight a function and either hit F8 or right click and go to Find Function Definition . Plugin will search your project for the function and open a file up to it, or if multiple instances found display a list of files to open.


2 Answers

This feature already exists in Sublime Text.

After you select a function you must use F12 and a list with available definitions will appear.

You could check out this answer too: Sublime 3 - Set Key map for function Goto Definition

Edit:

In Sublime Text 3, with Build 3124, the available function definitions are also shown when hovering the function name.

like image 162
Catalin MUNTEANU Avatar answered Sep 19 '22 10:09

Catalin MUNTEANU


To jump into declaration with the help of mouse. Do following:

Linux - create Default (Linux).sublime-mousemap in ~/.config/sublime-text-3/Packages/User

Mac - create Default (OSX).sublime-mousemap in ~/Library/ApplicationSupport/Sublime Text 3/Packages/User

Win - create Default (Windows).sublime-mousemap in %appdata%\Sublime Text 3\Packages\User

Copy following lines to the file.

[
    {
        "button": "button1", 
        "count": 1, 
        "modifiers": ["ctrl"],
        "press_command": "drag_select",
        "command": "goto_definition"
    }
]
like image 24
Sujin Shrestha Avatar answered Sep 22 '22 10:09

Sujin Shrestha