Sublime Forum

Modify Goto Definition behavior

#1

Can Goto Definition be modified to where it actually goes to the definition specified instead of pulling up a menu with different options matching said definition name?

So if I have this in my code:

import { MockChecklistService } from '../../../../../shared/services/mocks/checklist.mock.service';

… and I invoke Goto Definition on MockChecklistService , I would just like to go to where that file is imported instead of choosing files that contain the keyword MockChecklistService

I’m using Sublime Text 3 build 3207

0 Likes

#2

The behavior of Goto definition is mostly language agnostic, so if you want something different you need to implement in a plugin. Check for available package, maybe someone already did it.

0 Likes

#3

Since this looks like JavaScript, you’ll be able to get this behavior using the LSP package and a language server for JavaScript (refer to LSP’s readme because it references two implementations).

1 Like

#4

Thanks. LSP was what I needed. Took a second to get things setup but it’s working out great.

Thanks again.

0 Likes