@@ -3214,8 +3214,8 @@ namespace FourSlash {
32143214 } ;
32153215 }
32163216
3217- public verifyRefactorAvailable ( negative : boolean , name : string , actionName ?: string ) {
3218- let refactors = this . getApplicableRefactorsAtSelection ( ) ;
3217+ public verifyRefactorAvailable ( negative : boolean , triggerReason : ts . RefactorTriggerReason , name : string , actionName ?: string ) {
3218+ let refactors = this . getApplicableRefactorsAtSelection ( triggerReason ) ;
32193219 refactors = refactors . filter ( r => r . name === name && ( actionName === undefined || r . actions . some ( a => a . name === actionName ) ) ) ;
32203220 const isAvailable = refactors . length > 0 ;
32213221
@@ -3644,14 +3644,14 @@ namespace FourSlash {
36443644 test ( renameKeys ( newFileContents , key => pathUpdater ( key ) || key ) , "with file moved" ) ;
36453645 }
36463646
3647- private getApplicableRefactorsAtSelection ( ) {
3648- return this . getApplicableRefactorsWorker ( this . getSelection ( ) , this . activeFile . fileName ) ;
3647+ private getApplicableRefactorsAtSelection ( triggerReason : ts . RefactorTriggerReason = "implicit" ) {
3648+ return this . getApplicableRefactorsWorker ( this . getSelection ( ) , this . activeFile . fileName , ts . emptyOptions , triggerReason ) ;
36493649 }
3650- private getApplicableRefactors ( rangeOrMarker : Range | Marker , preferences = ts . emptyOptions ) : readonly ts . ApplicableRefactorInfo [ ] {
3651- return this . getApplicableRefactorsWorker ( "position" in rangeOrMarker ? rangeOrMarker . position : rangeOrMarker , rangeOrMarker . fileName , preferences ) ; // eslint-disable-line no-in-operator
3650+ private getApplicableRefactors ( rangeOrMarker : Range | Marker , preferences = ts . emptyOptions , triggerReason : ts . RefactorTriggerReason = "implicit" ) : readonly ts . ApplicableRefactorInfo [ ] {
3651+ return this . getApplicableRefactorsWorker ( "position" in rangeOrMarker ? rangeOrMarker . position : rangeOrMarker , rangeOrMarker . fileName , preferences , triggerReason ) ; // eslint-disable-line no-in-operator
36523652 }
3653- private getApplicableRefactorsWorker ( positionOrRange : number | ts . TextRange , fileName : string , preferences = ts . emptyOptions ) : readonly ts . ApplicableRefactorInfo [ ] {
3654- return this . languageService . getApplicableRefactors ( fileName , positionOrRange , preferences ) || ts . emptyArray ;
3653+ private getApplicableRefactorsWorker ( positionOrRange : number | ts . TextRange , fileName : string , preferences = ts . emptyOptions , triggerReason : ts . RefactorTriggerReason ) : readonly ts . ApplicableRefactorInfo [ ] {
3654+ return this . languageService . getApplicableRefactors ( fileName , positionOrRange , preferences , triggerReason ) || ts . emptyArray ;
36553655 }
36563656
36573657 public configurePlugin ( pluginName : string , configuration : any ) : void {
0 commit comments