@@ -872,7 +872,7 @@ namespace FourSlash {
872
872
} ) ;
873
873
}
874
874
875
- public verifyCompletionListContains ( entryId : ts . Completions . CompletionEntryIdentifier , text ?: string , documentation ?: string , kind ?: string , spanIndex ?: number , hasAction ?: boolean , options ?: FourSlashInterface . VerifyCompletionListContainsOptions ) {
875
+ public verifyCompletionListContains ( entryId : ts . Completions . CompletionEntryIdentifier , text ?: string , documentation ?: string , kind ?: string | { kind ?: string , kindModifiers ?: string } , spanIndex ?: number , hasAction ?: boolean , options ?: FourSlashInterface . VerifyCompletionListContainsOptions ) {
876
876
const completions = this . getCompletionListAtCaret ( options ) ;
877
877
if ( completions ) {
878
878
this . assertItemInCompletionList ( completions . entries , entryId , text , documentation , kind , spanIndex , hasAction , options ) ;
@@ -893,7 +893,7 @@ namespace FourSlash {
893
893
* @param expectedKind the kind of symbol (see ScriptElementKind)
894
894
* @param spanIndex the index of the range that the completion item's replacement text span should match
895
895
*/
896
- public verifyCompletionListDoesNotContain ( entryId : ts . Completions . CompletionEntryIdentifier , expectedText ?: string , expectedDocumentation ?: string , expectedKind ?: string , spanIndex ?: number , options ?: FourSlashInterface . CompletionsAtOptions ) {
896
+ public verifyCompletionListDoesNotContain ( entryId : ts . Completions . CompletionEntryIdentifier , expectedText ?: string , expectedDocumentation ?: string , expectedKind ?: string | { kind ?: string , kindModifiers ?: string } , spanIndex ?: number , options ?: FourSlashInterface . CompletionsAtOptions ) {
897
897
let replacementSpan : ts . TextSpan ;
898
898
if ( spanIndex !== undefined ) {
899
899
replacementSpan = this . getTextSpanForRangeAtIndex ( spanIndex ) ;
@@ -902,7 +902,7 @@ namespace FourSlash {
902
902
const completions = this . getCompletionListAtCaret ( options ) ;
903
903
if ( completions ) {
904
904
let filterCompletions = completions . entries . filter ( e => e . name === entryId . name && e . source === entryId . source ) ;
905
- filterCompletions = expectedKind ? filterCompletions . filter ( e => e . kind === expectedKind ) : filterCompletions ;
905
+ filterCompletions = expectedKind ? filterCompletions . filter ( e => e . kind === expectedKind || ( typeof expectedKind === "object" && e . kind === expectedKind . kind ) ) : filterCompletions ;
906
906
filterCompletions = filterCompletions . filter ( entry => {
907
907
const details = this . getCompletionEntryDetails ( entry . name ) ;
908
908
const documentation = details && ts . displayPartsToString ( details . documentation ) ;
@@ -3089,7 +3089,7 @@ Actual: ${stringify(fullActual)}`);
3089
3089
entryId : ts . Completions . CompletionEntryIdentifier ,
3090
3090
text : string | undefined ,
3091
3091
documentation : string | undefined ,
3092
- kind : string | undefined ,
3092
+ kind : string | undefined | { kind ?: string , kindModifiers ?: string } ,
3093
3093
spanIndex : number | undefined ,
3094
3094
hasAction : boolean | undefined ,
3095
3095
options : FourSlashInterface . VerifyCompletionListContainsOptions | undefined ,
@@ -3123,9 +3123,21 @@ Actual: ${stringify(fullActual)}`);
3123
3123
}
3124
3124
3125
3125
if ( kind !== undefined ) {
3126
- assert . equal ( item . kind , kind , this . assertionMessageAtLastKnownMarker ( "completion item kind for " + entryId ) ) ;
3126
+ if ( typeof kind === "string" ) {
3127
+ assert . equal ( item . kind , kind , this . assertionMessageAtLastKnownMarker ( "completion item kind for " + entryId ) ) ;
3128
+ }
3129
+ else {
3130
+ if ( kind . kind ) {
3131
+ assert . equal ( item . kind , kind . kind , this . assertionMessageAtLastKnownMarker ( "completion item kind for " + entryId ) ) ;
3132
+ }
3133
+ if ( kind . kindModifiers !== undefined ) {
3134
+ assert . equal ( item . kindModifiers , kind . kindModifiers , this . assertionMessageAtLastKnownMarker ( "completion item kindModifiers for " + entryId ) ) ;
3135
+ }
3136
+ }
3127
3137
}
3128
3138
3139
+
3140
+
3129
3141
if ( spanIndex !== undefined ) {
3130
3142
const span = this . getTextSpanForRangeAtIndex ( spanIndex ) ;
3131
3143
assert . isTrue ( TestState . textSpansEqual ( span , item . replacementSpan ) , this . assertionMessageAtLastKnownMarker ( stringify ( span ) + " does not equal " + stringify ( item . replacementSpan ) + " replacement span for " + entryId ) ) ;
@@ -3842,7 +3854,7 @@ namespace FourSlashInterface {
3842
3854
3843
3855
// Verifies the completion list contains the specified symbol. The
3844
3856
// completion list is brought up if necessary
3845
- public completionListContains ( entryId : string | ts . Completions . CompletionEntryIdentifier , text ?: string , documentation ?: string , kind ?: string , spanIndex ?: number , hasAction ?: boolean , options ?: VerifyCompletionListContainsOptions ) {
3857
+ public completionListContains ( entryId : string | ts . Completions . CompletionEntryIdentifier , text ?: string , documentation ?: string , kind ?: string | { kind ?: string , kindModifiers ?: string } , spanIndex ?: number , hasAction ?: boolean , options ?: VerifyCompletionListContainsOptions ) {
3846
3858
if ( typeof entryId === "string" ) {
3847
3859
entryId = { name : entryId , source : undefined } ;
3848
3860
}
0 commit comments