@@ -855,8 +855,8 @@ namespace FourSlash {
855855 } ) ;
856856 }
857857
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 ) ;
860860 if ( completions ) {
861861 this . assertItemInCompletionList ( completions . entries , entryId , text , documentation , kind , spanIndex , hasAction ) ;
862862 }
@@ -876,13 +876,13 @@ namespace FourSlash {
876876 * @param expectedKind the kind of symbol (see ScriptElementKind)
877877 * @param spanIndex the index of the range that the completion item's replacement text span should match
878878 */
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 ) {
880880 let replacementSpan : ts . TextSpan ;
881881 if ( spanIndex !== undefined ) {
882882 replacementSpan = this . getTextSpanForRangeAtIndex ( spanIndex ) ;
883883 }
884884
885- const completions = this . getCompletionListAtCaret ( ) ;
885+ const completions = this . getCompletionListAtCaret ( options ) ;
886886 if ( completions ) {
887887 let filterCompletions = completions . entries . filter ( e => e . name === entryId . name && e . source === entryId . source ) ;
888888 filterCompletions = expectedKind ? filterCompletions . filter ( e => e . kind === expectedKind ) : filterCompletions ;
@@ -1195,11 +1195,11 @@ Actual: ${stringify(fullActual)}`);
11951195 this . raiseError ( `verifyReferencesAtPositionListContains failed - could not find the item: ${ stringify ( missingItem ) } in the returned list: (${ stringify ( references ) } )` ) ;
11961196 }
11971197
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 ) ;
12001200 }
12011201
1202- private getCompletionEntryDetails ( entryName : string , source ?: string ) {
1202+ private getCompletionEntryDetails ( entryName : string , source ?: string ) : ts . CompletionEntryDetails {
12031203 return this . languageService . getCompletionEntryDetails ( this . activeFile . fileName , this . currentCaretPosition , entryName , this . formatCodeSettings , source ) ;
12041204 }
12051205
@@ -1790,7 +1790,7 @@ Actual: ${stringify(fullActual)}`);
17901790 }
17911791 else if ( prevChar === " " && / A - Z a - z _ / . test ( ch ) ) {
17921792 /* Completions */
1793- this . languageService . getCompletionsAtPosition ( this . activeFile . fileName , offset ) ;
1793+ this . languageService . getCompletionsAtPosition ( this . activeFile . fileName , offset , { includeExternalModuleExports : false } ) ;
17941794 }
17951795
17961796 if ( i % checkCadence === 0 ) {
@@ -2365,7 +2365,7 @@ Actual: ${stringify(fullActual)}`);
23652365 public applyCodeActionFromCompletion ( markerName : string , options : FourSlashInterface . VerifyCompletionActionOptions ) {
23662366 this . goToMarker ( markerName ) ;
23672367
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 ) ;
23692369
23702370 if ( ! actualCompletion . hasAction ) {
23712371 this . raiseError ( `Completion for ${ options . name } does not have an associated action.` ) ;
@@ -3803,15 +3803,15 @@ namespace FourSlashInterface {
38033803
38043804 // Verifies the completion list contains the specified symbol. The
38053805 // 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 ) {
38073807 if ( typeof entryId === "string" ) {
38083808 entryId = { name : entryId , source : undefined } ;
38093809 }
38103810 if ( this . negative ) {
3811- this . state . verifyCompletionListDoesNotContain ( entryId , text , documentation , kind , spanIndex ) ;
3811+ this . state . verifyCompletionListDoesNotContain ( entryId , text , documentation , kind , spanIndex , options ) ;
38123812 }
38133813 else {
3814- this . state . verifyCompletionListContains ( entryId , text , documentation , kind , spanIndex , hasAction ) ;
3814+ this . state . verifyCompletionListContains ( entryId , text , documentation , kind , spanIndex , hasAction , options ) ;
38153815 }
38163816 }
38173817
0 commit comments