While working in VS Code with the file controller-a.ts
open, I need to access the interface's file (interface-controller.ts
) where the execute
method is defined. Both controller-a.ts
, controller-b.ts
, and interface-controller.ts
contain numerous lines of code.
Is there a quick way, either through keyboard shortcuts or mouse navigation, to jump from the execute()
method in controller-a.ts
directly to the interface that this class implements without manual searching and scrolling? I am also interested in any useful VS Code extensions for this purpose.
Methods I've Attempted:
- Using cmd + click on the
execute
method (macOS) - Trying out
Go To Definition
- Exploring options like
Go To Implementations
andGo To References
Outcome: The result is a "peek" window displaying 3 references including controller-a.ts
, controller-b.ts
, and interface-controller.ts
. However, the current file controller-a.ts
remains selected in the "peek" window, despite already being in that file.
Other Approaches Tried:
- Experimenting with
Go To Type Definition
Outcome: Redirects to lib.es2018.promise.d.ts
Another Approach Tested:
- Testing
Go To Source Definition
Outcome: Still stays within controller-a.ts
Content in ./interface-controller.ts
export interface IController {
execute(): Promise<void>
}
Contents in ./controller-a.ts
import { IController } from "./interface-controller";
class ControllerA implements IController {
public async execute() {
// operations
}
}
Contents in ./controller-b.ts
import { IController } from "./interface-controller";
class ControllerB implements IController {
public async execute() {
// operations
}
}