@@ -855,8 +855,8 @@ namespace FourSlash {
855
855
} ) ;
856
856
}
857
857
858
- public verifyCompletionListContains ( entryId : ts . Completions . CompletionEntryIdentifier , text ?: string , documentation ?: string , kind ?: string , spanIndex ?: number , hasAction ?: boolean ) {
859
- const completions = this . getCompletionListAtCaret ( ) ;
858
+ public verifyCompletionListContains ( entryId : ts . Completions . CompletionEntryIdentifier , text ?: string , documentation ?: string , kind ?: string , spanIndex ?: number , hasAction ?: boolean , options ?: ts . GetCompletionsAtPositionOptions ) {
859
+ const completions = this . getCompletionListAtCaret ( options ) ;
860
860
if ( completions ) {
861
861
this . assertItemInCompletionList ( completions . entries , entryId , text , documentation , kind , spanIndex , hasAction ) ;
862
862
}
@@ -876,13 +876,13 @@ namespace FourSlash {
876
876
* @param expectedKind the kind of symbol (see ScriptElementKind)
877
877
* @param spanIndex the index of the range that the completion item's replacement text span should match
878
878
*/
879
- public verifyCompletionListDoesNotContain ( entryId : ts . Completions . CompletionEntryIdentifier , expectedText ?: string , expectedDocumentation ?: string , expectedKind ?: string , spanIndex ?: number ) {
879
+ public verifyCompletionListDoesNotContain ( entryId : ts . Completions . CompletionEntryIdentifier , expectedText ?: string , expectedDocumentation ?: string , expectedKind ?: string , spanIndex ?: number , options ?: ts . GetCompletionsAtPositionOptions ) {
880
880
let replacementSpan : ts . TextSpan ;
881
881
if ( spanIndex !== undefined ) {
882
882
replacementSpan = this . getTextSpanForRangeAtIndex ( spanIndex ) ;
883
883
}
884
884
885
- const completions = this . getCompletionListAtCaret ( ) ;
885
+ const completions = this . getCompletionListAtCaret ( options ) ;
886
886
if ( completions ) {
887
887
let filterCompletions = completions . entries . filter ( e => e . name === entryId . name && e . source === entryId . source ) ;
888
888
filterCompletions = expectedKind ? filterCompletions . filter ( e => e . kind === expectedKind ) : filterCompletions ;
@@ -1195,11 +1195,11 @@ Actual: ${stringify(fullActual)}`);
1195
1195
this . raiseError ( `verifyReferencesAtPositionListContains failed - could not find the item: ${ stringify ( missingItem ) } in the returned list: (${ stringify ( references ) } )` ) ;
1196
1196
}
1197
1197
1198
- private getCompletionListAtCaret ( ) {
1199
- return this . languageService . getCompletionsAtPosition ( this . activeFile . fileName , this . currentCaretPosition ) ;
1198
+ private getCompletionListAtCaret ( options ?: ts . GetCompletionsAtPositionOptions ) : ts . CompletionInfo {
1199
+ return this . languageService . getCompletionsAtPosition ( this . activeFile . fileName , this . currentCaretPosition , options ) ;
1200
1200
}
1201
1201
1202
- private getCompletionEntryDetails ( entryName : string , source ?: string ) {
1202
+ private getCompletionEntryDetails ( entryName : string , source ?: string ) : ts . CompletionEntryDetails {
1203
1203
return this . languageService . getCompletionEntryDetails ( this . activeFile . fileName , this . currentCaretPosition , entryName , this . formatCodeSettings , source ) ;
1204
1204
}
1205
1205
@@ -1790,7 +1790,7 @@ Actual: ${stringify(fullActual)}`);
1790
1790
}
1791
1791
else if ( prevChar === " " && / A - Z a - z _ / . test ( ch ) ) {
1792
1792
/* Completions */
1793
- this . languageService . getCompletionsAtPosition ( this . activeFile . fileName , offset ) ;
1793
+ this . languageService . getCompletionsAtPosition ( this . activeFile . fileName , offset , { includeExternalModuleExports : false } ) ;
1794
1794
}
1795
1795
1796
1796
if ( i % checkCadence === 0 ) {
@@ -2365,7 +2365,7 @@ Actual: ${stringify(fullActual)}`);
2365
2365
public applyCodeActionFromCompletion ( markerName : string , options : FourSlashInterface . VerifyCompletionActionOptions ) {
2366
2366
this . goToMarker ( markerName ) ;
2367
2367
2368
- const actualCompletion = this . getCompletionListAtCaret ( ) . entries . find ( e => e . name === options . name && e . source === options . source ) ;
2368
+ const actualCompletion = this . getCompletionListAtCaret ( { includeExternalModuleExports : true } ) . entries . find ( e => e . name === options . name && e . source === options . source ) ;
2369
2369
2370
2370
if ( ! actualCompletion . hasAction ) {
2371
2371
this . raiseError ( `Completion for ${ options . name } does not have an associated action.` ) ;
@@ -3803,15 +3803,15 @@ namespace FourSlashInterface {
3803
3803
3804
3804
// Verifies the completion list contains the specified symbol. The
3805
3805
// completion list is brought up if necessary
3806
- public completionListContains ( entryId : string | ts . Completions . CompletionEntryIdentifier , text ?: string , documentation ?: string , kind ?: string , spanIndex ?: number , hasAction ?: boolean ) {
3806
+ public completionListContains ( entryId : string | ts . Completions . CompletionEntryIdentifier , text ?: string , documentation ?: string , kind ?: string , spanIndex ?: number , hasAction ?: boolean , options ?: ts . GetCompletionsAtPositionOptions ) {
3807
3807
if ( typeof entryId === "string" ) {
3808
3808
entryId = { name : entryId , source : undefined } ;
3809
3809
}
3810
3810
if ( this . negative ) {
3811
- this . state . verifyCompletionListDoesNotContain ( entryId , text , documentation , kind , spanIndex ) ;
3811
+ this . state . verifyCompletionListDoesNotContain ( entryId , text , documentation , kind , spanIndex , options ) ;
3812
3812
}
3813
3813
else {
3814
- this . state . verifyCompletionListContains ( entryId , text , documentation , kind , spanIndex , hasAction ) ;
3814
+ this . state . verifyCompletionListContains ( entryId , text , documentation , kind , spanIndex , hasAction , options ) ;
3815
3815
}
3816
3816
}
3817
3817
0 commit comments