@@ -746,15 +746,15 @@ namespace FourSlash {
746746 private verifyCompletionsWorker ( options : FourSlashInterface . VerifyCompletionsOptions ) : void {
747747 const actualCompletions = this . getCompletionListAtCaret ( { ...options . preferences , triggerCharacter : options . triggerCharacter } ) ! ;
748748 if ( ! actualCompletions ) {
749- if ( "exact" in options && options . exact === undefined ) return ;
749+ if ( ts . hasProperty ( options , "exact" ) && options . exact === undefined ) return ;
750750 this . raiseError ( `No completions at position '${ this . currentCaretPosition } '.` ) ;
751751 }
752752
753753 if ( actualCompletions . isNewIdentifierLocation !== ( options . isNewIdentifierLocation || false ) ) {
754754 this . raiseError ( `Expected 'isNewIdentifierLocation' to be ${ options . isNewIdentifierLocation || false } , got ${ actualCompletions . isNewIdentifierLocation } ` ) ;
755755 }
756756
757- if ( "isGlobalCompletion" in options && actualCompletions . isGlobalCompletion !== options . isGlobalCompletion ) {
757+ if ( ts . hasProperty ( options , "isGlobalCompletion" ) && actualCompletions . isGlobalCompletion !== options . isGlobalCompletion ) {
758758 this . raiseError ( `Expected 'isGlobalCompletion to be ${ options . isGlobalCompletion } , got ${ actualCompletions . isGlobalCompletion } ` ) ;
759759 }
760760
@@ -772,8 +772,8 @@ namespace FourSlash {
772772 }
773773 }
774774
775- if ( "exact" in options ) {
776- ts . Debug . assert ( ! ( "includes" in options ) && ! ( "excludes" in options ) ) ;
775+ if ( ts . hasProperty ( options , "exact" ) ) {
776+ ts . Debug . assert ( ! ts . hasProperty ( options , "includes" ) && ! ts . hasProperty ( options , "excludes" ) ) ;
777777 if ( options . exact === undefined ) throw this . raiseError ( "Expected no completions" ) ;
778778 this . verifyCompletionsAreExactly ( actualCompletions . entries , toArray ( options . exact ) , options . marker ) ;
779779 }
@@ -1192,7 +1192,7 @@ Actual: ${stringify(fullActual)}`);
11921192 const sort = ( locations : ReadonlyArray < ts . RenameLocation > | undefined ) =>
11931193 locations && ts . sort ( locations , ( r1 , r2 ) => ts . compareStringsCaseSensitive ( r1 . fileName , r2 . fileName ) || r1 . textSpan . start - r2 . textSpan . start ) ;
11941194 assert . deepEqual ( sort ( references ) , sort ( ranges . map ( ( rangeOrOptions ) : ts . RenameLocation => {
1195- const { range, ...prefixSuffixText } = "range" in rangeOrOptions ? rangeOrOptions : { range : rangeOrOptions } ;
1195+ const { range, ...prefixSuffixText } = "range" in rangeOrOptions ? rangeOrOptions : { range : rangeOrOptions } ; // eslint-disable-line microsoft-typescript/no-in-operator
11961196 const { contextRangeIndex } = ( range . marker && range . marker . data || { } ) as { contextRangeIndex ?: number ; } ;
11971197 return {
11981198 fileName : range . fileName ,
@@ -3129,7 +3129,7 @@ Actual: ${stringify(fullActual)}`);
31293129 return this . getApplicableRefactorsWorker ( this . getSelection ( ) , this . activeFile . fileName ) ;
31303130 }
31313131 private getApplicableRefactors ( rangeOrMarker : Range | Marker , preferences = ts . emptyOptions ) : ReadonlyArray < ts . ApplicableRefactorInfo > {
3132- return this . getApplicableRefactorsWorker ( "position" in rangeOrMarker ? rangeOrMarker . position : rangeOrMarker , rangeOrMarker . fileName , preferences ) ;
3132+ return this . getApplicableRefactorsWorker ( "position" in rangeOrMarker ? rangeOrMarker . position : rangeOrMarker , rangeOrMarker . fileName , preferences ) ; // eslint-disable-line microsoft-typescript/no-in-operator
31333133 }
31343134 private getApplicableRefactorsWorker ( positionOrRange : number | ts . TextRange , fileName : string , preferences = ts . emptyOptions ) : ReadonlyArray < ts . ApplicableRefactorInfo > {
31353135 return this . languageService . getApplicableRefactors ( fileName , positionOrRange , preferences ) || ts . emptyArray ;
0 commit comments