2017-12-01 22:00:01 +01:00
|
|
|
/// <reference path="fourslash.ts" />
|
|
|
|
|
2018-01-03 22:51:33 +01:00
|
|
|
////enum Enu {}
|
|
|
|
////class Cls {}
|
|
|
|
////abstract class Abs {}
|
|
|
|
////const e: Enu = E/*e0*/;
|
|
|
|
////const e: Enu = /*e1*/;
|
|
|
|
////const c: Cls = new C/*c0*/;
|
|
|
|
////const c: Cls = new /*c1*/;
|
|
|
|
////const a: Abs = new A/*a0*/;
|
|
|
|
////const a: Abs = new /*a1*/;
|
2017-12-01 22:00:01 +01:00
|
|
|
|
2018-01-03 22:51:33 +01:00
|
|
|
// Also works on mutations
|
|
|
|
////let enu: Enu;
|
|
|
|
////enu = E/*let0*/;
|
|
|
|
////enu = E/*let1*/;
|
2017-12-01 22:00:01 +01:00
|
|
|
|
2018-10-29 18:03:25 +01:00
|
|
|
const cls = (ctr: boolean): FourSlashInterface.ExpectedCompletionEntry => ({
|
|
|
|
name: "Cls",
|
|
|
|
text: ctr ? "constructor Cls(): Cls" : "class Cls",
|
|
|
|
kind: "class",
|
|
|
|
isRecommended: true,
|
2018-01-03 22:51:33 +01:00
|
|
|
});
|
2017-12-01 22:00:01 +01:00
|
|
|
|
2018-10-29 18:03:25 +01:00
|
|
|
// Not recommended, because it's an abstract class
|
|
|
|
const abs = (ctr: boolean): FourSlashInterface.ExpectedCompletionEntry => ({
|
|
|
|
name: "Abs",
|
|
|
|
text: ctr ? "constructor Abs(): Abs" : "class Abs",
|
|
|
|
kind: "class",
|
2018-10-30 19:56:34 +01:00
|
|
|
kindModifiers: "abstract",
|
2018-01-03 22:51:33 +01:00
|
|
|
});
|
|
|
|
|
2018-10-29 18:03:25 +01:00
|
|
|
verify.completions(
|
|
|
|
{
|
|
|
|
marker: ["e0", "e1", "let0", "let1"],
|
|
|
|
includes: { name: "Enu", text: "enum Enu", kind: "enum", isRecommended: true },
|
|
|
|
isNewIdentifierLocation: true,
|
|
|
|
},
|
|
|
|
{ marker: "c0", includes: cls(true) },
|
|
|
|
{ marker: "c1", includes: cls(false) },
|
|
|
|
{ marker: "a0", includes: abs(true) },
|
|
|
|
{ marker: "a1", includes: abs(false) },
|
|
|
|
);
|