1- import { FlashStyle } from "@cursorless/common" ;
1+ import { FlashStyle , OpenLinkOptions } from "@cursorless/common" ;
22import { ide } from "../singletons/ide.singleton" ;
33import { Target } from "../typings/target.types" ;
44import {
55 createThatMark ,
66 ensureSingleTarget ,
77 flashTargets ,
88} from "../util/targetUtils" ;
9- import { Actions } from "./Actions" ;
10- import { SimpleAction , ActionReturnValue } from "./actions.types" ;
9+ import { ActionReturnValue , SimpleAction } from "./actions.types" ;
1110
1211export default class FollowLink implements SimpleAction {
13- constructor ( private actions : Actions ) {
12+ constructor ( private options : OpenLinkOptions ) {
1413 this . run = this . run . bind ( this ) ;
1514 }
1615
@@ -19,17 +18,9 @@ export default class FollowLink implements SimpleAction {
1918
2019 await flashTargets ( ide ( ) , targets , FlashStyle . referenced ) ;
2120
22- const openedLink = await ide ( )
21+ await ide ( )
2322 . getEditableTextEditor ( target . editor )
24- . openLink ( target . contentRange ) ;
25-
26- if ( ! openedLink ) {
27- await this . actions . executeCommand . run (
28- targets ,
29- "editor.action.revealDefinition" ,
30- { restoreSelection : false } ,
31- ) ;
32- }
23+ . openLink ( target . contentRange , this . options ) ;
3324
3425 return {
3526 thatSelections : createThatMark ( targets ) ,
0 commit comments