Sublime Forum

Go to definition in a (git) worktree goes to main worktree

#1

My project primarily uses Javascript.
I use git to manage code, create branches etc. The git worktree feature allows me to have more than one worktree (each corresponding to a distinct branch), and with their own directory tree in the file system.

When coding in a worktree (so, not the main worktree) and I want to go to the definition of a JS class, ST takes me to the class definition in the main worktree.

Is it a bug ?

cheers
-jg-

0 Likes

#2

I don’t believe ST knows where the exact definition is at. It just like bring/list you to definitions of classes with the same name. But theoretically yes, ST can take (long?) time to compare the branch of those two.

0 Likes