2018-02-17 01:48:03 +01:00
|
|
|
/// <reference path="fourslash.ts" />
|
|
|
|
|
|
|
|
// @jsx: preserve
|
|
|
|
|
|
|
|
// @Filename: /a.tsx
|
|
|
|
////enum E {}
|
|
|
|
////enum F {}
|
2018-08-07 01:46:30 +02:00
|
|
|
////interface I { e: E }
|
2018-02-17 01:48:03 +01:00
|
|
|
////function f(e: E, f: F) {}
|
|
|
|
////f(/*arg0*/, /*arg1*/);
|
|
|
|
////
|
2018-08-07 01:46:30 +02:00
|
|
|
////const i: I = { e: /*prop*/ };
|
|
|
|
////
|
2018-02-17 01:48:03 +01:00
|
|
|
////function tag(arr: TemplateStringsArray, x: E) {}
|
|
|
|
////tag`${/*tag*/}`;
|
|
|
|
////
|
|
|
|
////declare function MainButton(props: { e: E }): any;
|
|
|
|
////<MainButton e={/*jsx*/} />
|
|
|
|
////<MainButton e=/*jsx2*/ />
|
|
|
|
|
|
|
|
recommended("arg0");
|
2018-04-04 17:36:48 +02:00
|
|
|
recommended("arg1", { enumName: "F" });
|
2018-10-29 18:03:25 +01:00
|
|
|
recommended("prop", { isNewIdentifierLocation: false });
|
2018-02-17 01:48:03 +01:00
|
|
|
recommended("tag");
|
2018-10-29 18:03:25 +01:00
|
|
|
recommended("jsx", { isNewIdentifierLocation: false });
|
|
|
|
recommended("jsx2", { isNewIdentifierLocation: false, insertText: "{E}" });
|
2018-02-17 01:48:03 +01:00
|
|
|
|
2018-10-29 18:03:25 +01:00
|
|
|
function recommended(marker: string, { insertText, isNewIdentifierLocation = true, enumName = "E" }: { insertText?: string, isNewIdentifierLocation?: boolean, enumName?: string } = {}) {
|
|
|
|
verify.completions({
|
|
|
|
marker,
|
|
|
|
includes: {
|
|
|
|
name: enumName,
|
|
|
|
text: `enum ${enumName}`,
|
|
|
|
kind: "enum",
|
|
|
|
isRecommended: true,
|
|
|
|
insertText,
|
|
|
|
},
|
|
|
|
isNewIdentifierLocation,
|
|
|
|
preferences: {
|
|
|
|
includeInsertTextCompletions: true,
|
|
|
|
},
|
2018-04-04 17:36:48 +02:00
|
|
|
});
|
2018-02-17 01:48:03 +01:00
|
|
|
}
|