TypeScript/tests/cases/fourslash/completionsOptionalKindModifier.ts
Matt Bierner 12d5063e4c Add kindModifier to mark if a completion item is for an optional field (#20839)
* Add kindModifier to mark if a completion item is for an optional field

For #12458

Adds a new KindModifier for completion items to mark when a property is optional. This can be used by editors to either change the item icon or add a `?` to the item text

* Add method test

* Baseline-accept
2018-01-04 16:36:31 -08:00

10 lines
407 B
TypeScript

/// <reference path="fourslash.ts" />
////interface A { a?: number; method?(): number; };
////function f(x: A) {
////x./*a*/;
////}
goTo.marker("a");
verify.completionListContains("a", /* text */ undefined, /* documentation */ undefined, { kindModifiers: "optional" });
verify.completionListContains("method", /* text */ undefined, /* documentation */ undefined, { kindModifiers: "optional" });