From c52eb6cef3fc149b5e5729de5b2ed11e72e11cab Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 4 Dec 2016 07:43:10 -0800 Subject: [PATCH 01/21] Indexed access any[K] has type any --- src/compiler/checker.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 912db011904..903c8cfda1c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6033,6 +6033,9 @@ namespace ts { function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode) { if (maybeTypeOfKind(indexType, TypeFlags.TypeVariable | TypeFlags.Index) || isGenericMappedType(objectType)) { + if (objectType.flags & TypeFlags.Any) { + return objectType; + } // If the index type is generic or if the object type is a mapped type with a generic constraint, // we are performing a higher-order index access where we cannot meaningfully access the properties // of the object type. In those cases, we first check that the index type is assignable to 'keyof T' From 95aed3f4ee1cb38ddb87aa7797724fe94739f726 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 4 Dec 2016 07:49:55 -0800 Subject: [PATCH 02/21] Add regression test --- .../conformance/types/keyof/keyofAndIndexedAccess.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts index 3a2bb912c19..08bcfb28204 100644 --- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts @@ -354,4 +354,15 @@ interface Options2 { declare class Component2 { constructor(options: Options2); get(key: K): (Data & Computed)[K]; +} + +// Repro from #12641 + +interface R { + p: number; +} + +function f(p: K) { + let a: any; + a[p].add; // any } \ No newline at end of file From ee172cfa39a6745ac13a300dc176daae462dd0da Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 4 Dec 2016 07:50:10 -0800 Subject: [PATCH 03/21] Accept new baselines --- .../reference/keyofAndIndexedAccess.js | 19 +++++++++++++ .../reference/keyofAndIndexedAccess.symbols | 24 +++++++++++++++++ .../reference/keyofAndIndexedAccess.types | 27 +++++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/tests/baselines/reference/keyofAndIndexedAccess.js b/tests/baselines/reference/keyofAndIndexedAccess.js index 1a0b90f3163..a9a5ee29993 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.js +++ b/tests/baselines/reference/keyofAndIndexedAccess.js @@ -353,6 +353,17 @@ interface Options2 { declare class Component2 { constructor(options: Options2); get(key: K): (Data & Computed)[K]; +} + +// Repro from #12641 + +interface R { + p: number; +} + +function f(p: K) { + let a: any; + a[p].add; // any } //// [keyofAndIndexedAccess.js] @@ -589,6 +600,10 @@ var c1 = new Component1({ } }); c1.get("hello"); +function f(p) { + var a; + a[p].add; // any +} //// [keyofAndIndexedAccess.d.ts] @@ -757,3 +772,7 @@ declare class Component2 { constructor(options: Options2); get(key: K): (Data & Computed)[K]; } +interface R { + p: number; +} +declare function f(p: K): void; diff --git a/tests/baselines/reference/keyofAndIndexedAccess.symbols b/tests/baselines/reference/keyofAndIndexedAccess.symbols index bc9e53cdd7e..3d90b4ca276 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.symbols +++ b/tests/baselines/reference/keyofAndIndexedAccess.symbols @@ -1320,3 +1320,27 @@ declare class Component2 { >Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 351, 30)) >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 353, 8)) } + +// Repro from #12641 + +interface R { +>R : Symbol(R, Decl(keyofAndIndexedAccess.ts, 354, 1)) + + p: number; +>p : Symbol(R.p, Decl(keyofAndIndexedAccess.ts, 358, 13)) +} + +function f(p: K) { +>f : Symbol(f, Decl(keyofAndIndexedAccess.ts, 360, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 362, 11)) +>R : Symbol(R, Decl(keyofAndIndexedAccess.ts, 354, 1)) +>p : Symbol(p, Decl(keyofAndIndexedAccess.ts, 362, 30)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 362, 11)) + + let a: any; +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 363, 7)) + + a[p].add; // any +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 363, 7)) +>p : Symbol(p, Decl(keyofAndIndexedAccess.ts, 362, 30)) +} diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index 7cd4b434af6..3b984643776 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -1560,3 +1560,30 @@ declare class Component2 { >Computed : Computed >K : K } + +// Repro from #12641 + +interface R { +>R : R + + p: number; +>p : number +} + +function f(p: K) { +>f : (p: K) => void +>K : K +>R : R +>p : K +>K : K + + let a: any; +>a : any + + a[p].add; // any +>a[p].add : any +>a[p] : any +>a : any +>p : K +>add : any +} From e3fb305d5a14dfc2f577d8131c3fc9c0898c401a Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 5 Dec 2016 12:24:31 -0800 Subject: [PATCH 04/21] Test that sub-subclass can access protected ctor --- ...ubSubClassCanAccessProtectedConstructor.js | 51 +++++++++++++++++++ ...ClassCanAccessProtectedConstructor.symbols | 40 +++++++++++++++ ...ubClassCanAccessProtectedConstructor.types | 46 +++++++++++++++++ ...ubSubClassCanAccessProtectedConstructor.ts | 15 ++++++ 4 files changed, 152 insertions(+) create mode 100644 tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js create mode 100644 tests/baselines/reference/subSubClassCanAccessProtectedConstructor.symbols create mode 100644 tests/baselines/reference/subSubClassCanAccessProtectedConstructor.types create mode 100644 tests/cases/compiler/subSubClassCanAccessProtectedConstructor.ts diff --git a/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js b/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js new file mode 100644 index 00000000000..15d6fc70da5 --- /dev/null +++ b/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js @@ -0,0 +1,51 @@ +//// [subSubClassCanAccessProtectedConstructor.ts] +class Base { + protected constructor() { } + public instance1 = new Base(); // allowed +} + +class Subclass extends Base { + public instance1_1 = new Base(); // allowed + public instance1_2 = new Subclass(); // allowed +} + +class SubclassOfSubclass extends Subclass { + public instance2_1 = new Base(); // allowed + public instance2_2 = new Subclass(); // allowed + public instance2_3 = new SubclassOfSubclass(); // allowed +} + + +//// [subSubClassCanAccessProtectedConstructor.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Base = (function () { + function Base() { + this.instance1 = new Base(); // allowed + } + return Base; +}()); +var Subclass = (function (_super) { + __extends(Subclass, _super); + function Subclass() { + var _this = _super.apply(this, arguments) || this; + _this.instance1_1 = new Base(); // allowed + _this.instance1_2 = new Subclass(); // allowed + return _this; + } + return Subclass; +}(Base)); +var SubclassOfSubclass = (function (_super) { + __extends(SubclassOfSubclass, _super); + function SubclassOfSubclass() { + var _this = _super.apply(this, arguments) || this; + _this.instance2_1 = new Base(); // allowed + _this.instance2_2 = new Subclass(); // allowed + _this.instance2_3 = new SubclassOfSubclass(); // allowed + return _this; + } + return SubclassOfSubclass; +}(Subclass)); diff --git a/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.symbols b/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.symbols new file mode 100644 index 00000000000..8a09e1d742f --- /dev/null +++ b/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/subSubClassCanAccessProtectedConstructor.ts === +class Base { +>Base : Symbol(Base, Decl(subSubClassCanAccessProtectedConstructor.ts, 0, 0)) + + protected constructor() { } + public instance1 = new Base(); // allowed +>instance1 : Symbol(Base.instance1, Decl(subSubClassCanAccessProtectedConstructor.ts, 1, 31)) +>Base : Symbol(Base, Decl(subSubClassCanAccessProtectedConstructor.ts, 0, 0)) +} + +class Subclass extends Base { +>Subclass : Symbol(Subclass, Decl(subSubClassCanAccessProtectedConstructor.ts, 3, 1)) +>Base : Symbol(Base, Decl(subSubClassCanAccessProtectedConstructor.ts, 0, 0)) + + public instance1_1 = new Base(); // allowed +>instance1_1 : Symbol(Subclass.instance1_1, Decl(subSubClassCanAccessProtectedConstructor.ts, 5, 29)) +>Base : Symbol(Base, Decl(subSubClassCanAccessProtectedConstructor.ts, 0, 0)) + + public instance1_2 = new Subclass(); // allowed +>instance1_2 : Symbol(Subclass.instance1_2, Decl(subSubClassCanAccessProtectedConstructor.ts, 6, 36)) +>Subclass : Symbol(Subclass, Decl(subSubClassCanAccessProtectedConstructor.ts, 3, 1)) +} + +class SubclassOfSubclass extends Subclass { +>SubclassOfSubclass : Symbol(SubclassOfSubclass, Decl(subSubClassCanAccessProtectedConstructor.ts, 8, 1)) +>Subclass : Symbol(Subclass, Decl(subSubClassCanAccessProtectedConstructor.ts, 3, 1)) + + public instance2_1 = new Base(); // allowed +>instance2_1 : Symbol(SubclassOfSubclass.instance2_1, Decl(subSubClassCanAccessProtectedConstructor.ts, 10, 43)) +>Base : Symbol(Base, Decl(subSubClassCanAccessProtectedConstructor.ts, 0, 0)) + + public instance2_2 = new Subclass(); // allowed +>instance2_2 : Symbol(SubclassOfSubclass.instance2_2, Decl(subSubClassCanAccessProtectedConstructor.ts, 11, 36)) +>Subclass : Symbol(Subclass, Decl(subSubClassCanAccessProtectedConstructor.ts, 3, 1)) + + public instance2_3 = new SubclassOfSubclass(); // allowed +>instance2_3 : Symbol(SubclassOfSubclass.instance2_3, Decl(subSubClassCanAccessProtectedConstructor.ts, 12, 40)) +>SubclassOfSubclass : Symbol(SubclassOfSubclass, Decl(subSubClassCanAccessProtectedConstructor.ts, 8, 1)) +} + diff --git a/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.types b/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.types new file mode 100644 index 00000000000..253f6221c78 --- /dev/null +++ b/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.types @@ -0,0 +1,46 @@ +=== tests/cases/compiler/subSubClassCanAccessProtectedConstructor.ts === +class Base { +>Base : Base + + protected constructor() { } + public instance1 = new Base(); // allowed +>instance1 : Base +>new Base() : Base +>Base : typeof Base +} + +class Subclass extends Base { +>Subclass : Subclass +>Base : Base + + public instance1_1 = new Base(); // allowed +>instance1_1 : Base +>new Base() : Base +>Base : typeof Base + + public instance1_2 = new Subclass(); // allowed +>instance1_2 : Subclass +>new Subclass() : Subclass +>Subclass : typeof Subclass +} + +class SubclassOfSubclass extends Subclass { +>SubclassOfSubclass : SubclassOfSubclass +>Subclass : Subclass + + public instance2_1 = new Base(); // allowed +>instance2_1 : Base +>new Base() : Base +>Base : typeof Base + + public instance2_2 = new Subclass(); // allowed +>instance2_2 : Subclass +>new Subclass() : Subclass +>Subclass : typeof Subclass + + public instance2_3 = new SubclassOfSubclass(); // allowed +>instance2_3 : SubclassOfSubclass +>new SubclassOfSubclass() : SubclassOfSubclass +>SubclassOfSubclass : typeof SubclassOfSubclass +} + diff --git a/tests/cases/compiler/subSubClassCanAccessProtectedConstructor.ts b/tests/cases/compiler/subSubClassCanAccessProtectedConstructor.ts new file mode 100644 index 00000000000..fc5e9794500 --- /dev/null +++ b/tests/cases/compiler/subSubClassCanAccessProtectedConstructor.ts @@ -0,0 +1,15 @@ +class Base { + protected constructor() { } + public instance1 = new Base(); // allowed +} + +class Subclass extends Base { + public instance1_1 = new Base(); // allowed + public instance1_2 = new Subclass(); // allowed +} + +class SubclassOfSubclass extends Subclass { + public instance2_1 = new Base(); // allowed + public instance2_2 = new Subclass(); // allowed + public instance2_3 = new SubclassOfSubclass(); // allowed +} From b321d50170ccd84a2bdd68ac301b370b74f9bcfb Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 5 Dec 2016 12:29:03 -0800 Subject: [PATCH 05/21] Sub-subclasses can access protected constructor --- src/compiler/checker.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 903c8cfda1c..96eefb68135 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13467,13 +13467,14 @@ namespace ts { const containingClass = getContainingClass(node); if (containingClass) { const containingType = getTypeOfNode(containingClass); - const baseTypes = getBaseTypes(containingType); - if (baseTypes.length) { + let baseTypes = getBaseTypes(containingType as InterfaceType); + while (baseTypes.length) { const baseType = baseTypes[0]; if (modifiers & ModifierFlags.Protected && baseType.symbol === declaration.parent.symbol) { return true; } + baseTypes = getBaseTypes(baseType as InterfaceType); } } if (modifiers & ModifierFlags.Private) { From 225d6d6aef11484708e319940f148b89edfb6323 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 5 Dec 2016 13:40:56 -0800 Subject: [PATCH 06/21] use XDG base directory compatible cache location (#12676) * use XDG base directory compatible cache location * use ~/Library/Caches on darwin --- src/server/server.ts | 45 +++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/src/server/server.ts b/src/server/server.ts index 7367741b9ea..a020ef210fe 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -20,34 +20,41 @@ namespace ts.server { } = require("os"); function getGlobalTypingsCacheLocation() { - let basePath: string; switch (process.platform) { - case "win32": - basePath = process.env.LOCALAPPDATA || + case "win32": { + const basePath = process.env.LOCALAPPDATA || process.env.APPDATA || (os.homedir && os.homedir()) || process.env.USERPROFILE || (process.env.HOMEDRIVE && process.env.HOMEPATH && normalizeSlashes(process.env.HOMEDRIVE + process.env.HOMEPATH)) || os.tmpdir(); - break; - case "linux": - case "android": - basePath = (os.homedir && os.homedir()) || - process.env.HOME || - ((process.env.LOGNAME || process.env.USER) && `/home/${process.env.LOGNAME || process.env.USER}`) || - os.tmpdir(); - break; + return combinePaths(normalizeSlashes(basePath), "Microsoft/TypeScript"); + } case "darwin": - const homeDir = (os.homedir && os.homedir()) || - process.env.HOME || - ((process.env.LOGNAME || process.env.USER) && `/Users/${process.env.LOGNAME || process.env.USER}`) || - os.tmpdir(); - basePath = combinePaths(homeDir, "Library/Application Support/"); - break; + case "linux": + case "android": { + const cacheLocation = getNonWindowsCacheLocation(process.platform === "darwin"); + return combinePaths(cacheLocation, "typescript"); + } + default: + Debug.fail(`unsupported platform '${process.platform}'`); + return; } + } - Debug.assert(basePath !== undefined); - return combinePaths(normalizeSlashes(basePath), "Microsoft/TypeScript"); + function getNonWindowsCacheLocation(platformIsDarwin: boolean) { + if (process.env.XDG_CACHE_HOME) { + return process.env.XDG_CACHE_HOME; + } + const usersDir = platformIsDarwin ? "Users" : "home" + const homePath = (os.homedir && os.homedir()) || + process.env.HOME || + ((process.env.LOGNAME || process.env.USER) && `/${usersDir}/${process.env.LOGNAME || process.env.USER}`) || + os.tmpdir(); + const cacheFolder = platformIsDarwin + ? "Library/Caches" + : ".cache" + return combinePaths(normalizeSlashes(homePath), cacheFolder); } interface NodeChildProcess { From ee0894339d0bb6888a9bd2741b951627b97bfada Mon Sep 17 00:00:00 2001 From: Aluan Haddad Date: Mon, 5 Dec 2016 18:25:45 -0500 Subject: [PATCH 07/21] Add ReadonlyArray.includes to es2016.array.include.d.ts --- src/lib/es2016.array.include.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/es2016.array.include.d.ts b/src/lib/es2016.array.include.d.ts index 17b3eaac1d3..fdd9ed4639f 100644 --- a/src/lib/es2016.array.include.d.ts +++ b/src/lib/es2016.array.include.d.ts @@ -7,6 +7,15 @@ interface Array { includes(searchElement: T, fromIndex?: number): boolean; } +interface ReadonlyArray { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: T, fromIndex?: number): boolean; +} + interface Int8Array { /** * Determines whether an array includes a certain element, returning true or false as appropriate. From f89156bf55a40a6002c2383926b50f250231146c Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 6 Dec 2016 10:47:02 -0800 Subject: [PATCH 08/21] Add error for super property before super --- src/compiler/checker.ts | 48 +++++++++++-------- src/compiler/transformers/es2015.ts | 1 - .../reference/errorSuperCalls.errors.txt | 5 +- .../reference/superAccess2.errors.txt | 11 ++++- .../superInConstructorParam1.errors.txt | 5 +- .../reference/superNewCall1.errors.txt | 5 +- ...rtyInConstructorBeforeSuperCall.errors.txt | 24 ++++++++++ ...perPropertyInConstructorBeforeSuperCall.js | 46 ++++++++++++++++++ .../superWithTypeArgument.errors.txt | 5 +- .../superWithTypeArgument2.errors.txt | 5 +- .../superWithTypeArgument3.errors.txt | 5 +- ...perPropertyInConstructorBeforeSuperCall.ts | 15 ++++++ 12 files changed, 147 insertions(+), 28 deletions(-) create mode 100644 tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.errors.txt create mode 100644 tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.js create mode 100644 tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 903c8cfda1c..8c08e9b121b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10405,6 +10405,29 @@ namespace ts { return baseConstructorType === nullWideningType; } + function checkThisBeforeSuper(node: Node, container: Node) { + const containingClassDecl = container.parent; + const baseTypeNode = getClassExtendsHeritageClauseElement(containingClassDecl); + + // If a containing class does not have extends clause or the class extends null + // skip checking whether super statement is called before "this" accessing. + if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { + const superCall = getSuperCallInConstructor(container); + + // We should give an error in the following cases: + // - No super-call + // - "this" is accessing before super-call. + // i.e super(this) + // this.x; super(); + // We want to make sure that super-call is done before accessing "this" so that + // "this" is not accessed as a parameter of the super-call. + if (!superCall || superCall.end > node.pos) { + // In ES6, super inside constructor of class-declaration has to precede "this" accessing + error(node, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); + } + } + } + function checkThisExpression(node: Node): Type { // Stop at the first arrow function so that we can // tell whether 'this' needs to be captured. @@ -10412,26 +10435,7 @@ namespace ts { let needToCaptureLexicalThis = false; if (container.kind === SyntaxKind.Constructor) { - const containingClassDecl = container.parent; - const baseTypeNode = getClassExtendsHeritageClauseElement(containingClassDecl); - - // If a containing class does not have extends clause or the class extends null - // skip checking whether super statement is called before "this" accessing. - if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { - const superCall = getSuperCallInConstructor(container); - - // We should give an error in the following cases: - // - No super-call - // - "this" is accessing before super-call. - // i.e super(this) - // this.x; super(); - // We want to make sure that super-call is done before accessing "this" so that - // "this" is not accessed as a parameter of the super-call. - if (!superCall || superCall.end > node.pos) { - // In ES6, super inside constructor of class-declaration has to precede "this" accessing - error(node, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); - } - } + checkThisBeforeSuper(node, container); } // Now skip arrow functions to get the "real" owner of 'this'. @@ -10579,6 +10583,10 @@ namespace ts { return unknownType; } + if (!isCallExpression && container.kind === SyntaxKind.Constructor) { + checkThisBeforeSuper(node, container); + } + if ((getModifierFlags(container) & ModifierFlags.Static) || isCallExpression) { nodeCheckFlag = NodeCheckFlags.SuperStatic; } diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index bc9341a4b4f..c1398f75da6 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -2837,7 +2837,6 @@ namespace ts { // _super.call(this, a) // _super.m.call(this, a) // _super.prototype.m.call(this, a) - resultingCall = createFunctionCall( visitNode(target, visitor, isExpression), visitNode(thisArg, visitor, isExpression), diff --git a/tests/baselines/reference/errorSuperCalls.errors.txt b/tests/baselines/reference/errorSuperCalls.errors.txt index 49bcb4b4d45..ee2ba6d829d 100644 --- a/tests/baselines/reference/errorSuperCalls.errors.txt +++ b/tests/baselines/reference/errorSuperCalls.errors.txt @@ -7,6 +7,7 @@ tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(26,9): error T tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(30,16): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(34,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(38,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(46,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(46,14): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(58,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(62,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. @@ -14,7 +15,7 @@ tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(67,9): error T tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(71,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. -==== tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts (14 errors) ==== +==== tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts (15 errors) ==== //super call in class constructor with no base type class NoBase { constructor() { @@ -79,6 +80,8 @@ tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(71,9): error T //super call with type arguments constructor() { super(); + ~~~~~ +!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. super(); diff --git a/tests/baselines/reference/superAccess2.errors.txt b/tests/baselines/reference/superAccess2.errors.txt index d8b39284f65..c427115574f 100644 --- a/tests/baselines/reference/superAccess2.errors.txt +++ b/tests/baselines/reference/superAccess2.errors.txt @@ -2,10 +2,13 @@ tests/cases/compiler/superAccess2.ts(7,15): error TS1034: 'super' must be follow tests/cases/compiler/superAccess2.ts(8,17): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class. tests/cases/compiler/superAccess2.ts(8,22): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/compiler/superAccess2.ts(11,28): error TS2336: 'super' cannot be referenced in constructor arguments. +tests/cases/compiler/superAccess2.ts(11,28): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/superAccess2.ts(11,33): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/compiler/superAccess2.ts(11,40): error TS2336: 'super' cannot be referenced in constructor arguments. +tests/cases/compiler/superAccess2.ts(11,40): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/superAccess2.ts(11,45): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/compiler/superAccess2.ts(11,59): error TS2336: 'super' cannot be referenced in constructor arguments. +tests/cases/compiler/superAccess2.ts(11,59): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/superAccess2.ts(11,64): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/compiler/superAccess2.ts(15,19): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/compiler/superAccess2.ts(17,15): error TS2339: Property 'y' does not exist on type 'P'. @@ -13,7 +16,7 @@ tests/cases/compiler/superAccess2.ts(20,26): error TS1034: 'super' must be follo tests/cases/compiler/superAccess2.ts(21,15): error TS2339: Property 'x' does not exist on type 'typeof P'. -==== tests/cases/compiler/superAccess2.ts (13 errors) ==== +==== tests/cases/compiler/superAccess2.ts (16 errors) ==== class P { x() { } static y() { } @@ -33,14 +36,20 @@ tests/cases/compiler/superAccess2.ts(21,15): error TS2339: Property 'x' does not constructor(public z = super, zz = super, zzz = () => super) { ~~~~~ !!! error TS2336: 'super' cannot be referenced in constructor arguments. + ~~~~~ +!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ !!! error TS2336: 'super' cannot be referenced in constructor arguments. + ~~~~~ +!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ !!! error TS2336: 'super' cannot be referenced in constructor arguments. + ~~~~~ +!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. super(); diff --git a/tests/baselines/reference/superInConstructorParam1.errors.txt b/tests/baselines/reference/superInConstructorParam1.errors.txt index 96735c92547..1eac79769d8 100644 --- a/tests/baselines/reference/superInConstructorParam1.errors.txt +++ b/tests/baselines/reference/superInConstructorParam1.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/superInConstructorParam1.ts(8,3): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/compiler/superInConstructorParam1.ts(8,19): error TS2336: 'super' cannot be referenced in constructor arguments. +tests/cases/compiler/superInConstructorParam1.ts(8,19): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. -==== tests/cases/compiler/superInConstructorParam1.ts (2 errors) ==== +==== tests/cases/compiler/superInConstructorParam1.ts (3 errors) ==== class B { public foo(): number { return 0; @@ -14,6 +15,8 @@ tests/cases/compiler/superInConstructorParam1.ts(8,19): error TS2336: 'super' ca ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ !!! error TS2336: 'super' cannot be referenced in constructor arguments. + ~~~~~ +!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. } ~~~ !!! error TS2377: Constructors for derived classes must contain a 'super' call. diff --git a/tests/baselines/reference/superNewCall1.errors.txt b/tests/baselines/reference/superNewCall1.errors.txt index 2b104e7d647..3dd7435e5c4 100644 --- a/tests/baselines/reference/superNewCall1.errors.txt +++ b/tests/baselines/reference/superNewCall1.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/superNewCall1.ts(9,5): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/compiler/superNewCall1.ts(10,9): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/superNewCall1.ts(10,13): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. -==== tests/cases/compiler/superNewCall1.ts (2 errors) ==== +==== tests/cases/compiler/superNewCall1.ts (3 errors) ==== class A { constructor(private map: (value: T1) => T2) { @@ -17,6 +18,8 @@ tests/cases/compiler/superNewCall1.ts(10,9): error TS2351: Cannot use 'new' with ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. + ~~~~~ +!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. } ~~~~~ !!! error TS2377: Constructors for derived classes must contain a 'super' call. diff --git a/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.errors.txt b/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.errors.txt new file mode 100644 index 00000000000..029154e3318 --- /dev/null +++ b/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts(7,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts(13,15): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. + + +==== tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts (2 errors) ==== + class B { + constructor(x?: string) {} + x(): string { return ""; } + } + class C1 extends B { + constructor() { + super.x(); + ~~~~~ +!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. + super(); + } + } + class C2 extends B { + constructor() { + super(super.x()); + ~~~~~ +!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.js b/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.js new file mode 100644 index 00000000000..15bc0c40f37 --- /dev/null +++ b/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.js @@ -0,0 +1,46 @@ +//// [superPropertyInConstructorBeforeSuperCall.ts] +class B { + constructor(x?: string) {} + x(): string { return ""; } +} +class C1 extends B { + constructor() { + super.x(); + super(); + } +} +class C2 extends B { + constructor() { + super(super.x()); + } +} + +//// [superPropertyInConstructorBeforeSuperCall.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var B = (function () { + function B(x) { + } + B.prototype.x = function () { return ""; }; + return B; +}()); +var C1 = (function (_super) { + __extends(C1, _super); + function C1() { + var _this; + _super.prototype.x.call(_this); + _this = _super.call(this) || this; + return _this; + } + return C1; +}(B)); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + return _super.call(this, _super.x.call(_this)) || this; + } + return C2; +}(B)); diff --git a/tests/baselines/reference/superWithTypeArgument.errors.txt b/tests/baselines/reference/superWithTypeArgument.errors.txt index d749cbd5157..bef02357d35 100644 --- a/tests/baselines/reference/superWithTypeArgument.errors.txt +++ b/tests/baselines/reference/superWithTypeArgument.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/superWithTypeArgument.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call. +tests/cases/compiler/superWithTypeArgument.ts(7,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/superWithTypeArgument.ts(7,14): error TS1034: 'super' must be followed by an argument list or member access. -==== tests/cases/compiler/superWithTypeArgument.ts (2 errors) ==== +==== tests/cases/compiler/superWithTypeArgument.ts (3 errors) ==== class C { } @@ -12,6 +13,8 @@ tests/cases/compiler/superWithTypeArgument.ts(7,14): error TS1034: 'super' must ~~~~~~~~~~~~~~~ super(); ~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. } diff --git a/tests/baselines/reference/superWithTypeArgument2.errors.txt b/tests/baselines/reference/superWithTypeArgument2.errors.txt index 766327c5c81..4bd7e960858 100644 --- a/tests/baselines/reference/superWithTypeArgument2.errors.txt +++ b/tests/baselines/reference/superWithTypeArgument2.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/superWithTypeArgument2.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call. +tests/cases/compiler/superWithTypeArgument2.ts(7,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/superWithTypeArgument2.ts(7,14): error TS1034: 'super' must be followed by an argument list or member access. -==== tests/cases/compiler/superWithTypeArgument2.ts (2 errors) ==== +==== tests/cases/compiler/superWithTypeArgument2.ts (3 errors) ==== class C { foo: T; } @@ -12,6 +13,8 @@ tests/cases/compiler/superWithTypeArgument2.ts(7,14): error TS1034: 'super' must ~~~~~~~~~~~~~~~~ super(x); ~~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. } diff --git a/tests/baselines/reference/superWithTypeArgument3.errors.txt b/tests/baselines/reference/superWithTypeArgument3.errors.txt index 323b2958fcb..a6a59f92a00 100644 --- a/tests/baselines/reference/superWithTypeArgument3.errors.txt +++ b/tests/baselines/reference/superWithTypeArgument3.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/superWithTypeArgument3.ts(7,5): error TS2377: Constructors for derived classes must contain a 'super' call. +tests/cases/compiler/superWithTypeArgument3.ts(8,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS1034: 'super' must be followed by an argument list or member access. -==== tests/cases/compiler/superWithTypeArgument3.ts (2 errors) ==== +==== tests/cases/compiler/superWithTypeArgument3.ts (3 errors) ==== class C { foo: T; bar(x: U) { } @@ -13,6 +14,8 @@ tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS1034: 'super' must ~~~~~~~~~~~~~~~ super(); ~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. } diff --git a/tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts b/tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts new file mode 100644 index 00000000000..9d5d4c8c895 --- /dev/null +++ b/tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts @@ -0,0 +1,15 @@ +class B { + constructor(x?: string) {} + x(): string { return ""; } +} +class C1 extends B { + constructor() { + super.x(); + super(); + } +} +class C2 extends B { + constructor() { + super(super.x()); + } +} \ No newline at end of file From 9336886fc2340079e38751e8b088f4a8ef9eea2e Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 6 Dec 2016 10:57:52 -0800 Subject: [PATCH 09/21] Added more specific diagnostic message --- src/compiler/checker.ts | 8 ++++---- src/compiler/diagnosticMessages.json | 4 ++++ tests/baselines/reference/superAccess2.errors.txt | 12 ++++++------ .../reference/superInConstructorParam1.errors.txt | 4 ++-- tests/baselines/reference/superNewCall1.errors.txt | 4 ++-- ...erPropertyInConstructorBeforeSuperCall.errors.txt | 8 ++++---- .../reference/superWithTypeArgument.errors.txt | 4 ++-- .../reference/superWithTypeArgument2.errors.txt | 4 ++-- .../reference/superWithTypeArgument3.errors.txt | 4 ++-- 9 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8c08e9b121b..b7b3043e661 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10405,7 +10405,7 @@ namespace ts { return baseConstructorType === nullWideningType; } - function checkThisBeforeSuper(node: Node, container: Node) { + function checkThisBeforeSuper(node: Node, container: Node, diagnosticMessage: DiagnosticMessage) { const containingClassDecl = container.parent; const baseTypeNode = getClassExtendsHeritageClauseElement(containingClassDecl); @@ -10423,7 +10423,7 @@ namespace ts { // "this" is not accessed as a parameter of the super-call. if (!superCall || superCall.end > node.pos) { // In ES6, super inside constructor of class-declaration has to precede "this" accessing - error(node, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); + error(node, diagnosticMessage); } } } @@ -10435,7 +10435,7 @@ namespace ts { let needToCaptureLexicalThis = false; if (container.kind === SyntaxKind.Constructor) { - checkThisBeforeSuper(node, container); + checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. @@ -10584,7 +10584,7 @@ namespace ts { } if (!isCallExpression && container.kind === SyntaxKind.Constructor) { - checkThisBeforeSuper(node, container); + checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if ((getModifierFlags(container) & ModifierFlags.Static) || isCallExpression) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 4d42c77e566..b59921c2948 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3165,6 +3165,10 @@ "category": "Error", "code": 17010 }, + "'super' must be called before accessing a property of 'super' in the constructor of a derived class.": { + "category": "Error", + "code": 17011 + }, "Circularity detected while resolving configuration: {0}": { "category": "Error", diff --git a/tests/baselines/reference/superAccess2.errors.txt b/tests/baselines/reference/superAccess2.errors.txt index c427115574f..edcd4031c47 100644 --- a/tests/baselines/reference/superAccess2.errors.txt +++ b/tests/baselines/reference/superAccess2.errors.txt @@ -2,13 +2,13 @@ tests/cases/compiler/superAccess2.ts(7,15): error TS1034: 'super' must be follow tests/cases/compiler/superAccess2.ts(8,17): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class. tests/cases/compiler/superAccess2.ts(8,22): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/compiler/superAccess2.ts(11,28): error TS2336: 'super' cannot be referenced in constructor arguments. -tests/cases/compiler/superAccess2.ts(11,28): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +tests/cases/compiler/superAccess2.ts(11,28): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. tests/cases/compiler/superAccess2.ts(11,33): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/compiler/superAccess2.ts(11,40): error TS2336: 'super' cannot be referenced in constructor arguments. -tests/cases/compiler/superAccess2.ts(11,40): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +tests/cases/compiler/superAccess2.ts(11,40): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. tests/cases/compiler/superAccess2.ts(11,45): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/compiler/superAccess2.ts(11,59): error TS2336: 'super' cannot be referenced in constructor arguments. -tests/cases/compiler/superAccess2.ts(11,59): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +tests/cases/compiler/superAccess2.ts(11,59): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. tests/cases/compiler/superAccess2.ts(11,64): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/compiler/superAccess2.ts(15,19): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/compiler/superAccess2.ts(17,15): error TS2339: Property 'y' does not exist on type 'P'. @@ -37,19 +37,19 @@ tests/cases/compiler/superAccess2.ts(21,15): error TS2339: Property 'x' does not ~~~~~ !!! error TS2336: 'super' cannot be referenced in constructor arguments. ~~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ !!! error TS2336: 'super' cannot be referenced in constructor arguments. ~~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ !!! error TS2336: 'super' cannot be referenced in constructor arguments. ~~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. super(); diff --git a/tests/baselines/reference/superInConstructorParam1.errors.txt b/tests/baselines/reference/superInConstructorParam1.errors.txt index 1eac79769d8..4220fcb9b0e 100644 --- a/tests/baselines/reference/superInConstructorParam1.errors.txt +++ b/tests/baselines/reference/superInConstructorParam1.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/superInConstructorParam1.ts(8,3): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/compiler/superInConstructorParam1.ts(8,19): error TS2336: 'super' cannot be referenced in constructor arguments. -tests/cases/compiler/superInConstructorParam1.ts(8,19): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +tests/cases/compiler/superInConstructorParam1.ts(8,19): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. ==== tests/cases/compiler/superInConstructorParam1.ts (3 errors) ==== @@ -16,7 +16,7 @@ tests/cases/compiler/superInConstructorParam1.ts(8,19): error TS17009: 'super' m ~~~~~ !!! error TS2336: 'super' cannot be referenced in constructor arguments. ~~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. } ~~~ !!! error TS2377: Constructors for derived classes must contain a 'super' call. diff --git a/tests/baselines/reference/superNewCall1.errors.txt b/tests/baselines/reference/superNewCall1.errors.txt index 3dd7435e5c4..c8fd5c471fb 100644 --- a/tests/baselines/reference/superNewCall1.errors.txt +++ b/tests/baselines/reference/superNewCall1.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/superNewCall1.ts(9,5): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/compiler/superNewCall1.ts(10,9): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/superNewCall1.ts(10,13): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +tests/cases/compiler/superNewCall1.ts(10,13): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. ==== tests/cases/compiler/superNewCall1.ts (3 errors) ==== @@ -19,7 +19,7 @@ tests/cases/compiler/superNewCall1.ts(10,13): error TS17009: 'super' must be cal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. ~~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. } ~~~~~ !!! error TS2377: Constructors for derived classes must contain a 'super' call. diff --git a/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.errors.txt b/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.errors.txt index 029154e3318..407e984c5d1 100644 --- a/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.errors.txt +++ b/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts(7,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. -tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts(13,15): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts(7,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. +tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts(13,15): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. ==== tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts (2 errors) ==== @@ -11,7 +11,7 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/superProperty constructor() { super.x(); ~~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. super(); } } @@ -19,6 +19,6 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/superProperty constructor() { super(super.x()); ~~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. } } \ No newline at end of file diff --git a/tests/baselines/reference/superWithTypeArgument.errors.txt b/tests/baselines/reference/superWithTypeArgument.errors.txt index bef02357d35..5860cb466d9 100644 --- a/tests/baselines/reference/superWithTypeArgument.errors.txt +++ b/tests/baselines/reference/superWithTypeArgument.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/superWithTypeArgument.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call. -tests/cases/compiler/superWithTypeArgument.ts(7,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +tests/cases/compiler/superWithTypeArgument.ts(7,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. tests/cases/compiler/superWithTypeArgument.ts(7,14): error TS1034: 'super' must be followed by an argument list or member access. @@ -14,7 +14,7 @@ tests/cases/compiler/superWithTypeArgument.ts(7,14): error TS1034: 'super' must super(); ~~~~~~~~~~~~~~~~~~~ ~~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. } diff --git a/tests/baselines/reference/superWithTypeArgument2.errors.txt b/tests/baselines/reference/superWithTypeArgument2.errors.txt index 4bd7e960858..473e7f3b7ad 100644 --- a/tests/baselines/reference/superWithTypeArgument2.errors.txt +++ b/tests/baselines/reference/superWithTypeArgument2.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/superWithTypeArgument2.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call. -tests/cases/compiler/superWithTypeArgument2.ts(7,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +tests/cases/compiler/superWithTypeArgument2.ts(7,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. tests/cases/compiler/superWithTypeArgument2.ts(7,14): error TS1034: 'super' must be followed by an argument list or member access. @@ -14,7 +14,7 @@ tests/cases/compiler/superWithTypeArgument2.ts(7,14): error TS1034: 'super' must super(x); ~~~~~~~~~~~~~~~~~~~~ ~~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. } diff --git a/tests/baselines/reference/superWithTypeArgument3.errors.txt b/tests/baselines/reference/superWithTypeArgument3.errors.txt index a6a59f92a00..37e6681d770 100644 --- a/tests/baselines/reference/superWithTypeArgument3.errors.txt +++ b/tests/baselines/reference/superWithTypeArgument3.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/superWithTypeArgument3.ts(7,5): error TS2377: Constructors for derived classes must contain a 'super' call. -tests/cases/compiler/superWithTypeArgument3.ts(8,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +tests/cases/compiler/superWithTypeArgument3.ts(8,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS1034: 'super' must be followed by an argument list or member access. @@ -15,7 +15,7 @@ tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS1034: 'super' must super(); ~~~~~~~~~~~~~~~~~~~ ~~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. } From e8024e426609b5249eed19c066bc4b8f7f6a8a29 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 6 Dec 2016 11:19:27 -0800 Subject: [PATCH 10/21] Updated baseline --- tests/baselines/reference/errorSuperCalls.errors.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/baselines/reference/errorSuperCalls.errors.txt b/tests/baselines/reference/errorSuperCalls.errors.txt index ee2ba6d829d..036367fd44b 100644 --- a/tests/baselines/reference/errorSuperCalls.errors.txt +++ b/tests/baselines/reference/errorSuperCalls.errors.txt @@ -7,7 +7,7 @@ tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(26,9): error T tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(30,16): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(34,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(38,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. -tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(46,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(46,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(46,14): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(58,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(62,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. @@ -81,7 +81,7 @@ tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(71,9): error T constructor() { super(); ~~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. ~ !!! error TS1034: 'super' must be followed by an argument list or member access. super(); From 7d049c27423c831cf26886b14cf63defd312c4d2 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 6 Dec 2016 11:42:44 -0800 Subject: [PATCH 11/21] Write property name of destructuring pattern explicitly There wont be any symbol for the property name but we already know it is a property name Fixes #12166 --- src/compiler/checker.ts | 2 +- src/compiler/declarationEmitter.ts | 1 + src/compiler/types.ts | 1 + src/compiler/utilities.ts | 1 + src/services/utilities.ts | 1 + ...InfoWithNestedDestructuredParameterInLambda.ts | 15 +++++++++++++++ 6 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/quickInfoWithNestedDestructuredParameterInLambda.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 903c8cfda1c..3d7be4723a4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2673,7 +2673,7 @@ namespace ts { } Debug.assert(bindingElement.kind === SyntaxKind.BindingElement); if (bindingElement.propertyName) { - writer.writeSymbol(getTextOfNode(bindingElement.propertyName), bindingElement.symbol); + writer.writeProperty(getTextOfNode(bindingElement.propertyName)); writePunctuation(writer, SyntaxKind.ColonToken); writeSpace(writer); } diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 38e0db0ba6b..cd98622e080 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -194,6 +194,7 @@ namespace ts { writer.writeSpace = writer.write; writer.writeStringLiteral = writer.writeLiteral; writer.writeParameter = writer.write; + writer.writeProperty = writer.write; writer.writeSymbol = writer.write; setWriter(writer); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 0ad84d11c35..c1592d30eae 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2407,6 +2407,7 @@ namespace ts { writeSpace(text: string): void; writeStringLiteral(text: string): void; writeParameter(text: string): void; + writeProperty(text: string): void; writeSymbol(text: string, symbol: Symbol): void; writeLine(): void; increaseIndent(): void; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 4fa0c60dce7..ddfa85bc311 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -43,6 +43,7 @@ namespace ts { writeSpace: writeText, writeStringLiteral: writeText, writeParameter: writeText, + writeProperty: writeText, writeSymbol: writeText, // Completely ignore indentation for string writers. And map newlines to diff --git a/src/services/utilities.ts b/src/services/utilities.ts index e19fdc0a84a..2f52d747e23 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1137,6 +1137,7 @@ namespace ts { writeSpace: text => writeKind(text, SymbolDisplayPartKind.space), writeStringLiteral: text => writeKind(text, SymbolDisplayPartKind.stringLiteral), writeParameter: text => writeKind(text, SymbolDisplayPartKind.parameterName), + writeProperty: text => writeKind(text, SymbolDisplayPartKind.propertyName), writeSymbol, writeLine, increaseIndent: () => { indent++; }, diff --git a/tests/cases/fourslash/quickInfoWithNestedDestructuredParameterInLambda.ts b/tests/cases/fourslash/quickInfoWithNestedDestructuredParameterInLambda.ts new file mode 100644 index 00000000000..39453ba8cdc --- /dev/null +++ b/tests/cases/fourslash/quickInfoWithNestedDestructuredParameterInLambda.ts @@ -0,0 +1,15 @@ +/// + +// @filename: a.tsx +////import * as React from 'react'; +////interface SomeInterface { +//// someBoolean: boolean, +//// someString: string; +////} +////interface SomeProps { +//// someProp: SomeInterface; +////} +////export const /*1*/SomeStatelessComponent = ({someProp: { someBoolean, someString}}: SomeProps) => (
{`${someBoolean}${someString}`}); + +goTo.marker("1"); +verify.quickInfoExists(); From 3db14216c52cf5852521d58db7efe7dc8174e071 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 6 Dec 2016 12:58:26 -0800 Subject: [PATCH 12/21] Update authors --- .mailmap | 11 ++++++++++- AUTHORS.md | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index cc101c0517e..f81103ffd94 100644 --- a/.mailmap +++ b/.mailmap @@ -172,4 +172,13 @@ zhongsp # Patrick Zhong T18970237136 # @T18970237136 JBerger bootstraponline # @bootstraponline -yortus # @yortus \ No newline at end of file +yortus # @yortus +András Parditka +Anton Khlynovskiy +Charly POLY +Cotton Hou +Ethan Resnick +Marius Schulz +Mattias Buelens +Myles Megyesi +Tim Lancina \ No newline at end of file diff --git a/AUTHORS.md b/AUTHORS.md index 50f1ea12c2b..f28d3600c5a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -10,8 +10,10 @@ TypeScript is authored by: * Anders Hejlsberg * Andrej Baran * Andrew Z Allen +* András Parditka * Andy Hanson * Anil Anar +* Anton Khlynovskiy * Anton Tolmachev * Arnav Singh * Arthur Ozga @@ -27,11 +29,13 @@ TypeScript is authored by: * Brett Mayen * Bryan Forbes * Caitlin Potter +* Charly POLY * Chris Bubernak * Christophe Vidal * Chuck Jazdzewski * Colby Russell * Colin Snover +* Cotton Hou * Cyrus Najmabadi * Dafrok Zhang * Dan Corder @@ -47,6 +51,7 @@ TypeScript is authored by: * Doug Ilijev * Eric Tsang * Erik Edrosa +* Ethan Resnick * Ethan Rubio * Evan Martin * Evan Sebastian @@ -102,13 +107,16 @@ TypeScript is authored by: * Lucien Greathouse * Lukas Elmer * Marin Marinov +* Marius Schulz * Martin Vseticka * Masahiro Wakame * Matt McCutchen +* Mattias Buelens * Max Deepfield * Micah Zoltu * Michael * Mohamed Hegazy +* Myles Megyesi * Nathan Shively-Sanders * Nathan Yee * Nima Zahedi @@ -153,6 +161,7 @@ TypeScript is authored by: * Tarik Ozket * Tetsuharu Ohzeki * Tien Hoanhtien +* Tim Lancina * Tim Perry * Tim Viiding-Spader * Tingan Ho From 7b102960cc172161818a098923b9bb67ada4f19e Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 6 Dec 2016 13:13:25 -0800 Subject: [PATCH 13/21] Add authors from https://github.com/Microsoft/TSJS-lib-generator/blob/master/AUTHORS.md --- .mailmap | 34 +++++++++++++++++++++++++++++++++- AUTHORS.md | 24 ++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index f81103ffd94..ede478c8a18 100644 --- a/.mailmap +++ b/.mailmap @@ -181,4 +181,36 @@ Ethan Resnick Marius Schulz Mattias Buelens Myles Megyesi -Tim Lancina \ No newline at end of file +Tim Lancina +Aaron Holmes Aaron Holmes +Akshar Patel +Ali Sabzevari +Aliaksandr Radzivanovich +BuildTools # Franklin Tse +ChogyDan # Daniel Hollocher +Daniel Rosenwasser Daniel Rosenwasser +David Kmenta +E020873 # Nicolas Henry +Elisée Maurer +Emilio García-Pumarino dashaus +Guilherme Oenning +Herrington Darkholme +Ivo Gabe de Wolff +Joey Wilson +Jonathon Smith +Juan Luis Boya García +Kagami Sascha Rosylight +Lucien Greathouse +Martin Vseticka +Mattias Buelens +Michael Bromley +Paul Jolly +Perry Jiang +Peter Burns +Robert Coie +Thomas Loubiou +Tim Perry +Vidar Tonaas Fauske +Viktor Zozulyak +rix # Richard Sentino +rohitverma007 # Rohit Verma \ No newline at end of file diff --git a/AUTHORS.md b/AUTHORS.md index f28d3600c5a..ae7832176ea 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,11 +1,15 @@ TypeScript is authored by: +* Aaron Holmes * Abubaker Bashir * Adam Freidin * Adi Dahiya * Ahmad Farid +* Akshar Patel * Alex Eagle * Alexander Kuvaev * Alexander Rusakov +* Ali Sabzevari +* Aliaksandr Radzivanovich * Anatoly Ressin * Anders Hejlsberg * Andrej Baran @@ -40,7 +44,9 @@ TypeScript is authored by: * Dafrok Zhang * Dan Corder * Dan Quirk +* Daniel Hollocher * Daniel Rosenwasser +* David Kmenta * David Li * David Souther * Denis Nedelyaev @@ -49,6 +55,8 @@ TypeScript is authored by: * Dirk Holtwick * Dom Chen * Doug Ilijev +* Elisée Maurer +* Emilio García-Pumarino * Eric Tsang * Erik Edrosa * Ethan Resnick @@ -59,12 +67,14 @@ TypeScript is authored by: * Fabian Cook * @falsandtru * Frank Wallis +* Franklin Tse * František Žiacik * Gabe Moothart * Gabriel Isenberg * Gilad Peleg * Godfrey Chan * Graeme Wicksted +* Guilherme Oenning * Guillaume Salles * Guy Bedford * Harald Niesche @@ -83,12 +93,14 @@ TypeScript is authored by: * Jeffrey Morlan * Jesse Schalken * Jiri Tobisek +* Joey Wilson * Johannes Rieken * John Vilk * Jonathan Bond-Caron * Jonathan Park * Jonathan Toland * Jonathan Turner +* Jonathon Smith * Josh Abernathy * Josh Kalderimis * Josh Soref @@ -111,14 +123,17 @@ TypeScript is authored by: * Martin Vseticka * Masahiro Wakame * Matt McCutchen +* Mattias Buelens * Mattias Buelens * Max Deepfield * Micah Zoltu * Michael +* Michael Bromley * Mohamed Hegazy * Myles Megyesi * Nathan Shively-Sanders * Nathan Yee +* Nicolas Henry * Nima Zahedi * Noah Chen * Noj Vek @@ -127,9 +142,12 @@ TypeScript is authored by: * Omer Sheikh * Oskar Segersva¨rd * Patrick Zhong +* Paul Jolly * Paul van Brenk * @pcbro * Pedro Maltez +* Perry Jiang +* Peter Burns * Philip Bulley * Piero Cangianiello * @piloopin @@ -138,6 +156,9 @@ TypeScript is authored by: * Punya Biswal * Rado Kirov * Richard Knoll +* Richard Sentino +* Robert Coie +* Rohit Verma * Ron Buckton * Rostislav Galimsky * Rowan Wyborn @@ -160,6 +181,7 @@ TypeScript is authored by: * @T18970237136 * Tarik Ozket * Tetsuharu Ohzeki +* Thomas Loubiou * Tien Hoanhtien * Tim Lancina * Tim Perry @@ -170,6 +192,8 @@ TypeScript is authored by: * Tomas Grubliauskas * Torben Fitschen * TruongSinh Tran-Nguyen +* Vidar Tonaas Fauske +* Viktor Zozulyak * Vilic Vane * Vladimir Matveev * Wesley Wigham From 3d2a553994aa8c3234b2b7f389773d0d07c04eb2 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 6 Dec 2016 13:39:24 -0800 Subject: [PATCH 14/21] Add empty `types` list to tsconfig.json --- src/compiler/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/tsconfig.json b/src/compiler/tsconfig.json index bd70a0afb10..cbbdbb04d50 100644 --- a/src/compiler/tsconfig.json +++ b/src/compiler/tsconfig.json @@ -11,7 +11,8 @@ "stripInternal": true, "target": "es5", "noUnusedLocals": true, - "noUnusedParameters": true + "noUnusedParameters": true, + "types": [ ] }, "files": [ "core.ts", From c1ec7eff08f3d98f3310be885d1a1a01e7e6eeb6 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 6 Dec 2016 16:44:46 -0800 Subject: [PATCH 15/21] remove projects that were no present in the input list in openExternalProjects (#12699) remove projects that were no present in the input list in openExternalProjects --- .../unittests/tsserverProjectSystem.ts | 60 +++++++++++++++++++ src/server/editorServices.ts | 27 ++++++++- src/server/session.ts | 6 +- 3 files changed, 87 insertions(+), 6 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 3e9fd7a70e4..77ebee6fadd 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -727,6 +727,66 @@ namespace ts.projectSystem { checkNumberOfInferredProjects(projectService, 1); }); + it("remove not-listed external projects", () => { + const f1 = { + path: "/a/app.ts", + content: "let x = 1" + }; + const f2 = { + path: "/b/app.ts", + content: "let x = 1" + }; + const f3 = { + path: "/c/app.ts", + content: "let x = 1" + }; + const makeProject = (f: FileOrFolder) => ({ projectFileName: f.path + ".csproj", rootFiles: [toExternalFile(f.path)], options: {} }); + const p1 = makeProject(f1); + const p2 = makeProject(f2); + const p3 = makeProject(f3); + + const host = createServerHost([f1, f2, f3]); + const session = createSession(host); + + session.executeCommand({ + seq: 1, + type: "request", + command: "openExternalProjects", + arguments: { projects: [p1, p2] } + }); + + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { externalProjects: 2 }); + assert.equal(projectService.externalProjects[0].getProjectName(), p1.projectFileName); + assert.equal(projectService.externalProjects[1].getProjectName(), p2.projectFileName); + + session.executeCommand({ + seq: 2, + type: "request", + command: "openExternalProjects", + arguments: { projects: [p1, p3] } + }); + checkNumberOfProjects(projectService, { externalProjects: 2 }); + assert.equal(projectService.externalProjects[0].getProjectName(), p1.projectFileName); + assert.equal(projectService.externalProjects[1].getProjectName(), p3.projectFileName); + + session.executeCommand({ + seq: 3, + type: "request", + command: "openExternalProjects", + arguments: { projects: [] } + }); + checkNumberOfProjects(projectService, { externalProjects: 0 }); + + session.executeCommand({ + seq: 3, + type: "request", + command: "openExternalProjects", + arguments: { projects: [p2] } + }); + assert.equal(projectService.externalProjects[0].getProjectName(), p2.projectFileName); + }); + it("handle recreated files correctly", () => { const configFile: FileOrFolder = { path: "/a/b/tsconfig.json", diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index df46f32672f..9e53b3cd526 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1327,7 +1327,28 @@ namespace ts.server { } } - openExternalProject(proj: protocol.ExternalProject): void { + openExternalProjects(projects: protocol.ExternalProject[]): void { + // record project list before the update + const projectsToClose = arrayToMap(this.externalProjects, p => p.getProjectName(), _ => true); + for (const externalProjectName in this.externalProjectToConfiguredProjectMap) { + projectsToClose[externalProjectName] = true; + } + + for (const externalProject of projects) { + this.openExternalProject(externalProject, /*suppressRefreshOfInferredProjects*/ true); + // delete project that is present in input list + delete projectsToClose[externalProject.projectFileName]; + } + + // close projects that were missing in the input list + for (const externalProjectName in projectsToClose) { + this.closeExternalProject(externalProjectName, /*suppressRefresh*/ true) + } + + this.refreshInferredProjects(); + } + + openExternalProject(proj: protocol.ExternalProject, suppressRefreshOfInferredProjects = false): void { // typingOptions has been deprecated and is only supported for backward compatibility // purposes. It should be removed in future releases - use typeAcquisition instead. if (proj.typingOptions && !proj.typeAcquisition) { @@ -1420,7 +1441,9 @@ namespace ts.server { delete this.externalProjectToConfiguredProjectMap[proj.projectFileName]; this.createAndAddExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition); } - this.refreshInferredProjects(); + if (!suppressRefreshOfInferredProjects) { + this.refreshInferredProjects(); + } } } } diff --git a/src/server/session.ts b/src/server/session.ts index 36144b3212d..9abc5a447bf 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1365,14 +1365,12 @@ namespace ts.server { private handlers = createMap<(request: protocol.Request) => { response?: any, responseRequired?: boolean }>({ [CommandNames.OpenExternalProject]: (request: protocol.OpenExternalProjectRequest) => { - this.projectService.openExternalProject(request.arguments); + this.projectService.openExternalProject(request.arguments, /*suppressRefreshOfInferredProjects*/ false); // TODO: report errors return this.requiredResponse(true); }, [CommandNames.OpenExternalProjects]: (request: protocol.OpenExternalProjectsRequest) => { - for (const proj of request.arguments.projects) { - this.projectService.openExternalProject(proj); - } + this.projectService.openExternalProjects(request.arguments.projects); // TODO: report errors return this.requiredResponse(true); }, From efa8c4171b93a8bdf8674ad63db2b9c447d7606f Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 7 Dec 2016 08:19:47 -0800 Subject: [PATCH 16/21] Reuse code from convertJsonOptionOfCustomType --- src/compiler/commandLineParser.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index e9f9ff210a9..025218e62fd 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -549,14 +549,7 @@ namespace ts { /* @internal */ export function parseCustomTypeOption(opt: CommandLineOptionOfCustomType, value: string, errors: Diagnostic[]) { - const key = trimString((value || "")).toLowerCase(); - const map = opt.type; - if (key in map) { - return map[key]; - } - else { - errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); - } + return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors); } /* @internal */ From 85545d9fe8ac9ed9e155139e4eb2e9cdc2bf9299 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 7 Dec 2016 11:34:19 -0800 Subject: [PATCH 17/21] Remove JSON.stringify shim --- src/compiler/core.ts | 18 -------------- src/compiler/sourcemap.ts | 2 +- src/compiler/utilities.ts | 49 --------------------------------------- 3 files changed, 1 insertion(+), 68 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 89057dd2939..dec6b7cc485 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -863,24 +863,6 @@ namespace ts { return result; } - /** - * Reduce the properties defined on a map-like (but not from its prototype chain). - * - * NOTE: This is intended for use with MapLike objects. For Map objects, use - * reduceProperties instead as it offers better performance. - * - * @param map The map-like to reduce - * @param callback An aggregation function that is called for each entry in the map - * @param initial The initial value for the reduction. - */ - export function reduceOwnProperties(map: MapLike, callback: (aggregate: U, value: T, key: string) => U, initial: U): U { - let result = initial; - for (const key in map) if (hasOwnProperty.call(map, key)) { - result = callback(result, map[key], String(key)); - } - return result; - } - /** * Performs a shallow equality comparison of the contents of two map-likes. * diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index 46db5188e33..650b9b0ef02 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -427,7 +427,7 @@ namespace ts { encodeLastRecordedSourceMapSpan(); - return stringify({ + return JSON.stringify({ version: 3, file: sourceMapData.sourceMapFile, sourceRoot: sourceMapData.sourceMapSourceRoot, diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index ddfa85bc311..3dd7054a405 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -3189,55 +3189,6 @@ namespace ts { return output; } - /** - * Serialize an object graph into a JSON string. This is intended only for use on an acyclic graph - * as the fallback implementation does not check for circular references by default. - */ - export const stringify: (value: any) => string = typeof JSON !== "undefined" && JSON.stringify - ? JSON.stringify - : stringifyFallback; - - /** - * Serialize an object graph into a JSON string. - */ - function stringifyFallback(value: any): string { - // JSON.stringify returns `undefined` here, instead of the string "undefined". - return value === undefined ? undefined : stringifyValue(value); - } - - function stringifyValue(value: any): string { - return typeof value === "string" ? `"${escapeString(value)}"` - : typeof value === "number" ? isFinite(value) ? String(value) : "null" - : typeof value === "boolean" ? value ? "true" : "false" - : typeof value === "object" && value ? isArray(value) ? cycleCheck(stringifyArray, value) : cycleCheck(stringifyObject, value) - : /*fallback*/ "null"; - } - - function cycleCheck(cb: (value: any) => string, value: any) { - Debug.assert(!value.hasOwnProperty("__cycle"), "Converting circular structure to JSON"); - value.__cycle = true; - const result = cb(value); - delete value.__cycle; - return result; - } - - function stringifyArray(value: any) { - return `[${reduceLeft(value, stringifyElement, "")}]`; - } - - function stringifyElement(memo: string, value: any) { - return (memo ? memo + "," : memo) + stringifyValue(value); - } - - function stringifyObject(value: any) { - return `{${reduceOwnProperties(value, stringifyProperty, "")}}`; - } - - function stringifyProperty(memo: string, value: any, key: string) { - return value === undefined || typeof value === "function" || key === "__cycle" ? memo - : (memo ? memo + "," : memo) + `"${escapeString(key)}":${stringifyValue(value)}`; - } - const base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; /** From 9f20077914031453c4829ed560d66734e0d791cb Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 7 Dec 2016 13:36:11 -0800 Subject: [PATCH 18/21] Use "completionList" methods instead of "memberList" ones, since they're identical --- src/harness/fourslash.ts | 65 +--- tests/cases/fourslash/basicClassMembers.ts | 6 +- tests/cases/fourslash/commentsClassMembers.ts | 334 +++++++++--------- tests/cases/fourslash/commentsEnums.ts | 8 +- .../fourslash/commentsExternalModules.ts | 22 +- .../fourslash/commentsImportDeclaration.ts | 12 +- tests/cases/fourslash/commentsInheritance.ts | 216 +++++------ tests/cases/fourslash/commentsInterface.ts | 24 +- tests/cases/fourslash/commentsModules.ts | 48 +-- tests/cases/fourslash/commentsOverloads.ts | 18 +- .../completionEntryForUnionProperty.ts | 6 +- .../completionEntryForUnionProperty2.ts | 6 +- ...nForQuotedPropertyInPropertyAssignment1.ts | 4 +- ...nForQuotedPropertyInPropertyAssignment2.ts | 4 +- ...nForQuotedPropertyInPropertyAssignment3.ts | 4 +- ...nForQuotedPropertyInPropertyAssignment4.ts | 4 +- .../fourslash/completionForStringLiteral.ts | 4 +- .../fourslash/completionForStringLiteral2.ts | 4 +- .../fourslash/completionForStringLiteral3.ts | 4 +- .../fourslash/completionForStringLiteral4.ts | 2 +- .../fourslash/completionListAfterAnyType.ts | 4 +- .../completionListAfterInvalidCharacter.ts | 2 +- .../completionListAfterObjectLiteral1.ts | 4 +- ...tionListAfterRegularExpressionLiteral01.ts | 4 +- ...etionListAfterRegularExpressionLiteral1.ts | 4 +- .../completionListAfterStringLiteral1.ts | 4 +- ...mpletionListAndMemberListOnCommentedDot.ts | 2 +- ...nListAndMemberListOnCommentedWhiteSpace.ts | 2 +- tests/cases/fourslash/completionListAtEOF1.ts | 2 +- tests/cases/fourslash/completionListAtEOF2.ts | 2 +- .../fourslash/completionListAtNodeBoundry.ts | 2 +- .../fourslash/completionListBeforeKeyword.ts | 8 +- .../cases/fourslash/completionListCladule.ts | 16 +- .../fourslash/completionListClassMembers.ts | 52 +-- .../fourslash/completionListEnumMembers.ts | 14 +- .../fourslash/completionListEnumValues.ts | 14 +- .../fourslash/completionListErrorRecovery.ts | 2 +- ...berInAmbientModuleWithExportAssignment1.ts | 2 +- .../completionListForObjectSpread.ts | 22 +- .../cases/fourslash/completionListForRest.ts | 6 +- ...etionListForShorthandPropertyAssignment.ts | 4 +- ...tionListForShorthandPropertyAssignment2.ts | 4 +- .../completionListFunctionMembers.ts | 2 +- .../completionListGenericConstraints.ts | 34 +- .../completionListInClosedFunction01.ts | 8 +- .../completionListInClosedFunction02.ts | 16 +- .../completionListInClosedFunction03.ts | 16 +- .../completionListInClosedFunction04.ts | 16 +- .../completionListInClosedFunction05.ts | 18 +- .../completionListInClosedFunction06.ts | 2 +- .../completionListInClosedFunction07.ts | 20 +- ...tInClosedObjectTypeLiteralInSignature01.ts | 10 +- ...tInClosedObjectTypeLiteralInSignature02.ts | 10 +- ...tInClosedObjectTypeLiteralInSignature03.ts | 10 +- ...tInClosedObjectTypeLiteralInSignature04.ts | 10 +- .../fourslash/completionListInEmptyFile.ts | 2 +- .../completionListInExtendsClauseAtEOF.ts | 4 +- .../completionListInFunctionExpression.ts | 8 +- ...completionListInNamedFunctionExpression.ts | 6 +- .../completionListInObjectLiteral.ts | 4 +- ...ectLiteralThatIsParameterOfFunctionCall.ts | 6 +- .../cases/fourslash/completionListInScope.ts | 56 +-- ...mpletionListInTypeParameterOfTypeAlias3.ts | 12 +- .../completionListInTypedObjectLiterals2.ts | 4 +- .../completionListInTypedObjectLiterals3.ts | 4 +- .../completionListInTypedObjectLiterals4.ts | 6 +- ...dObjectLiteralsWithPartialPropertyNames.ts | 24 +- ...ObjectLiteralsWithPartialPropertyNames2.ts | 6 +- .../completionListInUnclosedFunction01.ts | 8 +- .../completionListInUnclosedFunction02.ts | 16 +- .../completionListInUnclosedFunction03.ts | 16 +- .../completionListInUnclosedFunction04.ts | 16 +- .../completionListInUnclosedFunction05.ts | 16 +- .../completionListInUnclosedFunction06.ts | 16 +- .../completionListInUnclosedFunction07.ts | 16 +- .../completionListInUnclosedFunction08.ts | 18 +- .../completionListInUnclosedFunction09.ts | 18 +- .../completionListInUnclosedFunction10.ts | 2 +- .../completionListInUnclosedFunction11.ts | 2 +- .../completionListInUnclosedFunction12.ts | 2 +- .../completionListInUnclosedFunction13.ts | 2 +- .../completionListInUnclosedFunction14.ts | 20 +- .../completionListInUnclosedFunction15.ts | 20 +- .../completionListInUnclosedFunction16.ts | 20 +- .../completionListInUnclosedFunction17.ts | 20 +- .../completionListInUnclosedFunction18.ts | 20 +- .../completionListInUnclosedFunction19.ts | 20 +- ...nUnclosedObjectTypeLiteralInSignature01.ts | 10 +- ...nUnclosedObjectTypeLiteralInSignature02.ts | 10 +- ...nUnclosedObjectTypeLiteralInSignature03.ts | 10 +- ...nUnclosedObjectTypeLiteralInSignature04.ts | 10 +- .../completionListInstanceProtectedMembers.ts | 48 +-- ...completionListInstanceProtectedMembers2.ts | 64 ++-- ...completionListInstanceProtectedMembers3.ts | 32 +- ...completionListInstanceProtectedMembers4.ts | 16 +- .../completionListInvalidMemberNames.ts | 2 +- .../completionListInvalidMemberNames2.ts | 6 +- .../cases/fourslash/completionListKeywords.ts | 86 ++--- .../fourslash/completionListModuleMembers.ts | 38 +- .../fourslash/completionListObjectMembers.ts | 4 +- .../fourslash/completionListOfGnericSymbol.ts | 4 +- .../completionListOfSplitInterface.ts | 26 +- .../fourslash/completionListOnAliases.ts | 4 +- .../fourslash/completionListOnAliases2.ts | 38 +- .../fourslash/completionListOnAliases3.ts | 2 +- ...nListOnFunctionCallWithOptionalArgument.ts | 2 +- .../cases/fourslash/completionListOnParam.ts | 2 +- .../completionListOnParamOfGenericType1.ts | 18 +- .../cases/fourslash/completionListOnSuper.ts | 6 +- .../completionListOnVarBetweenModules.ts | 4 +- .../fourslash/completionListPrimitives.ts | 14 +- .../fourslash/completionListPrivateMembers.ts | 4 +- .../completionListPrivateMembers2.ts | 8 +- .../completionListPrivateMembers3.ts | 12 +- .../completionListProtectedMembers.ts | 30 +- .../completionListStaticProtectedMembers.ts | 48 +-- .../completionListStaticProtectedMembers2.ts | 64 ++-- .../completionListStaticProtectedMembers3.ts | 32 +- .../completionListStaticProtectedMembers4.ts | 32 +- .../fourslash/completionListSuperMembers.ts | 12 +- tests/cases/fourslash/exportEqualTypes.ts | 2 +- tests/cases/fourslash/extendArrayInterface.ts | 2 +- .../fourslash/externalModuleIntellisense.ts | 2 +- ...ernceResolutionOrderInImportDeclaration.ts | 4 +- tests/cases/fourslash/forwardReference.ts | 2 +- tests/cases/fourslash/fourslash.ts | 5 +- tests/cases/fourslash/functionTypes.ts | 2 +- .../fourslash/getJavaScriptCompletions20.ts | 2 +- .../fourslash/getJavaScriptQuickInfo8.ts | 4 +- tests/cases/fourslash/javaScriptModules13.ts | 4 +- tests/cases/fourslash/javaScriptModules19.ts | 4 +- tests/cases/fourslash/javaScriptPrototype1.ts | 14 +- .../fourslash/jsDocFunctionSignatures3.ts | 4 +- tests/cases/fourslash/jsDocGenerics1.ts | 6 +- tests/cases/fourslash/jsdocNullableUnion.ts | 6 +- tests/cases/fourslash/lambdaThisMembers.ts | 2 +- .../memberCompletionFromFunctionCall.ts | 4 +- .../fourslash/memberCompletionInForEach1.ts | 8 +- .../memberCompletionOnTypeParameters.ts | 18 +- .../memberCompletionOnTypeParameters2.ts | 4 +- .../fourslash/memberListAfterDoubleDot.ts | 2 +- .../fourslash/memberListAfterSingleDot.ts | 2 +- .../fourslash/memberListErrorRecovery.ts | 2 +- .../fourslash/memberListInFunctionCall.ts | 2 +- .../fourslash/memberListInReopenedEnum.ts | 8 +- .../cases/fourslash/memberListInWithBlock.ts | 2 +- .../cases/fourslash/memberListInWithBlock2.ts | 2 +- .../cases/fourslash/memberListInWithBlock3.ts | 2 +- .../memberListInsideObjectLiterals.ts | 10 +- tests/cases/fourslash/memberListOfClass.ts | 6 +- .../memberListOfEnumFromExternalModule.ts | 2 +- .../fourslash/memberListOfEnumInModule.ts | 4 +- .../fourslash/memberListOfExportedClass.ts | 4 +- tests/cases/fourslash/memberListOfModule.ts | 6 +- .../memberListOfVarInArrowExpression.ts | 2 +- .../fourslash/memberListOnContextualThis.ts | 2 +- .../fourslash/memberListOnExplicitThis.ts | 14 +- .../memberListOnFunctionParameter.ts | 10 +- .../memberListOnThisInClassWithPrivates.ts | 6 +- tests/cases/fourslash/memberlistOnDDot.ts | 2 +- .../quickInfoOnNarrowedTypeInModule.ts | 6 +- .../quickInfoOnObjectLiteralWithAccessors.ts | 4 +- .../quickInfoOnObjectLiteralWithOnlyGetter.ts | 2 +- .../quickInfoOnObjectLiteralWithOnlySetter.ts | 4 +- tests/cases/fourslash/server/completions01.ts | 8 +- .../cases/fourslash/server/jsdocTypedefTag.ts | 36 +- .../server/jsdocTypedefTagNamespace.ts | 10 +- tests/cases/fourslash/tsxCompletion10.ts | 2 +- .../fourslash/tsxCompletionOnClosingTag1.ts | 2 +- .../fourslash/tsxCompletionOnClosingTag2.ts | 4 +- .../tsxCompletionOnClosingTagWithoutJSX1.ts | 2 +- .../tsxCompletionOnClosingTagWithoutJSX2.ts | 4 +- .../tsxCompletionOnOpeningTagWithoutJSX1.ts | 2 +- .../unclosedStringLiteralErrorRecovery.ts | 2 +- 174 files changed, 1235 insertions(+), 1293 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 1486ea2253f..7c7a06db0b6 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -607,23 +607,13 @@ namespace FourSlash { }); } - public verifyMemberListContains(symbol: string, text?: string, documentation?: string, kind?: string) { - const members = this.getMemberListAtCaret(); - if (members) { - this.assertItemInCompletionList(members.entries, symbol, text, documentation, kind); - } - else { - this.raiseError("Expected a member list, but none was provided"); - } - } - - public verifyMemberListCount(expectedCount: number, negative: boolean) { + public verifyCompletionListCount(expectedCount: number, negative: boolean) { if (expectedCount === 0 && negative) { - this.verifyMemberListIsEmpty(/*negative*/ false); + this.verifyCompletionListIsEmpty(/*negative*/ false); return; } - const members = this.getMemberListAtCaret(); + const members = this.getCompletionListAtCaret(); if (members) { const match = members.entries.length === expectedCount; @@ -637,13 +627,6 @@ namespace FourSlash { } } - public verifyMemberListDoesNotContain(symbol: string) { - const members = this.getMemberListAtCaret(); - if (members && members.entries.filter(e => e.name === symbol).length !== 0) { - this.raiseError(`Member list did contain ${symbol}`); - } - } - public verifyCompletionListItemsCountIsGreaterThan(count: number, negative: boolean) { const completions = this.getCompletionListAtCaret(); const itemsCount = completions.entries.length; @@ -685,16 +668,6 @@ namespace FourSlash { } } - public verifyMemberListIsEmpty(negative: boolean) { - const members = this.getMemberListAtCaret(); - if ((!members || members.entries.length === 0) && negative) { - this.raiseError("Member list is empty at Caret"); - } - else if ((members && members.entries.length !== 0) && !negative) { - this.raiseError(`Member list is not empty at Caret:\nMember List contains: ${stringify(members.entries.map(e => e.name))}`); - } - } - public verifyCompletionListIsEmpty(negative: boolean) { const completions = this.getCompletionListAtCaret(); if ((!completions || completions.entries.length === 0) && negative) { @@ -892,10 +865,6 @@ namespace FourSlash { this.raiseError(`verifyReferencesAtPositionListContains failed - could not find the item: ${stringify(missingItem)} in the returned list: (${stringify(references)})`); } - private getMemberListAtCaret() { - return this.languageService.getCompletionsAtPosition(this.activeFile.fileName, this.currentCaretPosition); - } - private getCompletionListAtCaret() { return this.languageService.getCompletionsAtPosition(this.activeFile.fileName, this.currentCaretPosition); } @@ -1353,11 +1322,6 @@ namespace FourSlash { Harness.IO.log(stringify(sigHelp)); } - public printMemberListMembers() { - const members = this.getMemberListAtCaret(); - this.printMembersOrCompletions(members); - } - public printCompletionListMembers() { const completions = this.getCompletionListAtCaret(); this.printMembersOrCompletions(completions); @@ -3061,19 +3025,8 @@ namespace FourSlashInterface { } } - // Verifies the member list contains the specified symbol. The - // member list is brought up if necessary - public memberListContains(symbol: string, text?: string, documentation?: string, kind?: string) { - if (this.negative) { - this.state.verifyMemberListDoesNotContain(symbol); - } - else { - this.state.verifyMemberListContains(symbol, text, documentation, kind); - } - } - - public memberListCount(expectedCount: number) { - this.state.verifyMemberListCount(expectedCount, this.negative); + public completionListCount(expectedCount: number) { + this.state.verifyCompletionListCount(expectedCount, this.negative); } // Verifies the completion list contains the specified symbol. The @@ -3109,10 +3062,6 @@ namespace FourSlashInterface { this.state.verifyCompletionListAllowsNewIdentifier(this.negative); } - public memberListIsEmpty() { - this.state.verifyMemberListIsEmpty(this.negative); - } - public signatureHelpPresent() { this.state.verifySignatureHelpPresent(!this.negative); } @@ -3514,10 +3463,6 @@ namespace FourSlashInterface { this.state.printCurrentSignatureHelp(); } - public printMemberListMembers() { - this.state.printMemberListMembers(); - } - public printCompletionListMembers() { this.state.printCompletionListMembers(); } diff --git a/tests/cases/fourslash/basicClassMembers.ts b/tests/cases/fourslash/basicClassMembers.ts index 1407bf89be3..9fad6731973 100644 --- a/tests/cases/fourslash/basicClassMembers.ts +++ b/tests/cases/fourslash/basicClassMembers.ts @@ -7,6 +7,6 @@ goTo.eof(); edit.insert('t.'); -verify.memberListContains('x'); -verify.memberListContains('y'); -verify.not.memberListContains('z'); +verify.completionListContains('x'); +verify.completionListContains('y'); +verify.not.completionListContains('z'); diff --git a/tests/cases/fourslash/commentsClassMembers.ts b/tests/cases/fourslash/commentsClassMembers.ts index 6edb684caa6..1c34584a262 100644 --- a/tests/cases/fourslash/commentsClassMembers.ts +++ b/tests/cases/fourslash/commentsClassMembers.ts @@ -139,18 +139,18 @@ verify.quickInfos({ }); goTo.marker('4'); -verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); -verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); -verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); -verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); -verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); -verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); -verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", ""); -verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); -verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", ""); -verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); -verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); -verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); +verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); +verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); +verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); +verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); +verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); +verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); +verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", ""); +verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); +verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", ""); +verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); +verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); +verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); goTo.marker('5'); verify.completionListContains("b", "(parameter) b: number", "number to add"); @@ -158,18 +158,18 @@ verify.completionListContains("b", "(parameter) b: number", "number to add"); verify.quickInfoAt("6", "(property) c1.p3: number", "getter property 1\nsetter property 1"); goTo.marker('7'); -verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); -verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); -verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); -verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); -verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); -verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); -verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", ""); -verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); -verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", ""); -verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); -verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); -verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); +verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); +verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); +verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); +verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); +verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); +verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); +verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", ""); +verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); +verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", ""); +verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); +verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); +verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); goTo.marker('8'); verify.currentSignatureHelpDocCommentIs("sum with property"); @@ -177,48 +177,48 @@ verify.currentParameterHelpArgumentDocCommentIs("number to add"); verify.quickInfoAt("8q", "(method) c1.p2(b: number): number", "sum with property"); goTo.marker('9'); -verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); -verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); -verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); -verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); -verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); -verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); -verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", ""); -verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); -verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", ""); -verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); -verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); -verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); +verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); +verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); +verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); +verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); +verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); +verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); +verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", ""); +verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); +verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", ""); +verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); +verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); +verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); verify.quickInfoAt("10", "(property) c1.p3: number", "getter property 1\nsetter property 1"); goTo.marker('11'); -verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); -verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); -verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); -verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); -verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); -verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); -verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", ""); -verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); -verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", ""); -verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); -verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); -verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); +verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); +verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); +verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); +verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); +verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); +verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); +verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", ""); +verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); +verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", ""); +verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); +verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); +verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); goTo.marker('12'); -verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); -verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); -verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); -verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); -verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); -verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); -verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", ""); -verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); -verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", ""); -verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); -verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); -verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); +verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); +verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); +verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); +verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); +verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); +verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); +verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", ""); +verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); +verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", ""); +verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); +verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); +verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); goTo.marker('13'); verify.currentSignatureHelpDocCommentIs("sum with property"); @@ -232,18 +232,18 @@ verify.quickInfos({ }); goTo.marker('16'); -verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); -verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); -verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); -verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); -verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); -verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); -verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", ""); -verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); -verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", ""); -verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); -verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); -verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); +verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); +verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); +verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); +verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); +verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); +verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); +verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", ""); +verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); +verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", ""); +verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); +verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); +verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); goTo.marker('17'); verify.completionListContains("b", "(parameter) b: number", "number to add"); @@ -251,18 +251,18 @@ verify.completionListContains("b", "(parameter) b: number", "number to add"); verify.quickInfoAt("18", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); goTo.marker('19'); -verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); -verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); -verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); -verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); -verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); -verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); -verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", ""); -verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); -verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", ""); -verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); -verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); -verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); +verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); +verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); +verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); +verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); +verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); +verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); +verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", ""); +verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); +verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", ""); +verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); +verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); +verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); goTo.marker('20'); verify.currentSignatureHelpDocCommentIs("sum with property"); @@ -270,48 +270,48 @@ verify.currentParameterHelpArgumentDocCommentIs("number to add"); verify.quickInfoAt("20q", "(method) c1.pp2(b: number): number", "sum with property"); goTo.marker('21'); -verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); -verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); -verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); -verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); -verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); -verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); -verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", ""); -verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); -verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", ""); -verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); -verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); -verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); +verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); +verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); +verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); +verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); +verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); +verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); +verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", ""); +verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); +verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", ""); +verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); +verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); +verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); verify.quickInfoAt("22", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); goTo.marker('23'); -verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); -verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); -verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); -verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); -verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); -verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); -verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", ""); -verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); -verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", ""); -verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); -verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); -verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); +verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); +verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); +verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); +verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); +verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); +verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); +verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", ""); +verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); +verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", ""); +verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); +verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); +verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); goTo.marker('24'); -verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); -verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); -verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); -verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); -verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); -verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); -verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", ""); -verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); -verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", ""); -verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); -verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); -verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); +verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); +verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); +verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); +verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1"); +verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property"); +verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2"); +verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", ""); +verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); +verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", ""); +verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", ""); +verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", ""); +verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", ""); goTo.marker('25'); verify.currentSignatureHelpDocCommentIs("sum with property"); @@ -329,12 +329,12 @@ goTo.marker('29'); verify.completionListContains("c1", "class c1", "This is comment for c1"); goTo.marker('30'); -verify.memberListContains("s1", "(property) c1.s1: number", "s1 is static property of c1"); -verify.memberListContains("s2", "(method) c1.s2(b: number): number", "static sum with property"); -verify.memberListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3"); -verify.memberListContains("nc_s1", "(property) c1.nc_s1: number", ""); -verify.memberListContains("nc_s2", "(method) c1.nc_s2(b: number): number", ""); -verify.memberListContains("nc_s3", "(property) c1.nc_s3: number", ""); +verify.completionListContains("s1", "(property) c1.s1: number", "s1 is static property of c1"); +verify.completionListContains("s2", "(method) c1.s2(b: number): number", "static sum with property"); +verify.completionListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3"); +verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", ""); +verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", ""); +verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", ""); goTo.marker('31'); verify.completionListContains("b", "(parameter) b: number", "number to add"); @@ -345,12 +345,12 @@ goTo.marker('33'); verify.completionListContains("c1", "class c1", "This is comment for c1"); goTo.marker('34'); -verify.memberListContains("s1", "(property) c1.s1: number", "s1 is static property of c1"); -verify.memberListContains("s2", "(method) c1.s2(b: number): number", "static sum with property"); -verify.memberListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3"); -verify.memberListContains("nc_s1", "(property) c1.nc_s1: number", ""); -verify.memberListContains("nc_s2", "(method) c1.nc_s2(b: number): number", ""); -verify.memberListContains("nc_s3", "(property) c1.nc_s3: number", ""); +verify.completionListContains("s1", "(property) c1.s1: number", "s1 is static property of c1"); +verify.completionListContains("s2", "(method) c1.s2(b: number): number", "static sum with property"); +verify.completionListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3"); +verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", ""); +verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", ""); +verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", ""); goTo.marker('35'); verify.currentSignatureHelpDocCommentIs("static sum with property"); @@ -359,12 +359,12 @@ verify.completionListContains("c1", "class c1", "This is comment for c1"); verify.quickInfoAt("35q", "(method) c1.s2(b: number): number", "static sum with property"); goTo.marker('36'); -verify.memberListContains("s1", "(property) c1.s1: number", "s1 is static property of c1"); -verify.memberListContains("s2", "(method) c1.s2(b: number): number", "static sum with property"); -verify.memberListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3"); -verify.memberListContains("nc_s1", "(property) c1.nc_s1: number", ""); -verify.memberListContains("nc_s2", "(method) c1.nc_s2(b: number): number", ""); -verify.memberListContains("nc_s3", "(property) c1.nc_s3: number", ""); +verify.completionListContains("s1", "(property) c1.s1: number", "s1 is static property of c1"); +verify.completionListContains("s2", "(method) c1.s2(b: number): number", "static sum with property"); +verify.completionListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3"); +verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", ""); +verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", ""); +verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", ""); verify.quickInfoAt("37", "(property) c1.s3: number", "static getter property\nsetter property 3"); @@ -372,23 +372,23 @@ goTo.marker('38'); verify.completionListContains("c1", "class c1", "This is comment for c1"); goTo.marker('39'); -verify.memberListContains("s1", "(property) c1.s1: number", "s1 is static property of c1"); -verify.memberListContains("s2", "(method) c1.s2(b: number): number", "static sum with property"); -verify.memberListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3"); -verify.memberListContains("nc_s1", "(property) c1.nc_s1: number", ""); -verify.memberListContains("nc_s2", "(method) c1.nc_s2(b: number): number", ""); -verify.memberListContains("nc_s3", "(property) c1.nc_s3: number", ""); +verify.completionListContains("s1", "(property) c1.s1: number", "s1 is static property of c1"); +verify.completionListContains("s2", "(method) c1.s2(b: number): number", "static sum with property"); +verify.completionListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3"); +verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", ""); +verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", ""); +verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", ""); goTo.marker('40'); verify.completionListContains("c1", "class c1", "This is comment for c1"); goTo.marker('41'); -verify.memberListContains("s1", "(property) c1.s1: number", "s1 is static property of c1"); -verify.memberListContains("s2", "(method) c1.s2(b: number): number", "static sum with property"); -verify.memberListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3"); -verify.memberListContains("nc_s1", "(property) c1.nc_s1: number", ""); -verify.memberListContains("nc_s2", "(method) c1.nc_s2(b: number): number", ""); -verify.memberListContains("nc_s3", "(property) c1.nc_s3: number", ""); +verify.completionListContains("s1", "(property) c1.s1: number", "s1 is static property of c1"); +verify.completionListContains("s2", "(method) c1.s2(b: number): number", "static sum with property"); +verify.completionListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3"); +verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", ""); +verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", ""); +verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", ""); goTo.marker('42'); verify.currentSignatureHelpDocCommentIs("static sum with property"); @@ -477,12 +477,12 @@ verify.quickInfos({ goTo.marker("67"); verify.quickInfoIs("(property) c1.p1: number", "p1 is property of c1"); -verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); -verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); -verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); -verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", ""); -verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); -verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", ""); +verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1"); +verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property"); +verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1"); +verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", ""); +verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", ""); +verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", ""); verify.quickInfos({ 68: "var i1_f: (b: number) => number", @@ -526,12 +526,12 @@ verify.completionListContains("c1", "class c1", "This is comment for c1"); goTo.marker('88'); verify.quickInfoIs("(property) c1.s1: number", "s1 is static property of c1"); -verify.memberListContains("s1", "(property) c1.s1: number", "s1 is static property of c1"); -verify.memberListContains("s2", "(method) c1.s2(b: number): number", "static sum with property"); -verify.memberListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3"); -verify.memberListContains("nc_s1", "(property) c1.nc_s1: number", ""); -verify.memberListContains("nc_s2", "(method) c1.nc_s2(b: number): number", ""); -verify.memberListContains("nc_s3", "(property) c1.nc_s3: number", ""); +verify.completionListContains("s1", "(property) c1.s1: number", "s1 is static property of c1"); +verify.completionListContains("s2", "(method) c1.s2(b: number): number", "static sum with property"); +verify.completionListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3"); +verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", ""); +verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", ""); +verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", ""); verify.quickInfos({ 89: "var i1_s_f: (b: number) => number", @@ -593,10 +593,10 @@ verify.completionListContains("i1_c", "var i1_c: typeof c1", ""); goTo.marker('110'); verify.quickInfoIs("(property) cProperties.p2: number", "setter only property"); -verify.memberListContains("p1", "(property) cProperties.p1: number", "getter only property"); -verify.memberListContains("p2", "(property) cProperties.p2: number", "setter only property"); -verify.memberListContains("nc_p1", "(property) cProperties.nc_p1: number", ""); -verify.memberListContains("nc_p2", "(property) cProperties.nc_p2: number", ""); +verify.completionListContains("p1", "(property) cProperties.p1: number", "getter only property"); +verify.completionListContains("p2", "(property) cProperties.p2: number", "setter only property"); +verify.completionListContains("nc_p1", "(property) cProperties.nc_p1: number", ""); +verify.completionListContains("nc_p2", "(property) cProperties.nc_p2: number", ""); verify.quickInfos({ 111: ["(property) cProperties.p1: number", "getter only property"], @@ -605,7 +605,7 @@ verify.quickInfos({ }); goTo.marker('114'); -verify.memberListContains("a", "(property) cWithConstructorProperty.a: number", "this is first parameter a\nmore info about a"); +verify.completionListContains("a", "(property) cWithConstructorProperty.a: number", "this is first parameter a\nmore info about a"); verify.quickInfoIs("(property) cWithConstructorProperty.a: number", "this is first parameter a\nmore info about a"); goTo.marker('115'); diff --git a/tests/cases/fourslash/commentsEnums.ts b/tests/cases/fourslash/commentsEnums.ts index 048c99c6e0c..bf0bc087372 100644 --- a/tests/cases/fourslash/commentsEnums.ts +++ b/tests/cases/fourslash/commentsEnums.ts @@ -22,11 +22,11 @@ verify.completionListContains("Colors", "enum Colors", "Enum of colors"); verify.quickInfoIs("enum Colors", "Enum of colors"); goTo.marker('6'); -verify.memberListContains("Cornflower", "(enum member) Colors.Cornflower = 0", "Fancy name for 'blue'"); -verify.memberListContains("FancyPink", "(enum member) Colors.FancyPink = 1", "Fancy name for 'pink'"); +verify.completionListContains("Cornflower", "(enum member) Colors.Cornflower = 0", "Fancy name for 'blue'"); +verify.completionListContains("FancyPink", "(enum member) Colors.FancyPink = 1", "Fancy name for 'pink'"); verify.quickInfoIs("(enum member) Colors.Cornflower = 0", "Fancy name for 'blue'"); goTo.marker('7'); -verify.memberListContains("Cornflower", "(enum member) Colors.Cornflower = 0", "Fancy name for 'blue'"); -verify.memberListContains("FancyPink", "(enum member) Colors.FancyPink = 1", "Fancy name for 'pink'"); +verify.completionListContains("Cornflower", "(enum member) Colors.Cornflower = 0", "Fancy name for 'blue'"); +verify.completionListContains("FancyPink", "(enum member) Colors.FancyPink = 1", "Fancy name for 'pink'"); verify.quickInfoIs("(enum member) Colors.FancyPink = 1", "Fancy name for 'pink'"); \ No newline at end of file diff --git a/tests/cases/fourslash/commentsExternalModules.ts b/tests/cases/fourslash/commentsExternalModules.ts index d9773716369..4f1a82bc0ce 100644 --- a/tests/cases/fourslash/commentsExternalModules.ts +++ b/tests/cases/fourslash/commentsExternalModules.ts @@ -46,9 +46,9 @@ goTo.marker('4'); verify.completionListContains("m1", "namespace m1", "Namespace comment"); goTo.marker('5'); -verify.memberListContains("b", "var m1.b: number", "b's comment"); -verify.memberListContains("fooExport", "function m1.fooExport(): number", "exported function"); -verify.memberListContains("m2", "namespace m1.m2"); +verify.completionListContains("b", "var m1.b: number", "b's comment"); +verify.completionListContains("fooExport", "function m1.fooExport(): number", "exported function"); +verify.completionListContains("m2", "namespace m1.m2"); goTo.marker('6'); verify.currentSignatureHelpDocCommentIs("exported function"); @@ -57,8 +57,8 @@ verify.quickInfoAt("6q", "function m1.fooExport(): number", "exported function") verify.quickInfoAt("7", "var myvar: m1.m2.c"); goTo.marker('8'); -verify.memberListContains("c", "constructor m1.m2.c(): m1.m2.c", ""); -verify.memberListContains("i", "var m1.m2.i: m1.m2.c", "i"); +verify.completionListContains("c", "constructor m1.m2.c(): m1.m2.c", ""); +verify.completionListContains("i", "var m1.m2.i: m1.m2.c", "i"); goTo.file("commentsExternalModules_file1.ts"); verify.quickInfoAt("9", 'import extMod = require("./commentsExternalModules_file0")', "This is on import declaration"); @@ -67,12 +67,12 @@ goTo.marker('10'); verify.completionListContains("extMod", 'import extMod = require("./commentsExternalModules_file0")', "This is on import declaration"); goTo.marker('11'); -verify.memberListContains("m1", "namespace extMod.m1"); +verify.completionListContains("m1", "namespace extMod.m1"); goTo.marker('12'); -verify.memberListContains("b", "var extMod.m1.b: number", "b's comment"); -verify.memberListContains("fooExport", "function extMod.m1.fooExport(): number", "exported function"); -verify.memberListContains("m2", "namespace extMod.m1.m2"); +verify.completionListContains("b", "var extMod.m1.b: number", "b's comment"); +verify.completionListContains("fooExport", "function extMod.m1.fooExport(): number", "exported function"); +verify.completionListContains("m2", "namespace extMod.m1.m2"); goTo.marker('13'); verify.currentSignatureHelpDocCommentIs("exported function"); @@ -81,5 +81,5 @@ verify.quickInfoAt("13q", "function extMod.m1.fooExport(): number", "exported fu verify.quickInfoAt("14", "var newVar: extMod.m1.m2.c"); goTo.marker('15'); -verify.memberListContains("c", "constructor extMod.m1.m2.c(): extMod.m1.m2.c", ""); -verify.memberListContains("i", "var extMod.m1.m2.i: extMod.m1.m2.c", "i"); +verify.completionListContains("c", "constructor extMod.m1.m2.c(): extMod.m1.m2.c", ""); +verify.completionListContains("i", "var extMod.m1.m2.i: extMod.m1.m2.c", "i"); diff --git a/tests/cases/fourslash/commentsImportDeclaration.ts b/tests/cases/fourslash/commentsImportDeclaration.ts index 76f2c64a51d..cda983a9e5a 100644 --- a/tests/cases/fourslash/commentsImportDeclaration.ts +++ b/tests/cases/fourslash/commentsImportDeclaration.ts @@ -30,12 +30,12 @@ verify.quickInfos({ }); goTo.marker('6'); -verify.memberListContains("m1", "namespace extMod.m1"); +verify.completionListContains("m1", "namespace extMod.m1"); goTo.marker('7'); -verify.memberListContains("b", "var extMod.m1.b: number", "b's comment"); -verify.memberListContains("fooExport", "function extMod.m1.fooExport(): number", "exported function"); -verify.memberListContains("m2", "namespace extMod.m1.m2"); +verify.completionListContains("b", "var extMod.m1.b: number", "b's comment"); +verify.completionListContains("fooExport", "function extMod.m1.fooExport(): number", "exported function"); +verify.completionListContains("m2", "namespace extMod.m1.m2"); goTo.marker('8'); verify.currentSignatureHelpDocCommentIs("exported function"); @@ -45,5 +45,5 @@ verify.quickInfos({ }); goTo.marker('10'); -verify.memberListContains("c", "constructor extMod.m1.m2.c(): extMod.m1.m2.c", ""); -verify.memberListContains("i", "var extMod.m1.m2.i: extMod.m1.m2.c", "i"); +verify.completionListContains("c", "constructor extMod.m1.m2.c(): extMod.m1.m2.c", ""); +verify.completionListContains("i", "var extMod.m1.m2.i: extMod.m1.m2.c", "i"); diff --git a/tests/cases/fourslash/commentsInheritance.ts b/tests/cases/fourslash/commentsInheritance.ts index fd7aa12e805..6e3e92cfcff 100644 --- a/tests/cases/fourslash/commentsInheritance.ts +++ b/tests/cases/fourslash/commentsInheritance.ts @@ -221,18 +221,18 @@ ////} goTo.marker('1'); -verify.memberListContains("i1_p1", "(property) i1.i1_p1: number", "i1_p1"); -verify.memberListContains("i1_f1", "(method) i1.i1_f1(): void", "i1_f1"); -verify.memberListContains("i1_l1", "(property) i1.i1_l1: () => void", ""); -verify.memberListContains("i1_nc_p1", "(property) i1.i1_nc_p1: number", ""); -verify.memberListContains("i1_nc_f1", "(method) i1.i1_nc_f1(): void", ""); -verify.memberListContains("i1_nc_l1", "(property) i1.i1_nc_l1: () => void", ""); -verify.memberListContains("p1", "(property) i1.p1: number", ""); -verify.memberListContains("f1", "(method) i1.f1(): void", ""); -verify.memberListContains("l1", "(property) i1.l1: () => void", ""); -verify.memberListContains("nc_p1", "(property) i1.nc_p1: number", ""); -verify.memberListContains("nc_f1", "(method) i1.nc_f1(): void", ""); -verify.memberListContains("nc_l1", "(property) i1.nc_l1: () => void", ""); +verify.completionListContains("i1_p1", "(property) i1.i1_p1: number", "i1_p1"); +verify.completionListContains("i1_f1", "(method) i1.i1_f1(): void", "i1_f1"); +verify.completionListContains("i1_l1", "(property) i1.i1_l1: () => void", ""); +verify.completionListContains("i1_nc_p1", "(property) i1.i1_nc_p1: number", ""); +verify.completionListContains("i1_nc_f1", "(method) i1.i1_nc_f1(): void", ""); +verify.completionListContains("i1_nc_l1", "(property) i1.i1_nc_l1: () => void", ""); +verify.completionListContains("p1", "(property) i1.p1: number", ""); +verify.completionListContains("f1", "(method) i1.f1(): void", ""); +verify.completionListContains("l1", "(property) i1.l1: () => void", ""); +verify.completionListContains("nc_p1", "(property) i1.nc_p1: number", ""); +verify.completionListContains("nc_f1", "(method) i1.nc_f1(): void", ""); +verify.completionListContains("nc_l1", "(property) i1.nc_l1: () => void", ""); goTo.marker('2'); verify.currentSignatureHelpDocCommentIs("i1_f1"); goTo.marker('3'); @@ -263,18 +263,18 @@ verify.quickInfos({ }); goTo.marker('6'); -verify.memberListContains("i1_p1", "(property) c1.i1_p1: number", ""); -verify.memberListContains("i1_f1", "(method) c1.i1_f1(): void", ""); -verify.memberListContains("i1_l1", "(property) c1.i1_l1: () => void", ""); -verify.memberListContains("i1_nc_p1", "(property) c1.i1_nc_p1: number", ""); -verify.memberListContains("i1_nc_f1", "(method) c1.i1_nc_f1(): void", ""); -verify.memberListContains("i1_nc_l1", "(property) c1.i1_nc_l1: () => void", ""); -verify.memberListContains("p1", "(property) c1.p1: number", "c1_p1"); -verify.memberListContains("f1", "(method) c1.f1(): void", "c1_f1"); -verify.memberListContains("l1", "(property) c1.l1: () => void", ""); -verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "c1_nc_p1"); -verify.memberListContains("nc_f1", "(method) c1.nc_f1(): void", "c1_nc_f1"); -verify.memberListContains("nc_l1", "(property) c1.nc_l1: () => void", ""); +verify.completionListContains("i1_p1", "(property) c1.i1_p1: number", ""); +verify.completionListContains("i1_f1", "(method) c1.i1_f1(): void", ""); +verify.completionListContains("i1_l1", "(property) c1.i1_l1: () => void", ""); +verify.completionListContains("i1_nc_p1", "(property) c1.i1_nc_p1: number", ""); +verify.completionListContains("i1_nc_f1", "(method) c1.i1_nc_f1(): void", ""); +verify.completionListContains("i1_nc_l1", "(property) c1.i1_nc_l1: () => void", ""); +verify.completionListContains("p1", "(property) c1.p1: number", "c1_p1"); +verify.completionListContains("f1", "(method) c1.f1(): void", "c1_f1"); +verify.completionListContains("l1", "(property) c1.l1: () => void", ""); +verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "c1_nc_p1"); +verify.completionListContains("nc_f1", "(method) c1.nc_f1(): void", "c1_nc_f1"); +verify.completionListContains("nc_l1", "(property) c1.nc_l1: () => void", ""); goTo.marker('7'); verify.currentSignatureHelpDocCommentIs(""); goTo.marker('8'); @@ -305,18 +305,18 @@ verify.quickInfos({ }); goTo.marker('11'); -verify.memberListContains("i1_p1", "(property) i1.i1_p1: number", "i1_p1"); -verify.memberListContains("i1_f1", "(method) i1.i1_f1(): void", "i1_f1"); -verify.memberListContains("i1_l1", "(property) i1.i1_l1: () => void", ""); -verify.memberListContains("i1_nc_p1", "(property) i1.i1_nc_p1: number", ""); -verify.memberListContains("i1_nc_f1", "(method) i1.i1_nc_f1(): void", ""); -verify.memberListContains("i1_nc_l1", "(property) i1.i1_nc_l1: () => void", ""); -verify.memberListContains("p1", "(property) i1.p1: number", ""); -verify.memberListContains("f1", "(method) i1.f1(): void", ""); -verify.memberListContains("l1", "(property) i1.l1: () => void", ""); -verify.memberListContains("nc_p1", "(property) i1.nc_p1: number", ""); -verify.memberListContains("nc_f1", "(method) i1.nc_f1(): void", ""); -verify.memberListContains("nc_l1", "(property) i1.nc_l1: () => void", ""); +verify.completionListContains("i1_p1", "(property) i1.i1_p1: number", "i1_p1"); +verify.completionListContains("i1_f1", "(method) i1.i1_f1(): void", "i1_f1"); +verify.completionListContains("i1_l1", "(property) i1.i1_l1: () => void", ""); +verify.completionListContains("i1_nc_p1", "(property) i1.i1_nc_p1: number", ""); +verify.completionListContains("i1_nc_f1", "(method) i1.i1_nc_f1(): void", ""); +verify.completionListContains("i1_nc_l1", "(property) i1.i1_nc_l1: () => void", ""); +verify.completionListContains("p1", "(property) i1.p1: number", ""); +verify.completionListContains("f1", "(method) i1.f1(): void", ""); +verify.completionListContains("l1", "(property) i1.l1: () => void", ""); +verify.completionListContains("nc_p1", "(property) i1.nc_p1: number", ""); +verify.completionListContains("nc_f1", "(method) i1.nc_f1(): void", ""); +verify.completionListContains("nc_l1", "(property) i1.nc_l1: () => void", ""); goTo.marker('12'); verify.currentSignatureHelpDocCommentIs("i1_f1"); goTo.marker('13'); @@ -376,18 +376,18 @@ verify.quickInfos({ }); goTo.marker('19'); -verify.memberListContains("c2_p1", "(property) c2.c2_p1: number", "c2 c2_p1"); -verify.memberListContains("c2_f1", "(method) c2.c2_f1(): void", "c2 c2_f1"); -verify.memberListContains("c2_prop", "(property) c2.c2_prop: number", "c2 c2_prop"); -verify.memberListContains("c2_nc_p1", "(property) c2.c2_nc_p1: number", ""); -verify.memberListContains("c2_nc_f1", "(method) c2.c2_nc_f1(): void", ""); -verify.memberListContains("c2_nc_prop", "(property) c2.c2_nc_prop: number", ""); -verify.memberListContains("p1", "(property) c2.p1: number", "c2 p1"); -verify.memberListContains("f1", "(method) c2.f1(): void", "c2 f1"); -verify.memberListContains("prop", "(property) c2.prop: number", "c2 prop"); -verify.memberListContains("nc_p1", "(property) c2.nc_p1: number", ""); -verify.memberListContains("nc_f1", "(method) c2.nc_f1(): void", ""); -verify.memberListContains("nc_prop", "(property) c2.nc_prop: number", ""); +verify.completionListContains("c2_p1", "(property) c2.c2_p1: number", "c2 c2_p1"); +verify.completionListContains("c2_f1", "(method) c2.c2_f1(): void", "c2 c2_f1"); +verify.completionListContains("c2_prop", "(property) c2.c2_prop: number", "c2 c2_prop"); +verify.completionListContains("c2_nc_p1", "(property) c2.c2_nc_p1: number", ""); +verify.completionListContains("c2_nc_f1", "(method) c2.c2_nc_f1(): void", ""); +verify.completionListContains("c2_nc_prop", "(property) c2.c2_nc_prop: number", ""); +verify.completionListContains("p1", "(property) c2.p1: number", "c2 p1"); +verify.completionListContains("f1", "(method) c2.f1(): void", "c2 f1"); +verify.completionListContains("prop", "(property) c2.prop: number", "c2 prop"); +verify.completionListContains("nc_p1", "(property) c2.nc_p1: number", ""); +verify.completionListContains("nc_f1", "(method) c2.nc_f1(): void", ""); +verify.completionListContains("nc_prop", "(property) c2.nc_prop: number", ""); goTo.marker('20'); verify.currentSignatureHelpDocCommentIs("c2 c2_f1"); goTo.marker('21'); @@ -405,18 +405,18 @@ verify.quickInfos({ }); goTo.marker('24'); -verify.memberListContains("c2_p1", "(property) c2.c2_p1: number", "c2 c2_p1"); -verify.memberListContains("c2_f1", "(method) c2.c2_f1(): void", "c2 c2_f1"); -verify.memberListContains("c2_prop", "(property) c2.c2_prop: number", "c2 c2_prop"); -verify.memberListContains("c2_nc_p1", "(property) c2.c2_nc_p1: number", ""); -verify.memberListContains("c2_nc_f1", "(method) c2.c2_nc_f1(): void", ""); -verify.memberListContains("c2_nc_prop", "(property) c2.c2_nc_prop: number", ""); -verify.memberListContains("p1", "(property) c3.p1: number", "c3 p1"); -verify.memberListContains("f1", "(method) c3.f1(): void", "c3 f1"); -verify.memberListContains("prop", "(property) c3.prop: number", "c3 prop"); -verify.memberListContains("nc_p1", "(property) c3.nc_p1: number", ""); -verify.memberListContains("nc_f1", "(method) c3.nc_f1(): void", ""); -verify.memberListContains("nc_prop", "(property) c3.nc_prop: number", ""); +verify.completionListContains("c2_p1", "(property) c2.c2_p1: number", "c2 c2_p1"); +verify.completionListContains("c2_f1", "(method) c2.c2_f1(): void", "c2 c2_f1"); +verify.completionListContains("c2_prop", "(property) c2.c2_prop: number", "c2 c2_prop"); +verify.completionListContains("c2_nc_p1", "(property) c2.c2_nc_p1: number", ""); +verify.completionListContains("c2_nc_f1", "(method) c2.c2_nc_f1(): void", ""); +verify.completionListContains("c2_nc_prop", "(property) c2.c2_nc_prop: number", ""); +verify.completionListContains("p1", "(property) c3.p1: number", "c3 p1"); +verify.completionListContains("f1", "(method) c3.f1(): void", "c3 f1"); +verify.completionListContains("prop", "(property) c3.prop: number", "c3 prop"); +verify.completionListContains("nc_p1", "(property) c3.nc_p1: number", ""); +verify.completionListContains("nc_f1", "(method) c3.nc_f1(): void", ""); +verify.completionListContains("nc_prop", "(property) c3.nc_prop: number", ""); goTo.marker('25'); verify.currentSignatureHelpDocCommentIs("c2 c2_f1"); goTo.marker('26'); @@ -434,18 +434,18 @@ verify.quickInfos({ }); goTo.marker('29'); -verify.memberListContains("c2_p1", "(property) c2.c2_p1: number", "c2 c2_p1"); -verify.memberListContains("c2_f1", "(method) c2.c2_f1(): void", "c2 c2_f1"); -verify.memberListContains("c2_prop", "(property) c2.c2_prop: number", "c2 c2_prop"); -verify.memberListContains("c2_nc_p1", "(property) c2.c2_nc_p1: number", ""); -verify.memberListContains("c2_nc_f1", "(method) c2.c2_nc_f1(): void", ""); -verify.memberListContains("c2_nc_prop", "(property) c2.c2_nc_prop: number"); -verify.memberListContains("p1", "(property) c2.p1: number", "c2 p1"); -verify.memberListContains("f1", "(method) c2.f1(): void", "c2 f1"); -verify.memberListContains("prop", "(property) c2.prop: number", "c2 prop"); -verify.memberListContains("nc_p1", "(property) c2.nc_p1: number", ""); -verify.memberListContains("nc_f1", "(method) c2.nc_f1(): void", ""); -verify.memberListContains("nc_prop", "(property) c2.nc_prop: number", ""); +verify.completionListContains("c2_p1", "(property) c2.c2_p1: number", "c2 c2_p1"); +verify.completionListContains("c2_f1", "(method) c2.c2_f1(): void", "c2 c2_f1"); +verify.completionListContains("c2_prop", "(property) c2.c2_prop: number", "c2 c2_prop"); +verify.completionListContains("c2_nc_p1", "(property) c2.c2_nc_p1: number", ""); +verify.completionListContains("c2_nc_f1", "(method) c2.c2_nc_f1(): void", ""); +verify.completionListContains("c2_nc_prop", "(property) c2.c2_nc_prop: number"); +verify.completionListContains("p1", "(property) c2.p1: number", "c2 p1"); +verify.completionListContains("f1", "(method) c2.f1(): void", "c2 f1"); +verify.completionListContains("prop", "(property) c2.prop: number", "c2 prop"); +verify.completionListContains("nc_p1", "(property) c2.nc_p1: number", ""); +verify.completionListContains("nc_f1", "(method) c2.nc_f1(): void", ""); +verify.completionListContains("nc_prop", "(property) c2.nc_prop: number", ""); goTo.marker('30'); verify.currentSignatureHelpDocCommentIs("c2 c2_f1"); goTo.marker('31'); @@ -478,18 +478,18 @@ verify.completionListContains("c4", "class c4", ""); verify.completionListContains("c4_i", "var c4_i: c4", ""); goTo.marker('36'); -verify.memberListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1"); -verify.memberListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1"); -verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", ""); -verify.memberListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", ""); -verify.memberListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", ""); -verify.memberListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", ""); -verify.memberListContains("p1", "(property) i2.p1: number", "i2 p1"); -verify.memberListContains("f1", "(method) i2.f1(): void", "i2 f1"); -verify.memberListContains("l1", "(property) i2.l1: () => void", ""); -verify.memberListContains("nc_p1", "(property) i2.nc_p1: number", ""); -verify.memberListContains("nc_f1", "(method) i2.nc_f1(): void", ""); -verify.memberListContains("nc_l1", "(property) i2.nc_l1: () => void", ""); +verify.completionListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1"); +verify.completionListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1"); +verify.completionListContains("i2_l1", "(property) i2.i2_l1: () => void", ""); +verify.completionListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", ""); +verify.completionListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", ""); +verify.completionListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", ""); +verify.completionListContains("p1", "(property) i2.p1: number", "i2 p1"); +verify.completionListContains("f1", "(method) i2.f1(): void", "i2 f1"); +verify.completionListContains("l1", "(property) i2.l1: () => void", ""); +verify.completionListContains("nc_p1", "(property) i2.nc_p1: number", ""); +verify.completionListContains("nc_f1", "(method) i2.nc_f1(): void", ""); +verify.completionListContains("nc_l1", "(property) i2.nc_l1: () => void", ""); goTo.marker('37'); verify.currentSignatureHelpDocCommentIs("i2_f1"); goTo.marker('38'); @@ -521,18 +521,18 @@ verify.quickInfos({ }); goTo.marker('41'); -verify.memberListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1"); -verify.memberListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1"); -verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", ""); -verify.memberListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", ""); -verify.memberListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", ""); -verify.memberListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", ""); -verify.memberListContains("p1", "(property) i3.p1: number", "i3 p1"); -verify.memberListContains("f1", "(method) i3.f1(): void", "i3 f1"); -verify.memberListContains("l1", "(property) i3.l1: () => void", ""); -verify.memberListContains("nc_p1", "(property) i3.nc_p1: number", ""); -verify.memberListContains("nc_f1", "(method) i3.nc_f1(): void", ""); -verify.memberListContains("nc_l1", "(property) i3.nc_l1: () => void", ""); +verify.completionListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1"); +verify.completionListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1"); +verify.completionListContains("i2_l1", "(property) i2.i2_l1: () => void", ""); +verify.completionListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", ""); +verify.completionListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", ""); +verify.completionListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", ""); +verify.completionListContains("p1", "(property) i3.p1: number", "i3 p1"); +verify.completionListContains("f1", "(method) i3.f1(): void", "i3 f1"); +verify.completionListContains("l1", "(property) i3.l1: () => void", ""); +verify.completionListContains("nc_p1", "(property) i3.nc_p1: number", ""); +verify.completionListContains("nc_f1", "(method) i3.nc_f1(): void", ""); +verify.completionListContains("nc_l1", "(property) i3.nc_l1: () => void", ""); goTo.marker('42'); verify.currentSignatureHelpDocCommentIs("i2_f1"); goTo.marker('43'); @@ -562,18 +562,18 @@ verify.quickInfos({ }); goTo.marker('46'); -verify.memberListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1"); -verify.memberListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1"); -verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", ""); -verify.memberListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", ""); -verify.memberListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", ""); -verify.memberListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", ""); -verify.memberListContains("p1", "(property) i2.p1: number", "i2 p1"); -verify.memberListContains("f1", "(method) i2.f1(): void", "i2 f1"); -verify.memberListContains("l1", "(property) i2.l1: () => void", ""); -verify.memberListContains("nc_p1", "(property) i2.nc_p1: number", ""); -verify.memberListContains("nc_f1", "(method) i2.nc_f1(): void", ""); -verify.memberListContains("nc_l1", "(property) i2.nc_l1: () => void", ""); +verify.completionListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1"); +verify.completionListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1"); +verify.completionListContains("i2_l1", "(property) i2.i2_l1: () => void", ""); +verify.completionListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", ""); +verify.completionListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", ""); +verify.completionListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", ""); +verify.completionListContains("p1", "(property) i2.p1: number", "i2 p1"); +verify.completionListContains("f1", "(method) i2.f1(): void", "i2 f1"); +verify.completionListContains("l1", "(property) i2.l1: () => void", ""); +verify.completionListContains("nc_p1", "(property) i2.nc_p1: number", ""); +verify.completionListContains("nc_f1", "(method) i2.nc_f1(): void", ""); +verify.completionListContains("nc_l1", "(property) i2.nc_l1: () => void", ""); goTo.marker('47'); verify.currentSignatureHelpDocCommentIs("i2_f1"); goTo.marker('48'); diff --git a/tests/cases/fourslash/commentsInterface.ts b/tests/cases/fourslash/commentsInterface.ts index 49928f0d086..472798fa8e1 100644 --- a/tests/cases/fourslash/commentsInterface.ts +++ b/tests/cases/fourslash/commentsInterface.ts @@ -80,12 +80,12 @@ verify.quickInfos({ goTo.marker('8'); verify.quickInfoIs("(property) i2.x: number", "this is x"); -verify.memberListContains("x", "(property) i2.x: number", "this is x"); -verify.memberListContains("foo", "(property) i2.foo: (b: number) => string", "this is foo"); -verify.memberListContains("nc_x", "(property) i2.nc_x: number", ""); -verify.memberListContains("nc_foo", "(property) i2.nc_foo: (b: number) => string", ""); -verify.memberListContains("fnfoo", "(method) i2.fnfoo(b: number): string", "this is fnfoo"); -verify.memberListContains("nc_fnfoo", "(method) i2.nc_fnfoo(b: number): string", ""); +verify.completionListContains("x", "(property) i2.x: number", "this is x"); +verify.completionListContains("foo", "(property) i2.foo: (b: number) => string", "this is foo"); +verify.completionListContains("nc_x", "(property) i2.nc_x: number", ""); +verify.completionListContains("nc_foo", "(property) i2.nc_foo: (b: number) => string", ""); +verify.completionListContains("fnfoo", "(method) i2.fnfoo(b: number): string", "this is fnfoo"); +verify.completionListContains("nc_fnfoo", "(method) i2.nc_fnfoo(b: number): string", ""); verify.quickInfos({ 9: "var i2_i_foo: (b: number) => string", @@ -199,12 +199,12 @@ verify.completionListContains("i3_i", "var i3_i: i3", ""); goTo.marker('41'); verify.quickInfoIs("(method) i3.f(a: number): string", "Function i3 f"); -verify.memberListContains("f", "(method) i3.f(a: number): string", "Function i3 f"); -verify.memberListContains("l", "(property) i3.l: (b: number) => string", ""); -verify.memberListContains("x", "(property) i3.x: number", "Comment i3 x"); -verify.memberListContains("nc_f", "(method) i3.nc_f(a: number): string", ""); -verify.memberListContains("nc_l", "(property) i3.nc_l: (b: number) => string", ""); -verify.memberListContains("nc_x", "(property) i3.nc_x: number", ""); +verify.completionListContains("f", "(method) i3.f(a: number): string", "Function i3 f"); +verify.completionListContains("l", "(property) i3.l: (b: number) => string", ""); +verify.completionListContains("x", "(property) i3.x: number", "Comment i3 x"); +verify.completionListContains("nc_f", "(method) i3.nc_f(a: number): string", ""); +verify.completionListContains("nc_l", "(property) i3.nc_l: (b: number) => string", ""); +verify.completionListContains("nc_x", "(property) i3.nc_x: number", ""); goTo.marker('42'); verify.currentSignatureHelpDocCommentIs("Function i3 f"); diff --git a/tests/cases/fourslash/commentsModules.ts b/tests/cases/fourslash/commentsModules.ts index 5f9457d81f4..c0b8ccc5731 100644 --- a/tests/cases/fourslash/commentsModules.ts +++ b/tests/cases/fourslash/commentsModules.ts @@ -110,9 +110,9 @@ goTo.marker('4'); verify.completionListContains("m1", "namespace m1", "Namespace comment"); goTo.marker('5'); -verify.memberListContains("b", "var m1.b: number", "b's comment"); -verify.memberListContains("fooExport", "function m1.fooExport(): number", "exported function"); -verify.memberListContains("m2", "namespace m1.m2"); +verify.completionListContains("b", "var m1.b: number", "b's comment"); +verify.completionListContains("fooExport", "function m1.fooExport(): number", "exported function"); +verify.completionListContains("m2", "namespace m1.m2"); verify.quickInfoIs("function m1.fooExport(): number", "exported function"); goTo.marker('6'); @@ -122,55 +122,55 @@ verify.quickInfoAt("7", "var myvar: m1.m2.c"); goTo.marker('8'); verify.quickInfoIs("constructor m1.m2.c(): m1.m2.c"); -verify.memberListContains("c", "constructor m1.m2.c(): m1.m2.c", ""); -verify.memberListContains("i", "var m1.m2.i: m1.m2.c", "i"); +verify.completionListContains("c", "constructor m1.m2.c(): m1.m2.c", ""); +verify.completionListContains("i", "var m1.m2.i: m1.m2.c", "i"); goTo.marker('9'); verify.completionListContains("m2", "namespace m2", "namespace comment of m2.m3"); verify.quickInfoIs("namespace m2", "namespace comment of m2.m3"); goTo.marker('10'); -verify.memberListContains("m3", "namespace m2.m3"); +verify.completionListContains("m3", "namespace m2.m3"); verify.quickInfoIs("namespace m2.m3", "namespace comment of m2.m3"); goTo.marker('11'); verify.quickInfoIs("constructor m2.m3.c(): m2.m3.c"); -verify.memberListContains("c", "constructor m2.m3.c(): m2.m3.c", ""); +verify.completionListContains("c", "constructor m2.m3.c(): m2.m3.c", ""); goTo.marker('12'); verify.completionListContains("m3", "namespace m3", "namespace comment of m3.m4.m5"); verify.quickInfoIs("namespace m3", "namespace comment of m3.m4.m5"); goTo.marker('13'); -verify.memberListContains("m4", "namespace m3.m4", "namespace comment of m3.m4.m5"); +verify.completionListContains("m4", "namespace m3.m4", "namespace comment of m3.m4.m5"); verify.quickInfoIs("namespace m3.m4", "namespace comment of m3.m4.m5"); goTo.marker('14'); -verify.memberListContains("m5", "namespace m3.m4.m5"); +verify.completionListContains("m5", "namespace m3.m4.m5"); verify.quickInfoIs("namespace m3.m4.m5", "namespace comment of m3.m4.m5"); goTo.marker('15'); verify.quickInfoIs("constructor m3.m4.m5.c(): m3.m4.m5.c"); -verify.memberListContains("c", "constructor m3.m4.m5.c(): m3.m4.m5.c", ""); +verify.completionListContains("c", "constructor m3.m4.m5.c(): m3.m4.m5.c", ""); goTo.marker('16'); verify.completionListContains("m4", "namespace m4", "namespace comment of m4.m5.m6"); verify.quickInfoIs("namespace m4", "namespace comment of m4.m5.m6"); goTo.marker('17'); -verify.memberListContains("m5", "namespace m4.m5", "namespace comment of m4.m5.m6"); +verify.completionListContains("m5", "namespace m4.m5", "namespace comment of m4.m5.m6"); verify.quickInfoIs("namespace m4.m5", "namespace comment of m4.m5.m6"); goTo.marker('18'); -verify.memberListContains("m6", "namespace m4.m5.m6"); +verify.completionListContains("m6", "namespace m4.m5.m6"); verify.quickInfoIs("namespace m4.m5.m6", "namespace comment of m4.m5.m6"); goTo.marker('19'); -verify.memberListContains("m7", "namespace m4.m5.m6.m7"); +verify.completionListContains("m7", "namespace m4.m5.m6.m7"); verify.quickInfoIs("namespace m4.m5.m6.m7"); goTo.marker('20'); -verify.memberListContains("c", "constructor m4.m5.m6.m7.c(): m4.m5.m6.m7.c", ""); +verify.completionListContains("c", "constructor m4.m5.m6.m7.c(): m4.m5.m6.m7.c", ""); verify.quickInfoIs("constructor m4.m5.m6.m7.c(): m4.m5.m6.m7.c"); goTo.marker('21'); @@ -178,19 +178,19 @@ verify.completionListContains("m5", "namespace m5"); verify.quickInfoIs("namespace m5", "namespace comment of m5.m6.m7"); goTo.marker('22'); -verify.memberListContains("m6", "namespace m5.m6"); +verify.completionListContains("m6", "namespace m5.m6"); verify.quickInfoIs("namespace m5.m6", "namespace comment of m5.m6.m7"); goTo.marker('23'); -verify.memberListContains("m7", "namespace m5.m6.m7"); +verify.completionListContains("m7", "namespace m5.m6.m7"); verify.quickInfoIs("namespace m5.m6.m7", "namespace comment of m5.m6.m7"); goTo.marker('24'); -verify.memberListContains("m8", "namespace m5.m6.m7.m8"); +verify.completionListContains("m8", "namespace m5.m6.m7.m8"); verify.quickInfoIs("namespace m5.m6.m7.m8", "namespace m8 comment"); goTo.marker('25'); -verify.memberListContains("c", "constructor m5.m6.m7.m8.c(): m5.m6.m7.m8.c", ""); +verify.completionListContains("c", "constructor m5.m6.m7.m8.c(): m5.m6.m7.m8.c", ""); verify.quickInfoIs("constructor m5.m6.m7.m8.c(): m5.m6.m7.m8.c"); goTo.marker('26'); @@ -198,15 +198,15 @@ verify.completionListContains("m6", "namespace m6"); verify.quickInfoIs("namespace m6"); goTo.marker('27'); -verify.memberListContains("m7", "namespace m6.m7"); +verify.completionListContains("m7", "namespace m6.m7"); verify.quickInfoIs("namespace m6.m7"); goTo.marker('28'); -verify.memberListContains("m8", "namespace m6.m7.m8"); +verify.completionListContains("m8", "namespace m6.m7.m8"); verify.quickInfoIs("namespace m6.m7.m8"); goTo.marker('29'); -verify.memberListContains("c", "constructor m6.m7.m8.c(): m6.m7.m8.c", ""); +verify.completionListContains("c", "constructor m6.m7.m8.c(): m6.m7.m8.c", ""); verify.quickInfoIs("constructor m6.m7.m8.c(): m6.m7.m8.c"); goTo.marker('30'); @@ -214,15 +214,15 @@ verify.completionListContains("m7", "namespace m7"); verify.quickInfoIs("namespace m7"); goTo.marker('31'); -verify.memberListContains("m8", "namespace m7.m8"); +verify.completionListContains("m8", "namespace m7.m8"); verify.quickInfoIs("namespace m7.m8"); goTo.marker('32'); -verify.memberListContains("m9", "namespace m7.m8.m9"); +verify.completionListContains("m9", "namespace m7.m8.m9"); verify.quickInfoIs("namespace m7.m8.m9", "namespace m9 comment"); goTo.marker('33'); -verify.memberListContains("c", "constructor m7.m8.m9.c(): m7.m8.m9.c", ""); +verify.completionListContains("c", "constructor m7.m8.m9.c(): m7.m8.m9.c", ""); verify.quickInfoIs("constructor m7.m8.m9.c(): m7.m8.m9.c"); goTo.marker('34'); diff --git a/tests/cases/fourslash/commentsOverloads.ts b/tests/cases/fourslash/commentsOverloads.ts index 5cc03aa842a..ec4a63349f9 100644 --- a/tests/cases/fourslash/commentsOverloads.ts +++ b/tests/cases/fourslash/commentsOverloads.ts @@ -326,10 +326,10 @@ goTo.marker('22q'); verify.quickInfoAt("22q", "var i1_i: i1(b: string) => number (+1 overload)", "this is signature 2"); goTo.marker('23'); -verify.memberListContains('foo', '(method) i1.foo(a: number): number (+1 overload)', 'foo 1'); -verify.memberListContains('foo2', '(method) i1.foo2(a: number): number (+1 overload)', ''); -verify.memberListContains('foo3', '(method) i1.foo3(a: number): number (+1 overload)', ''); -verify.memberListContains('foo4', '(method) i1.foo4(a: number): number (+1 overload)', 'foo4 1'); +verify.completionListContains('foo', '(method) i1.foo(a: number): number (+1 overload)', 'foo 1'); +verify.completionListContains('foo2', '(method) i1.foo2(a: number): number (+1 overload)', ''); +verify.completionListContains('foo3', '(method) i1.foo3(a: number): number (+1 overload)', ''); +verify.completionListContains('foo4', '(method) i1.foo4(a: number): number (+1 overload)', 'foo4 1'); goTo.marker('24'); verify.currentSignatureHelpDocCommentIs("foo 1"); @@ -432,11 +432,11 @@ verify.currentParameterHelpArgumentDocCommentIs(""); verify.quickInfoAt("43q", "var i4_i: i4(b: string) => number (+1 overload)"); goTo.marker('44'); -verify.memberListContains('prop1', '(method) c.prop1(a: number): number (+1 overload)', ''); -verify.memberListContains('prop2', '(method) c.prop2(a: number): number (+1 overload)', 'prop2 1'); -verify.memberListContains('prop3', '(method) c.prop3(a: number): number (+1 overload)', ''); -verify.memberListContains('prop4', '(method) c.prop4(a: number): number (+1 overload)', 'prop4 1'); -verify.memberListContains('prop5', '(method) c.prop5(a: number): number (+1 overload)', 'prop5 1'); +verify.completionListContains('prop1', '(method) c.prop1(a: number): number (+1 overload)', ''); +verify.completionListContains('prop2', '(method) c.prop2(a: number): number (+1 overload)', 'prop2 1'); +verify.completionListContains('prop3', '(method) c.prop3(a: number): number (+1 overload)', ''); +verify.completionListContains('prop4', '(method) c.prop4(a: number): number (+1 overload)', 'prop4 1'); +verify.completionListContains('prop5', '(method) c.prop5(a: number): number (+1 overload)', 'prop5 1'); goTo.marker('45'); verify.currentSignatureHelpDocCommentIs(""); diff --git a/tests/cases/fourslash/completionEntryForUnionProperty.ts b/tests/cases/fourslash/completionEntryForUnionProperty.ts index bc0f9405a1b..0ffc184693c 100644 --- a/tests/cases/fourslash/completionEntryForUnionProperty.ts +++ b/tests/cases/fourslash/completionEntryForUnionProperty.ts @@ -15,6 +15,6 @@ ////x./**/ goTo.marker(); -verify.memberListContains("commonProperty", "(property) commonProperty: string | number"); -verify.memberListContains("commonFunction", "(method) commonFunction(): number"); -verify.memberListCount(2); \ No newline at end of file +verify.completionListContains("commonProperty", "(property) commonProperty: string | number"); +verify.completionListContains("commonFunction", "(method) commonFunction(): number"); +verify.completionListCount(2); \ No newline at end of file diff --git a/tests/cases/fourslash/completionEntryForUnionProperty2.ts b/tests/cases/fourslash/completionEntryForUnionProperty2.ts index c2d7bc406a5..604052ff1b5 100644 --- a/tests/cases/fourslash/completionEntryForUnionProperty2.ts +++ b/tests/cases/fourslash/completionEntryForUnionProperty2.ts @@ -15,6 +15,6 @@ ////x.commonProperty./**/ goTo.marker(); -verify.memberListContains("toString", "(method) toString(): string"); -verify.memberListContains("valueOf", "(method) valueOf(): string | number"); -verify.memberListCount(2); \ No newline at end of file +verify.completionListContains("toString", "(method) toString(): string"); +verify.completionListContains("valueOf", "(method) valueOf(): string | number"); +verify.completionListCount(2); \ No newline at end of file diff --git a/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment1.ts b/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment1.ts index 7faebc1474b..15f5901113b 100644 --- a/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment1.ts +++ b/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment1.ts @@ -16,9 +16,9 @@ goTo.marker('0'); verify.completionListContains("jspm"); verify.completionListAllowsNewIdentifier(); -verify.memberListCount(1); +verify.completionListCount(1); goTo.marker('1'); verify.completionListContains("jspm:dev"); verify.completionListAllowsNewIdentifier(); -verify.memberListCount(4); +verify.completionListCount(4); diff --git a/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment2.ts b/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment2.ts index 4ba88e7dd2a..1d20b57e2a1 100644 --- a/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment2.ts +++ b/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment2.ts @@ -22,9 +22,9 @@ goTo.marker('0'); verify.completionListContains("jspm"); verify.completionListAllowsNewIdentifier(); -verify.memberListCount(1); +verify.completionListCount(1); goTo.marker('1'); verify.completionListContains("jspm:dev"); verify.completionListAllowsNewIdentifier(); -verify.memberListCount(4); +verify.completionListCount(4); diff --git a/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment3.ts b/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment3.ts index 238606520e3..764011d90c1 100644 --- a/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment3.ts +++ b/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment3.ts @@ -18,9 +18,9 @@ goTo.marker('0'); verify.completionListContains("jspm"); verify.completionListAllowsNewIdentifier(); -verify.memberListCount(1); +verify.completionListCount(1); goTo.marker('1'); verify.completionListContains("jspm:browser"); verify.completionListAllowsNewIdentifier(); -verify.memberListCount(2); +verify.completionListCount(2); diff --git a/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment4.ts b/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment4.ts index 9855bb8c502..e785a1a7657 100644 --- a/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment4.ts +++ b/tests/cases/fourslash/completionForQuotedPropertyInPropertyAssignment4.ts @@ -16,9 +16,9 @@ goTo.marker('0'); verify.completionListContains("jspm"); verify.completionListAllowsNewIdentifier(); -verify.memberListCount(1); +verify.completionListCount(1); goTo.marker('1'); verify.completionListContains("jspm:dev"); verify.completionListAllowsNewIdentifier(); -verify.memberListCount(4); +verify.completionListCount(4); diff --git a/tests/cases/fourslash/completionForStringLiteral.ts b/tests/cases/fourslash/completionForStringLiteral.ts index cdbe1589f73..7a14f6b6519 100644 --- a/tests/cases/fourslash/completionForStringLiteral.ts +++ b/tests/cases/fourslash/completionForStringLiteral.ts @@ -8,8 +8,8 @@ goTo.marker('1'); verify.completionListContains("Option 1"); -verify.memberListCount(3); +verify.completionListCount(3); goTo.marker('2'); verify.completionListContains("Option 2"); -verify.memberListCount(3); +verify.completionListCount(3); diff --git a/tests/cases/fourslash/completionForStringLiteral2.ts b/tests/cases/fourslash/completionForStringLiteral2.ts index 6f0768d6c6b..9b00208c729 100644 --- a/tests/cases/fourslash/completionForStringLiteral2.ts +++ b/tests/cases/fourslash/completionForStringLiteral2.ts @@ -12,9 +12,9 @@ goTo.marker('1'); verify.completionListContains("foo"); verify.completionListAllowsNewIdentifier(); -verify.memberListCount(3); +verify.completionListCount(3); goTo.marker('2'); verify.completionListContains("some other name"); verify.completionListAllowsNewIdentifier(); -verify.memberListCount(3); +verify.completionListCount(3); diff --git a/tests/cases/fourslash/completionForStringLiteral3.ts b/tests/cases/fourslash/completionForStringLiteral3.ts index 8c1a7cab2ed..238ba74b4d8 100644 --- a/tests/cases/fourslash/completionForStringLiteral3.ts +++ b/tests/cases/fourslash/completionForStringLiteral3.ts @@ -12,9 +12,9 @@ goTo.marker('1'); verify.completionListContains("A"); verify.completionListAllowsNewIdentifier(); -verify.memberListCount(3); +verify.completionListCount(3); goTo.marker('2'); verify.completionListContains("A"); verify.completionListAllowsNewIdentifier(); -verify.memberListCount(3); +verify.completionListCount(3); diff --git a/tests/cases/fourslash/completionForStringLiteral4.ts b/tests/cases/fourslash/completionForStringLiteral4.ts index 11ae699eab8..5629926bd18 100644 --- a/tests/cases/fourslash/completionForStringLiteral4.ts +++ b/tests/cases/fourslash/completionForStringLiteral4.ts @@ -20,4 +20,4 @@ verify.quickInfoIs('function f(p1: "literal", p2: "literal", p3: "other1" | "oth goTo.marker('2'); verify.completionListContains("other1"); verify.completionListContains("other2"); -verify.memberListCount(2); +verify.completionListCount(2); diff --git a/tests/cases/fourslash/completionListAfterAnyType.ts b/tests/cases/fourslash/completionListAfterAnyType.ts index 7ab945e14cc..f7222675a0f 100644 --- a/tests/cases/fourslash/completionListAfterAnyType.ts +++ b/tests/cases/fourslash/completionListAfterAnyType.ts @@ -9,5 +9,5 @@ //// } goTo.marker(); -verify.memberListContains("charAt"); -verify.memberListCount(1); +verify.completionListContains("charAt"); +verify.completionListCount(1); diff --git a/tests/cases/fourslash/completionListAfterInvalidCharacter.ts b/tests/cases/fourslash/completionListAfterInvalidCharacter.ts index d5512e60bf7..ece28e5e3a0 100644 --- a/tests/cases/fourslash/completionListAfterInvalidCharacter.ts +++ b/tests/cases/fourslash/completionListAfterInvalidCharacter.ts @@ -8,4 +8,4 @@ ////testModule./**/ goTo.marker(); -verify.memberListContains("foo"); +verify.completionListContains("foo"); diff --git a/tests/cases/fourslash/completionListAfterObjectLiteral1.ts b/tests/cases/fourslash/completionListAfterObjectLiteral1.ts index f761aad2495..7296ce057b4 100644 --- a/tests/cases/fourslash/completionListAfterObjectLiteral1.ts +++ b/tests/cases/fourslash/completionListAfterObjectLiteral1.ts @@ -3,5 +3,5 @@ ////var v = { x: 4, y: 3 }./**/ goTo.marker(); -verify.not.memberListContains('a'); -verify.memberListContains('x'); \ No newline at end of file +verify.not.completionListContains('a'); +verify.completionListContains('x'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAfterRegularExpressionLiteral01.ts b/tests/cases/fourslash/completionListAfterRegularExpressionLiteral01.ts index ac8568d13f5..759a3f9c2a4 100644 --- a/tests/cases/fourslash/completionListAfterRegularExpressionLiteral01.ts +++ b/tests/cases/fourslash/completionListAfterRegularExpressionLiteral01.ts @@ -4,5 +4,5 @@ /////a/./**/ goTo.marker(); -verify.not.memberListContains('v'); -verify.memberListContains('compile'); \ No newline at end of file +verify.not.completionListContains('v'); +verify.completionListContains('compile'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAfterRegularExpressionLiteral1.ts b/tests/cases/fourslash/completionListAfterRegularExpressionLiteral1.ts index 558b4d1e791..465c676c714 100644 --- a/tests/cases/fourslash/completionListAfterRegularExpressionLiteral1.ts +++ b/tests/cases/fourslash/completionListAfterRegularExpressionLiteral1.ts @@ -3,5 +3,5 @@ /////a/./**/ goTo.marker(); -verify.not.memberListContains('alert'); -verify.memberListContains('compile'); \ No newline at end of file +verify.not.completionListContains('alert'); +verify.completionListContains('compile'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAfterStringLiteral1.ts b/tests/cases/fourslash/completionListAfterStringLiteral1.ts index 1391b3ae80d..533b428cdf5 100644 --- a/tests/cases/fourslash/completionListAfterStringLiteral1.ts +++ b/tests/cases/fourslash/completionListAfterStringLiteral1.ts @@ -3,5 +3,5 @@ ////"a"./**/ goTo.marker(); -verify.not.memberListContains('alert'); -verify.memberListContains('charAt'); \ No newline at end of file +verify.not.completionListContains('alert'); +verify.completionListContains('charAt'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAndMemberListOnCommentedDot.ts b/tests/cases/fourslash/completionListAndMemberListOnCommentedDot.ts index c3ee033bf54..d0517d87279 100644 --- a/tests/cases/fourslash/completionListAndMemberListOnCommentedDot.ts +++ b/tests/cases/fourslash/completionListAndMemberListOnCommentedDot.ts @@ -15,4 +15,4 @@ goTo.marker(); verify.completionListIsEmpty(); -verify.memberListIsEmpty(); \ No newline at end of file +verify.completionListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAndMemberListOnCommentedWhiteSpace.ts b/tests/cases/fourslash/completionListAndMemberListOnCommentedWhiteSpace.ts index f0287a0baea..a40c68e8b15 100644 --- a/tests/cases/fourslash/completionListAndMemberListOnCommentedWhiteSpace.ts +++ b/tests/cases/fourslash/completionListAndMemberListOnCommentedWhiteSpace.ts @@ -15,4 +15,4 @@ goTo.marker(); verify.completionListIsEmpty(); -verify.memberListIsEmpty(); \ No newline at end of file +verify.completionListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAtEOF1.ts b/tests/cases/fourslash/completionListAtEOF1.ts index 1e903119462..3a7cfe95316 100644 --- a/tests/cases/fourslash/completionListAtEOF1.ts +++ b/tests/cases/fourslash/completionListAtEOF1.ts @@ -3,4 +3,4 @@ //// if(0 === ''. goTo.eof(); -verify.memberListContains("charAt"); +verify.completionListContains("charAt"); diff --git a/tests/cases/fourslash/completionListAtEOF2.ts b/tests/cases/fourslash/completionListAtEOF2.ts index d83d29ab599..8ba6a9d8e65 100644 --- a/tests/cases/fourslash/completionListAtEOF2.ts +++ b/tests/cases/fourslash/completionListAtEOF2.ts @@ -8,4 +8,4 @@ ////var p = = new .length: number", /*docComments*/ undefined, /*kind*/ "property"); -verify.memberListContains('toString', "(method) Array.toString(): string", /*docComments*/ undefined, /*kind*/ "method"); +verify.completionListContains('length', "(property) Array.length: number", /*docComments*/ undefined, /*kind*/ "property"); +verify.completionListContains('toString', "(method) Array.toString(): string", /*docComments*/ undefined, /*kind*/ "method"); diff --git a/tests/cases/fourslash/completionListOfSplitInterface.ts b/tests/cases/fourslash/completionListOfSplitInterface.ts index 61eae0da072..9bc635d8f8b 100644 --- a/tests/cases/fourslash/completionListOfSplitInterface.ts +++ b/tests/cases/fourslash/completionListOfSplitInterface.ts @@ -33,18 +33,18 @@ ////ci1./*2*/b; goTo.marker('1'); -verify.memberListCount(6); -verify.memberListContains("a"); -verify.memberListContains("b"); -verify.memberListContains("c"); -verify.memberListContains("i1"); -verify.memberListContains("i2"); -verify.memberListContains("i3"); +verify.completionListCount(6); +verify.completionListContains("a"); +verify.completionListContains("b"); +verify.completionListContains("c"); +verify.completionListContains("i1"); +verify.completionListContains("i2"); +verify.completionListContains("i3"); goTo.marker('2'); -verify.memberListCount(5); -verify.memberListContains("a"); -verify.memberListContains("b"); -verify.memberListContains("b1"); -verify.memberListContains("i11"); -verify.memberListContains("i12"); +verify.completionListCount(5); +verify.completionListContains("a"); +verify.completionListContains("b"); +verify.completionListContains("b1"); +verify.completionListContains("i11"); +verify.completionListContains("i12"); diff --git a/tests/cases/fourslash/completionListOnAliases.ts b/tests/cases/fourslash/completionListOnAliases.ts index 3d9026c3036..c15e5284c06 100644 --- a/tests/cases/fourslash/completionListOnAliases.ts +++ b/tests/cases/fourslash/completionListOnAliases.ts @@ -9,7 +9,7 @@ ////} goTo.marker("1"); -verify.memberListContains("x", "import x = M", undefined); +verify.completionListContains("x", "import x = M", undefined); goTo.marker("2"); -verify.memberListContains("value"); +verify.completionListContains("value"); diff --git a/tests/cases/fourslash/completionListOnAliases2.ts b/tests/cases/fourslash/completionListOnAliases2.ts index 6a74f3a525b..7ff50a1a2b5 100644 --- a/tests/cases/fourslash/completionListOnAliases2.ts +++ b/tests/cases/fourslash/completionListOnAliases2.ts @@ -35,40 +35,40 @@ // Module m goTo.marker("1"); -verify.memberListContains("I"); -verify.memberListContains("C"); -verify.memberListContains("E"); -verify.memberListContains("N"); -verify.memberListContains("V"); -verify.memberListContains("F"); -verify.memberListContains("A"); +verify.completionListContains("I"); +verify.completionListContains("C"); +verify.completionListContains("E"); +verify.completionListContains("N"); +verify.completionListContains("V"); +verify.completionListContains("F"); +verify.completionListContains("A"); // Class C goTo.marker("2"); -verify.memberListContains("property"); +verify.completionListContains("property"); // Enum E goTo.marker("3"); -verify.memberListContains("value"); +verify.completionListContains("value"); // Module N goTo.marker("4"); -verify.memberListContains("v"); +verify.completionListContains("v"); // var V goTo.marker("5"); -verify.memberListContains("toFixed"); +verify.completionListContains("toFixed"); // function F goTo.marker("6"); -verify.memberListContains("call"); +verify.completionListContains("call"); // alias a goTo.marker("7"); -verify.memberListContains("I"); -verify.memberListContains("C"); -verify.memberListContains("E"); -verify.memberListContains("N"); -verify.memberListContains("V"); -verify.memberListContains("F"); -verify.memberListContains("A"); +verify.completionListContains("I"); +verify.completionListContains("C"); +verify.completionListContains("E"); +verify.completionListContains("N"); +verify.completionListContains("V"); +verify.completionListContains("F"); +verify.completionListContains("A"); diff --git a/tests/cases/fourslash/completionListOnAliases3.ts b/tests/cases/fourslash/completionListOnAliases3.ts index 8c5194af968..3eab00e2ed9 100644 --- a/tests/cases/fourslash/completionListOnAliases3.ts +++ b/tests/cases/fourslash/completionListOnAliases3.ts @@ -10,4 +10,4 @@ // Q does not show up in member list of x goTo.marker("1"); -verify.memberListContains("Q"); +verify.completionListContains("Q"); diff --git a/tests/cases/fourslash/completionListOnFunctionCallWithOptionalArgument.ts b/tests/cases/fourslash/completionListOnFunctionCallWithOptionalArgument.ts index 9cab9589406..cec7bf87aec 100644 --- a/tests/cases/fourslash/completionListOnFunctionCallWithOptionalArgument.ts +++ b/tests/cases/fourslash/completionListOnFunctionCallWithOptionalArgument.ts @@ -4,4 +4,4 @@ //// Foo(function () { } )./**/; goTo.marker(); -verify.memberListContains('q'); +verify.completionListContains('q'); diff --git a/tests/cases/fourslash/completionListOnParam.ts b/tests/cases/fourslash/completionListOnParam.ts index 8b686535927..ad2bbcde1b8 100644 --- a/tests/cases/fourslash/completionListOnParam.ts +++ b/tests/cases/fourslash/completionListOnParam.ts @@ -9,4 +9,4 @@ ////} goTo.marker(); -verify.memberListContains('Blah'); \ No newline at end of file +verify.completionListContains('Blah'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListOnParamOfGenericType1.ts b/tests/cases/fourslash/completionListOnParamOfGenericType1.ts index 1b0fdba8ff8..c55b48bf7e9 100644 --- a/tests/cases/fourslash/completionListOnParamOfGenericType1.ts +++ b/tests/cases/fourslash/completionListOnParamOfGenericType1.ts @@ -9,14 +9,14 @@ ////} goTo.marker('1'); -verify.memberListContains('next'); -verify.memberListContains('prev'); -verify.memberListContains('pushEntry'); +verify.completionListContains('next'); +verify.completionListContains('prev'); +verify.completionListContains('pushEntry'); edit.insert('next.'); -verify.memberListContains('next'); -verify.memberListContains('prev'); -verify.memberListContains('pushEntry'); +verify.completionListContains('next'); +verify.completionListContains('prev'); +verify.completionListContains('pushEntry'); edit.insert('prev.'); -verify.memberListContains('next'); -verify.memberListContains('prev'); -verify.memberListContains('pushEntry'); +verify.completionListContains('next'); +verify.completionListContains('prev'); +verify.completionListContains('pushEntry'); diff --git a/tests/cases/fourslash/completionListOnSuper.ts b/tests/cases/fourslash/completionListOnSuper.ts index 3ca997cf1bb..2b3c0ef75fa 100644 --- a/tests/cases/fourslash/completionListOnSuper.ts +++ b/tests/cases/fourslash/completionListOnSuper.ts @@ -17,6 +17,6 @@ ////} goTo.marker(); -verify.memberListContains('foo'); -verify.memberListContains('bar'); -verify.memberListCount(2); +verify.completionListContains('foo'); +verify.completionListContains('bar'); +verify.completionListCount(2); diff --git a/tests/cases/fourslash/completionListOnVarBetweenModules.ts b/tests/cases/fourslash/completionListOnVarBetweenModules.ts index 6f907e5f75b..b0205e3428c 100644 --- a/tests/cases/fourslash/completionListOnVarBetweenModules.ts +++ b/tests/cases/fourslash/completionListOnVarBetweenModules.ts @@ -13,5 +13,5 @@ ////} goTo.marker(); -verify.memberListContains("C1"); -verify.memberListContains("C2"); +verify.completionListContains("C1"); +verify.completionListContains("C2"); diff --git a/tests/cases/fourslash/completionListPrimitives.ts b/tests/cases/fourslash/completionListPrimitives.ts index fd1d0670f2e..21a34659c4e 100644 --- a/tests/cases/fourslash/completionListPrimitives.ts +++ b/tests/cases/fourslash/completionListPrimitives.ts @@ -3,10 +3,10 @@ /////**/ goTo.marker(); -verify.memberListContains("any"); -verify.memberListContains("boolean"); -verify.memberListContains("null"); -verify.memberListContains("number"); -verify.memberListContains("string"); -verify.memberListContains("undefined"); -verify.memberListContains("void"); \ No newline at end of file +verify.completionListContains("any"); +verify.completionListContains("boolean"); +verify.completionListContains("null"); +verify.completionListContains("number"); +verify.completionListContains("string"); +verify.completionListContains("undefined"); +verify.completionListContains("void"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListPrivateMembers.ts b/tests/cases/fourslash/completionListPrivateMembers.ts index 772491a391e..e5e494d521d 100644 --- a/tests/cases/fourslash/completionListPrivateMembers.ts +++ b/tests/cases/fourslash/completionListPrivateMembers.ts @@ -13,5 +13,5 @@ goTo.marker(); -verify.memberListContains("y"); -verify.not.memberListContains("x"); +verify.completionListContains("y"); +verify.not.completionListContains("x"); diff --git a/tests/cases/fourslash/completionListPrivateMembers2.ts b/tests/cases/fourslash/completionListPrivateMembers2.ts index 1b19d042cbe..1a04df1d823 100644 --- a/tests/cases/fourslash/completionListPrivateMembers2.ts +++ b/tests/cases/fourslash/completionListPrivateMembers2.ts @@ -9,9 +9,9 @@ ////f./*2*/ goTo.marker("1"); -verify.memberListContains("y"); -verify.memberListContains("x"); +verify.completionListContains("y"); +verify.completionListContains("x"); goTo.marker("2"); -verify.not.memberListContains("x"); -verify.not.memberListContains("y"); \ No newline at end of file +verify.not.completionListContains("x"); +verify.not.completionListContains("y"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListPrivateMembers3.ts b/tests/cases/fourslash/completionListPrivateMembers3.ts index 69f7456d7b5..999ab8fa5e6 100644 --- a/tests/cases/fourslash/completionListPrivateMembers3.ts +++ b/tests/cases/fourslash/completionListPrivateMembers3.ts @@ -19,13 +19,13 @@ ////} goTo.marker("1"); -verify.memberListContains("p"); -verify.memberListCount(1); +verify.completionListContains("p"); +verify.completionListCount(1); goTo.marker("2"); -verify.memberListContains("p"); -verify.memberListCount(1); +verify.completionListContains("p"); +verify.completionListCount(1); goTo.marker("2"); -verify.memberListContains("p"); -verify.memberListCount(1); +verify.completionListContains("p"); +verify.completionListCount(1); diff --git a/tests/cases/fourslash/completionListProtectedMembers.ts b/tests/cases/fourslash/completionListProtectedMembers.ts index 4715a9fb714..20cb990405d 100644 --- a/tests/cases/fourslash/completionListProtectedMembers.ts +++ b/tests/cases/fourslash/completionListProtectedMembers.ts @@ -19,26 +19,26 @@ ////f./*5*/ goTo.marker("1"); -verify.memberListContains("y"); -verify.memberListContains("x"); -verify.not.memberListContains("z"); +verify.completionListContains("y"); +verify.completionListContains("x"); +verify.not.completionListContains("z"); goTo.marker("2"); -verify.memberListContains("y"); -verify.memberListContains("x"); -verify.memberListContains("z"); +verify.completionListContains("y"); +verify.completionListContains("x"); +verify.completionListContains("z"); goTo.marker("3"); -verify.memberListContains("y"); -verify.memberListContains("x"); -verify.not.memberListContains("z"); +verify.completionListContains("y"); +verify.completionListContains("x"); +verify.not.completionListContains("z"); goTo.marker("4"); -verify.memberListContains("y"); -verify.memberListContains("x"); -verify.memberListContains("z"); +verify.completionListContains("y"); +verify.completionListContains("x"); +verify.completionListContains("z"); goTo.marker("5"); -verify.not.memberListContains("x"); -verify.not.memberListContains("y"); -verify.not.memberListContains("z"); +verify.not.completionListContains("x"); +verify.not.completionListContains("y"); +verify.not.completionListContains("z"); diff --git a/tests/cases/fourslash/completionListStaticProtectedMembers.ts b/tests/cases/fourslash/completionListStaticProtectedMembers.ts index d72859570aa..ae79387fbe7 100644 --- a/tests/cases/fourslash/completionListStaticProtectedMembers.ts +++ b/tests/cases/fourslash/completionListStaticProtectedMembers.ts @@ -28,32 +28,32 @@ // Same class, everything is visible goTo.marker("1"); -verify.memberListContains('privateMethod'); -verify.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); +verify.completionListContains('privateMethod'); +verify.completionListContains('privateProperty'); +verify.completionListContains('protectedMethod'); +verify.completionListContains('protectedProperty'); +verify.completionListContains('publicMethod'); +verify.completionListContains('publicProperty'); +verify.completionListContains('protectedOverriddenMethod'); +verify.completionListContains('protectedOverriddenProperty'); goTo.marker("2"); -verify.memberListContains('privateMethod'); -verify.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); +verify.completionListContains('privateMethod'); +verify.completionListContains('privateProperty'); +verify.completionListContains('protectedMethod'); +verify.completionListContains('protectedProperty'); +verify.completionListContains('publicMethod'); +verify.completionListContains('publicProperty'); +verify.completionListContains('protectedOverriddenMethod'); +verify.completionListContains('protectedOverriddenProperty'); // Can not access protected properties overridden in subclass goTo.marker("3"); -verify.memberListContains('privateMethod'); -verify.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.not.memberListContains('protectedOverriddenMethod'); -verify.not.memberListContains('protectedOverriddenProperty'); \ No newline at end of file +verify.completionListContains('privateMethod'); +verify.completionListContains('privateProperty'); +verify.completionListContains('protectedMethod'); +verify.completionListContains('protectedProperty'); +verify.completionListContains('publicMethod'); +verify.completionListContains('publicProperty'); +verify.not.completionListContains('protectedOverriddenMethod'); +verify.not.completionListContains('protectedOverriddenProperty'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListStaticProtectedMembers2.ts b/tests/cases/fourslash/completionListStaticProtectedMembers2.ts index 44cf9f73fd5..c6c64c5c6eb 100644 --- a/tests/cases/fourslash/completionListStaticProtectedMembers2.ts +++ b/tests/cases/fourslash/completionListStaticProtectedMembers2.ts @@ -29,42 +29,42 @@ // Same class, everything is visible goTo.marker("1"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); +verify.not.completionListContains('privateMethod'); +verify.not.completionListContains('privateProperty'); +verify.completionListContains('protectedMethod'); +verify.completionListContains('protectedProperty'); +verify.completionListContains('publicMethod'); +verify.completionListContains('publicProperty'); +verify.completionListContains('protectedOverriddenMethod'); +verify.completionListContains('protectedOverriddenProperty'); goTo.marker("2"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); +verify.not.completionListContains('privateMethod'); +verify.not.completionListContains('privateProperty'); +verify.completionListContains('protectedMethod'); +verify.completionListContains('protectedProperty'); +verify.completionListContains('publicMethod'); +verify.completionListContains('publicProperty'); +verify.completionListContains('protectedOverriddenMethod'); +verify.completionListContains('protectedOverriddenProperty'); goTo.marker("3"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); +verify.not.completionListContains('privateMethod'); +verify.not.completionListContains('privateProperty'); +verify.completionListContains('protectedMethod'); +verify.completionListContains('protectedProperty'); +verify.completionListContains('publicMethod'); +verify.completionListContains('publicProperty'); +verify.completionListContains('protectedOverriddenMethod'); +verify.completionListContains('protectedOverriddenProperty'); // only public and protected methods of the base class are accessible through super goTo.marker("4"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.not.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.not.memberListContains('protectedOverriddenProperty'); \ No newline at end of file +verify.not.completionListContains('privateMethod'); +verify.not.completionListContains('privateProperty'); +verify.completionListContains('protectedMethod'); +verify.not.completionListContains('protectedProperty'); +verify.completionListContains('publicMethod'); +verify.not.completionListContains('publicProperty'); +verify.completionListContains('protectedOverriddenMethod'); +verify.not.completionListContains('protectedOverriddenProperty'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListStaticProtectedMembers3.ts b/tests/cases/fourslash/completionListStaticProtectedMembers3.ts index c955f23fa32..0cb916c181f 100644 --- a/tests/cases/fourslash/completionListStaticProtectedMembers3.ts +++ b/tests/cases/fourslash/completionListStaticProtectedMembers3.ts @@ -25,21 +25,21 @@ // Only public properties are visible outside the class goTo.marker("1"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.not.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.not.memberListContains('protectedOverriddenMethod'); -verify.not.memberListContains('protectedOverriddenProperty'); +verify.not.completionListContains('privateMethod'); +verify.not.completionListContains('privateProperty'); +verify.not.completionListContains('protectedMethod'); +verify.not.completionListContains('protectedProperty'); +verify.completionListContains('publicMethod'); +verify.completionListContains('publicProperty'); +verify.not.completionListContains('protectedOverriddenMethod'); +verify.not.completionListContains('protectedOverriddenProperty'); goTo.marker("2"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.not.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.not.memberListContains('protectedOverriddenMethod'); -verify.not.memberListContains('protectedOverriddenProperty'); \ No newline at end of file +verify.not.completionListContains('privateMethod'); +verify.not.completionListContains('privateProperty'); +verify.not.completionListContains('protectedMethod'); +verify.not.completionListContains('protectedProperty'); +verify.completionListContains('publicMethod'); +verify.completionListContains('publicProperty'); +verify.not.completionListContains('protectedOverriddenMethod'); +verify.not.completionListContains('protectedOverriddenProperty'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListStaticProtectedMembers4.ts b/tests/cases/fourslash/completionListStaticProtectedMembers4.ts index 817d2c4829c..14c460d6873 100644 --- a/tests/cases/fourslash/completionListStaticProtectedMembers4.ts +++ b/tests/cases/fourslash/completionListStaticProtectedMembers4.ts @@ -28,22 +28,22 @@ // Sub class, everything but private is visible goTo.marker("1"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); +verify.not.completionListContains('privateMethod'); +verify.not.completionListContains('privateProperty'); +verify.completionListContains('protectedMethod'); +verify.completionListContains('protectedProperty'); +verify.completionListContains('publicMethod'); +verify.completionListContains('publicProperty'); +verify.completionListContains('protectedOverriddenMethod'); +verify.completionListContains('protectedOverriddenProperty'); // Can see protected methods elevated to public goTo.marker("2"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.not.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); +verify.not.completionListContains('privateMethod'); +verify.not.completionListContains('privateProperty'); +verify.not.completionListContains('protectedMethod'); +verify.not.completionListContains('protectedProperty'); +verify.completionListContains('publicMethod'); +verify.completionListContains('publicProperty'); +verify.completionListContains('protectedOverriddenMethod'); +verify.completionListContains('protectedOverriddenProperty'); diff --git a/tests/cases/fourslash/completionListSuperMembers.ts b/tests/cases/fourslash/completionListSuperMembers.ts index 6c7ddd5c7b3..ae6195601a3 100644 --- a/tests/cases/fourslash/completionListSuperMembers.ts +++ b/tests/cases/fourslash/completionListSuperMembers.ts @@ -25,11 +25,11 @@ goTo.marker(); -verify.not.memberListContains("publicProperty"); -verify.memberListContains("publicInstanceMethod"); +verify.not.completionListContains("publicProperty"); +verify.completionListContains("publicInstanceMethod"); // No statics -verify.not.memberListContains("publicStaticProperty"); -verify.not.memberListContains("publicStaticMethod"); +verify.not.completionListContains("publicStaticProperty"); +verify.not.completionListContains("publicStaticMethod"); // No privates -verify.not.memberListContains("privateProperty"); -verify.not.memberListContains("privateInstanceMethod"); \ No newline at end of file +verify.not.completionListContains("privateProperty"); +verify.not.completionListContains("privateInstanceMethod"); \ No newline at end of file diff --git a/tests/cases/fourslash/exportEqualTypes.ts b/tests/cases/fourslash/exportEqualTypes.ts index 1b8593893dd..b03e21b5f99 100644 --- a/tests/cases/fourslash/exportEqualTypes.ts +++ b/tests/cases/fourslash/exportEqualTypes.ts @@ -20,5 +20,5 @@ verify.quickInfos({ 3: "var r2: string" }); goTo.marker('4'); -verify.memberListContains('foo'); +verify.completionListContains('foo'); verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash/extendArrayInterface.ts b/tests/cases/fourslash/extendArrayInterface.ts index 4402dc39b88..d2322b37df0 100644 --- a/tests/cases/fourslash/extendArrayInterface.ts +++ b/tests/cases/fourslash/extendArrayInterface.ts @@ -8,7 +8,7 @@ goTo.marker("1"); -verify.memberListContains("concat"); +verify.completionListContains("concat"); // foo doesn't exist, so both references should be in error verify.errorExistsBetweenMarkers("2", "3"); diff --git a/tests/cases/fourslash/externalModuleIntellisense.ts b/tests/cases/fourslash/externalModuleIntellisense.ts index 93c7143a9c6..8577e0686bf 100644 --- a/tests/cases/fourslash/externalModuleIntellisense.ts +++ b/tests/cases/fourslash/externalModuleIntellisense.ts @@ -23,4 +23,4 @@ goTo.eof(); edit.insert("x."); verify.completionListContains('enable'); verify.completionListContains('post'); -verify.memberListCount(2); +verify.completionListCount(2); diff --git a/tests/cases/fourslash/externalModuleRefernceResolutionOrderInImportDeclaration.ts b/tests/cases/fourslash/externalModuleRefernceResolutionOrderInImportDeclaration.ts index 257c6cf3455..a1d503a657a 100644 --- a/tests/cases/fourslash/externalModuleRefernceResolutionOrderInImportDeclaration.ts +++ b/tests/cases/fourslash/externalModuleRefernceResolutionOrderInImportDeclaration.ts @@ -16,5 +16,5 @@ goTo.marker('1'); edit.insert("file1."); -verify.memberListContains("bar"); -verify.not.memberListContains("foo"); \ No newline at end of file +verify.completionListContains("bar"); +verify.not.completionListContains("foo"); \ No newline at end of file diff --git a/tests/cases/fourslash/forwardReference.ts b/tests/cases/fourslash/forwardReference.ts index 3c2e2c6393c..355eda9113c 100644 --- a/tests/cases/fourslash/forwardReference.ts +++ b/tests/cases/fourslash/forwardReference.ts @@ -9,4 +9,4 @@ ////} goTo.marker(); -verify.memberListContains('n'); +verify.completionListContains('n'); diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 35c68b49fd8..745a746db11 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -121,13 +121,11 @@ declare namespace FourSlashInterface { private negative; not: verifyNegatable; constructor(negative?: boolean); - memberListContains(symbol: string, text?: string, documenation?: string, kind?: string): void; - memberListCount(expectedCount: number): void; + completionListCount(expectedCount: number): void; completionListContains(symbol: string, text?: string, documentation?: string, kind?: string, spanIndex?: number): void; completionListItemsCountIsGreaterThan(count: number): void; completionListIsEmpty(): void; completionListAllowsNewIdentifier(): void; - memberListIsEmpty(): void; signatureHelpPresent(): void; errorExistsBetweenMarkers(startMarker: string, endMarker: string): void; errorExistsAfterMarker(markerName?: string): void; @@ -279,7 +277,6 @@ declare namespace FourSlashInterface { printCurrentFileStateWithoutCaret(): void; printCurrentQuickInfo(): void; printCurrentSignatureHelp(): void; - printMemberListMembers(): void; printCompletionListMembers(): void; printBreakpointLocation(pos: number): void; printBreakpointAtCurrentLocation(): void; diff --git a/tests/cases/fourslash/functionTypes.ts b/tests/cases/fourslash/functionTypes.ts index 0baccba286e..813dfa8cdcb 100644 --- a/tests/cases/fourslash/functionTypes.ts +++ b/tests/cases/fourslash/functionTypes.ts @@ -23,7 +23,7 @@ verify.numberOfErrorsInCurrentFile(0); for (var i = 1; i <= 7; i++) { goTo.marker('' + i); - verify.memberListCount(8); + verify.completionListCount(8); verify.completionListContains('apply'); verify.completionListContains('arguments'); verify.completionListContains('bind'); diff --git a/tests/cases/fourslash/getJavaScriptCompletions20.ts b/tests/cases/fourslash/getJavaScriptCompletions20.ts index d254705bb91..3ca27fa288a 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions20.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions20.ts @@ -18,4 +18,4 @@ //// Person.getNa/**/ = 10; goTo.marker(); -verify.not.memberListContains('getNa'); +verify.not.completionListContains('getNa'); diff --git a/tests/cases/fourslash/getJavaScriptQuickInfo8.ts b/tests/cases/fourslash/getJavaScriptQuickInfo8.ts index 09ac27ce595..958dec3765d 100644 --- a/tests/cases/fourslash/getJavaScriptQuickInfo8.ts +++ b/tests/cases/fourslash/getJavaScriptQuickInfo8.ts @@ -21,9 +21,9 @@ goTo.marker('1'); edit.insert('.'); -verify.memberListContains('toFixed', undefined, undefined, 'method'); +verify.completionListContains('toFixed', undefined, undefined, 'method'); edit.backspace(); goTo.marker('2'); edit.insert('.'); -verify.memberListContains('substr', undefined, undefined, 'method'); +verify.completionListContains('substr', undefined, undefined, 'method'); diff --git a/tests/cases/fourslash/javaScriptModules13.ts b/tests/cases/fourslash/javaScriptModules13.ts index bcf263a4b8c..5e3eead3b6c 100644 --- a/tests/cases/fourslash/javaScriptModules13.ts +++ b/tests/cases/fourslash/javaScriptModules13.ts @@ -23,6 +23,6 @@ verify.completionListContains('y'); verify.not.completionListContains('invisible'); edit.insert('x.'); -verify.memberListContains('a', undefined, undefined, 'property'); +verify.completionListContains('a', undefined, undefined, 'property'); edit.insert('a.'); -verify.memberListContains('toFixed', undefined, undefined, 'method'); +verify.completionListContains('toFixed', undefined, undefined, 'method'); diff --git a/tests/cases/fourslash/javaScriptModules19.ts b/tests/cases/fourslash/javaScriptModules19.ts index 564cbea722f..56ee5a2a2e5 100644 --- a/tests/cases/fourslash/javaScriptModules19.ts +++ b/tests/cases/fourslash/javaScriptModules19.ts @@ -21,6 +21,6 @@ verify.completionListContains('y'); verify.not.completionListContains('invisible'); edit.insert('x.'); -verify.memberListContains('a', undefined, undefined, 'property'); +verify.completionListContains('a', undefined, undefined, 'property'); edit.insert('a.'); -verify.memberListContains('toFixed', undefined, undefined, 'method'); +verify.completionListContains('toFixed', undefined, undefined, 'method'); diff --git a/tests/cases/fourslash/javaScriptPrototype1.ts b/tests/cases/fourslash/javaScriptPrototype1.ts index c9c454cfb2c..8b2d6f3fb84 100644 --- a/tests/cases/fourslash/javaScriptPrototype1.ts +++ b/tests/cases/fourslash/javaScriptPrototype1.ts @@ -22,25 +22,25 @@ // Members of the class instance goTo.marker('1'); edit.insert('.'); -verify.memberListContains('foo', undefined, undefined, 'property'); -verify.memberListContains('bar', undefined, undefined, 'property'); +verify.completionListContains('foo', undefined, undefined, 'property'); +verify.completionListContains('bar', undefined, undefined, 'property'); edit.backspace(); // Members of a class method (1) goTo.marker('2'); edit.insert('.'); -verify.memberListContains('length', undefined, undefined, 'property'); +verify.completionListContains('length', undefined, undefined, 'property'); edit.backspace(); // Members of the invocation of a class method (1) goTo.marker('3'); edit.insert('.'); -verify.memberListContains('toFixed', undefined, undefined, 'method'); -verify.not.memberListContains('substr', undefined, undefined, 'method'); +verify.completionListContains('toFixed', undefined, undefined, 'method'); +verify.not.completionListContains('substr', undefined, undefined, 'method'); edit.backspace(); // Members of the invocation of a class method (2) goTo.marker('4'); edit.insert('.'); -verify.memberListContains('substr', undefined, undefined, 'method'); -verify.not.memberListContains('toFixed', undefined, undefined, 'method'); +verify.completionListContains('substr', undefined, undefined, 'method'); +verify.not.completionListContains('toFixed', undefined, undefined, 'method'); diff --git a/tests/cases/fourslash/jsDocFunctionSignatures3.ts b/tests/cases/fourslash/jsDocFunctionSignatures3.ts index 3679035d31d..87efaec3308 100644 --- a/tests/cases/fourslash/jsDocFunctionSignatures3.ts +++ b/tests/cases/fourslash/jsDocFunctionSignatures3.ts @@ -23,10 +23,10 @@ goTo.marker('1'); edit.insert('.'); -verify.memberListContains('substr', undefined, undefined, 'method'); +verify.completionListContains('substr', undefined, undefined, 'method'); edit.backspace(); goTo.marker('2'); edit.insert('.'); -verify.memberListContains('toFixed', undefined, undefined, 'method'); +verify.completionListContains('toFixed', undefined, undefined, 'method'); edit.backspace(); diff --git a/tests/cases/fourslash/jsDocGenerics1.ts b/tests/cases/fourslash/jsDocGenerics1.ts index 61358e3f490..e5570937ba4 100644 --- a/tests/cases/fourslash/jsDocGenerics1.ts +++ b/tests/cases/fourslash/jsDocGenerics1.ts @@ -25,10 +25,10 @@ goTo.marker('1'); -verify.memberListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); +verify.completionListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); goTo.marker('2'); -verify.memberListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); +verify.completionListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); goTo.marker('3'); -verify.memberListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); +verify.completionListContains("toFixed", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); diff --git a/tests/cases/fourslash/jsdocNullableUnion.ts b/tests/cases/fourslash/jsdocNullableUnion.ts index 19dc9818d69..50b929b1912 100644 --- a/tests/cases/fourslash/jsdocNullableUnion.ts +++ b/tests/cases/fourslash/jsdocNullableUnion.ts @@ -14,10 +14,10 @@ ////} goTo.marker('1'); -verify.memberListContains("x"); +verify.completionListContains("x"); goTo.marker('2'); -verify.memberListContains("y"); +verify.completionListContains("y"); goTo.marker('3'); -verify.memberListContains("z"); +verify.completionListContains("z"); diff --git a/tests/cases/fourslash/lambdaThisMembers.ts b/tests/cases/fourslash/lambdaThisMembers.ts index 1e80a5a47df..1a5aa112a6c 100644 --- a/tests/cases/fourslash/lambdaThisMembers.ts +++ b/tests/cases/fourslash/lambdaThisMembers.ts @@ -12,5 +12,5 @@ goTo.marker(); verify.completionListContains("a"); verify.completionListContains("b"); -verify.memberListCount(2); +verify.completionListCount(2); diff --git a/tests/cases/fourslash/memberCompletionFromFunctionCall.ts b/tests/cases/fourslash/memberCompletionFromFunctionCall.ts index 56629a3b510..9bd59e1dc9f 100644 --- a/tests/cases/fourslash/memberCompletionFromFunctionCall.ts +++ b/tests/cases/fourslash/memberCompletionFromFunctionCall.ts @@ -8,5 +8,5 @@ goTo.marker(); edit.insert("."); -verify.not.memberListIsEmpty(); -verify.memberListContains("text"); \ No newline at end of file +verify.not.completionListIsEmpty(); +verify.completionListContains("text"); \ No newline at end of file diff --git a/tests/cases/fourslash/memberCompletionInForEach1.ts b/tests/cases/fourslash/memberCompletionInForEach1.ts index 2af0393283f..b90da43c119 100644 --- a/tests/cases/fourslash/memberCompletionInForEach1.ts +++ b/tests/cases/fourslash/memberCompletionInForEach1.ts @@ -6,11 +6,11 @@ goTo.marker('1'); edit.insert('.'); -verify.memberListContains('trim'); -verify.memberListCount(21); +verify.completionListContains('trim'); +verify.completionListCount(21); edit.insert('});'); // need the following lines to not have parse errors in order for completion list to appear goTo.marker('2'); edit.insert('.'); -verify.memberListContains('trim'); -verify.memberListCount(21); +verify.completionListContains('trim'); +verify.completionListCount(21); diff --git a/tests/cases/fourslash/memberCompletionOnTypeParameters.ts b/tests/cases/fourslash/memberCompletionOnTypeParameters.ts index 6092e1e280a..cc3fc92a31a 100644 --- a/tests/cases/fourslash/memberCompletionOnTypeParameters.ts +++ b/tests/cases/fourslash/memberCompletionOnTypeParameters.ts @@ -14,21 +14,21 @@ ////} goTo.marker("S"); -verify.memberListIsEmpty(); +verify.completionListIsEmpty(); goTo.marker("T"); -verify.memberListContains("x", "(property) IFoo.x: number"); -verify.memberListContains("y", "(property) IFoo.y: string"); -verify.memberListCount(2); +verify.completionListContains("x", "(property) IFoo.x: number"); +verify.completionListContains("y", "(property) IFoo.y: string"); +verify.completionListCount(2); goTo.marker("U"); -verify.memberListContains("toString", "(method) Object.toString(): string"); -verify.memberListCount(7); // constructor, toString, toLocaleString, valueOf, hasOwnProperty, isPrototypeOf, propertyIsEnumerable +verify.completionListContains("toString", "(method) Object.toString(): string"); +verify.completionListCount(7); // constructor, toString, toLocaleString, valueOf, hasOwnProperty, isPrototypeOf, propertyIsEnumerable goTo.marker("V"); -verify.memberListContains("x", "(property) IFoo.x: number"); -verify.memberListContains("y", "(property) IFoo.y: string"); -verify.memberListCount(2); +verify.completionListContains("x", "(property) IFoo.x: number"); +verify.completionListContains("y", "(property) IFoo.y: string"); +verify.completionListCount(2); diff --git a/tests/cases/fourslash/memberCompletionOnTypeParameters2.ts b/tests/cases/fourslash/memberCompletionOnTypeParameters2.ts index e7f6c5c6519..f77a8b0c612 100644 --- a/tests/cases/fourslash/memberCompletionOnTypeParameters2.ts +++ b/tests/cases/fourslash/memberCompletionOnTypeParameters2.ts @@ -17,5 +17,5 @@ goTo.marker(); -verify.memberListContains("foo"); -verify.memberListCount(1); +verify.completionListContains("foo"); +verify.completionListCount(1); diff --git a/tests/cases/fourslash/memberListAfterDoubleDot.ts b/tests/cases/fourslash/memberListAfterDoubleDot.ts index 21a1ad913ea..489e7c3b105 100644 --- a/tests/cases/fourslash/memberListAfterDoubleDot.ts +++ b/tests/cases/fourslash/memberListAfterDoubleDot.ts @@ -3,4 +3,4 @@ ////../**/ goTo.marker(); -verify.memberListIsEmpty(); \ No newline at end of file +verify.completionListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListAfterSingleDot.ts b/tests/cases/fourslash/memberListAfterSingleDot.ts index 62edf3b8c9e..ba0cdb1a1eb 100644 --- a/tests/cases/fourslash/memberListAfterSingleDot.ts +++ b/tests/cases/fourslash/memberListAfterSingleDot.ts @@ -3,4 +3,4 @@ ////./**/ goTo.marker(); -verify.memberListIsEmpty(); \ No newline at end of file +verify.completionListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListErrorRecovery.ts b/tests/cases/fourslash/memberListErrorRecovery.ts index 74bd25464f6..ee1fdf9193c 100644 --- a/tests/cases/fourslash/memberListErrorRecovery.ts +++ b/tests/cases/fourslash/memberListErrorRecovery.ts @@ -6,5 +6,5 @@ /////*1*/var bar; goTo.marker(); -verify.memberListContains("fun"); +verify.completionListContains("fun"); verify.not.errorExistsAfterMarker("1"); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListInFunctionCall.ts b/tests/cases/fourslash/memberListInFunctionCall.ts index 3c8c8e9ceb1..82e05bc4a00 100644 --- a/tests/cases/fourslash/memberListInFunctionCall.ts +++ b/tests/cases/fourslash/memberListInFunctionCall.ts @@ -11,5 +11,5 @@ goTo.marker(); edit.insert('.'); -verify.memberListContains('charAt'); +verify.completionListContains('charAt'); diff --git a/tests/cases/fourslash/memberListInReopenedEnum.ts b/tests/cases/fourslash/memberListInReopenedEnum.ts index 5101cb46f89..a03ee39041c 100644 --- a/tests/cases/fourslash/memberListInReopenedEnum.ts +++ b/tests/cases/fourslash/memberListInReopenedEnum.ts @@ -12,7 +12,7 @@ goTo.marker('1'); -verify.memberListContains('A', '(enum member) E.A = 0'); -verify.memberListContains('B', '(enum member) E.B = 1'); -verify.memberListContains('C', '(enum member) E.C = 0'); -verify.memberListContains('D', '(enum member) E.D = 1'); \ No newline at end of file +verify.completionListContains('A', '(enum member) E.A = 0'); +verify.completionListContains('B', '(enum member) E.B = 1'); +verify.completionListContains('C', '(enum member) E.C = 0'); +verify.completionListContains('D', '(enum member) E.D = 1'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListInWithBlock.ts b/tests/cases/fourslash/memberListInWithBlock.ts index a37c20dadfa..5253e924ff3 100644 --- a/tests/cases/fourslash/memberListInWithBlock.ts +++ b/tests/cases/fourslash/memberListInWithBlock.ts @@ -12,7 +12,7 @@ ////} goTo.marker('1'); -verify.memberListIsEmpty(); +verify.completionListIsEmpty(); goTo.marker('2'); // Only keywords should show in completion, no members or types diff --git a/tests/cases/fourslash/memberListInWithBlock2.ts b/tests/cases/fourslash/memberListInWithBlock2.ts index 72bccb6926c..534cd12a416 100644 --- a/tests/cases/fourslash/memberListInWithBlock2.ts +++ b/tests/cases/fourslash/memberListInWithBlock2.ts @@ -9,4 +9,4 @@ ////} goTo.marker('1'); -verify.memberListIsEmpty(); \ No newline at end of file +verify.completionListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListInWithBlock3.ts b/tests/cases/fourslash/memberListInWithBlock3.ts index a007b08cd02..b30ceed9897 100644 --- a/tests/cases/fourslash/memberListInWithBlock3.ts +++ b/tests/cases/fourslash/memberListInWithBlock3.ts @@ -4,4 +4,4 @@ ////with(x./*1*/ goTo.marker('1'); -verify.memberListContains("a"); +verify.completionListContains("a"); diff --git a/tests/cases/fourslash/memberListInsideObjectLiterals.ts b/tests/cases/fourslash/memberListInsideObjectLiterals.ts index 99d62cbc6e5..875fb2c7fc9 100644 --- a/tests/cases/fourslash/memberListInsideObjectLiterals.ts +++ b/tests/cases/fourslash/memberListInsideObjectLiterals.ts @@ -26,16 +26,16 @@ // Literal member completion inside empty literal. goTo.marker("1"); -verify.memberListContains("x1", "(property) MyPoint.x1: number"); -verify.memberListContains("y1", "(property) MyPoint.y1: number"); +verify.completionListContains("x1", "(property) MyPoint.x1: number"); +verify.completionListContains("y1", "(property) MyPoint.y1: number"); // Literal member completion for 2nd member name. goTo.marker("2"); -verify.memberListContains("y1", "(property) MyPoint.y1: number"); +verify.completionListContains("y1", "(property) MyPoint.y1: number"); // Literal member completion at existing member name location. goTo.marker("3"); -verify.memberListContains("y1", "(property) MyPoint.y1: number"); +verify.completionListContains("y1", "(property) MyPoint.y1: number"); goTo.marker("4"); -verify.memberListContains("x1", "(property) MyPoint.x1: number"); \ No newline at end of file +verify.completionListContains("x1", "(property) MyPoint.x1: number"); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfClass.ts b/tests/cases/fourslash/memberListOfClass.ts index 6c93a0536d9..3355109e4a7 100644 --- a/tests/cases/fourslash/memberListOfClass.ts +++ b/tests/cases/fourslash/memberListOfClass.ts @@ -10,6 +10,6 @@ ////f./**/ goTo.marker(); -verify.memberListCount(2); -verify.memberListContains('pubMeth', '(method) C1.pubMeth(): void'); -verify.memberListContains('pubProp', '(property) C1.pubProp: number'); \ No newline at end of file +verify.completionListCount(2); +verify.completionListContains('pubMeth', '(method) C1.pubMeth(): void'); +verify.completionListContains('pubProp', '(property) C1.pubProp: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfEnumFromExternalModule.ts b/tests/cases/fourslash/memberListOfEnumFromExternalModule.ts index 42171ff2e8b..5caaf5d9c23 100644 --- a/tests/cases/fourslash/memberListOfEnumFromExternalModule.ts +++ b/tests/cases/fourslash/memberListOfEnumFromExternalModule.ts @@ -10,4 +10,4 @@ goTo.file("memberListOfEnumFromExternalModule_file1.ts"); goTo.marker('1'); -verify.memberListContains("One"); \ No newline at end of file +verify.completionListContains("One"); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfEnumInModule.ts b/tests/cases/fourslash/memberListOfEnumInModule.ts index f92c5d43ea8..0a3887e3304 100644 --- a/tests/cases/fourslash/memberListOfEnumInModule.ts +++ b/tests/cases/fourslash/memberListOfEnumInModule.ts @@ -9,5 +9,5 @@ ////} goTo.marker(); -verify.memberListContains("bar"); -verify.memberListContains("baz"); \ No newline at end of file +verify.completionListContains("bar"); +verify.completionListContains("baz"); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfExportedClass.ts b/tests/cases/fourslash/memberListOfExportedClass.ts index f6632bfe7b0..3c9fe36358b 100644 --- a/tests/cases/fourslash/memberListOfExportedClass.ts +++ b/tests/cases/fourslash/memberListOfExportedClass.ts @@ -11,5 +11,5 @@ ////c./**/ // test on c. goTo.marker(); -verify.memberListCount(1); -verify.memberListContains('pub', '(property) M.C.pub: number'); \ No newline at end of file +verify.completionListCount(1); +verify.completionListContains('pub', '(property) M.C.pub: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfModule.ts b/tests/cases/fourslash/memberListOfModule.ts index f09dfd67dbd..4724691c0a7 100644 --- a/tests/cases/fourslash/memberListOfModule.ts +++ b/tests/cases/fourslash/memberListOfModule.ts @@ -14,6 +14,6 @@ ////var x: Foo./**/ goTo.marker(); -verify.memberListCount(2); -verify.memberListContains('Bar'); -verify.memberListContains('Blah'); \ No newline at end of file +verify.completionListCount(2); +verify.completionListContains('Bar'); +verify.completionListContains('Blah'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfVarInArrowExpression.ts b/tests/cases/fourslash/memberListOfVarInArrowExpression.ts index 03da06989ae..b1a91ae3cb2 100644 --- a/tests/cases/fourslash/memberListOfVarInArrowExpression.ts +++ b/tests/cases/fourslash/memberListOfVarInArrowExpression.ts @@ -15,4 +15,4 @@ goTo.marker('1'); verify.quickInfoIs("(property) a1: string"); -verify.memberListContains("a1", "(property) a1: string"); \ No newline at end of file +verify.completionListContains("a1", "(property) a1: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOnContextualThis.ts b/tests/cases/fourslash/memberListOnContextualThis.ts index 7eeb67dc620..e17600cad98 100644 --- a/tests/cases/fourslash/memberListOnContextualThis.ts +++ b/tests/cases/fourslash/memberListOnContextualThis.ts @@ -8,5 +8,5 @@ goTo.marker('1'); verify.quickInfoIs("this: A"); goTo.marker('2'); -verify.memberListContains('a', '(property) A.a: string'); +verify.completionListContains('a', '(property) A.a: string'); diff --git a/tests/cases/fourslash/memberListOnExplicitThis.ts b/tests/cases/fourslash/memberListOnExplicitThis.ts index b776a7c0641..425eb17f8ba 100644 --- a/tests/cases/fourslash/memberListOnExplicitThis.ts +++ b/tests/cases/fourslash/memberListOnExplicitThis.ts @@ -13,17 +13,17 @@ ////function g(this: Restricted) {this./*4*/} goTo.marker('1'); -verify.memberListContains('f', '(method) C1.f(this: this): void'); -verify.memberListContains('g', '(method) C1.g(this: Restricted): void'); -verify.memberListContains('n', '(property) C1.n: number'); -verify.memberListContains('m', '(property) C1.m: number'); +verify.completionListContains('f', '(method) C1.f(this: this): void'); +verify.completionListContains('g', '(method) C1.g(this: Restricted): void'); +verify.completionListContains('n', '(property) C1.n: number'); +verify.completionListContains('m', '(property) C1.m: number'); goTo.marker('2'); -verify.memberListContains('n', '(property) Restricted.n: number'); +verify.completionListContains('n', '(property) Restricted.n: number'); goTo.marker('3'); -verify.memberListIsEmpty(); +verify.completionListIsEmpty(); goTo.marker('4'); -verify.memberListContains('n', '(property) Restricted.n: number'); +verify.completionListContains('n', '(property) Restricted.n: number'); diff --git a/tests/cases/fourslash/memberListOnFunctionParameter.ts b/tests/cases/fourslash/memberListOnFunctionParameter.ts index ee33cdc95e5..52daacb3573 100644 --- a/tests/cases/fourslash/memberListOnFunctionParameter.ts +++ b/tests/cases/fourslash/memberListOnFunctionParameter.ts @@ -6,8 +6,8 @@ ////} goTo.marker(); -verify.memberListContains("charAt"); -verify.memberListContains("charCodeAt"); -verify.memberListContains("length"); -verify.memberListContains("concat"); -verify.not.memberListContains("toFixed"); \ No newline at end of file +verify.completionListContains("charAt"); +verify.completionListContains("charCodeAt"); +verify.completionListContains("length"); +verify.completionListContains("concat"); +verify.not.completionListContains("toFixed"); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOnThisInClassWithPrivates.ts b/tests/cases/fourslash/memberListOnThisInClassWithPrivates.ts index 341605e391c..c44835f6882 100644 --- a/tests/cases/fourslash/memberListOnThisInClassWithPrivates.ts +++ b/tests/cases/fourslash/memberListOnThisInClassWithPrivates.ts @@ -8,6 +8,6 @@ ////} goTo.marker(); -verify.memberListContains('privMeth', '(method) C1.privMeth(): void'); -verify.memberListContains('pubMeth', '(method) C1.pubMeth(): void'); -verify.memberListContains('pubProp', '(property) C1.pubProp: number'); \ No newline at end of file +verify.completionListContains('privMeth', '(method) C1.privMeth(): void'); +verify.completionListContains('pubMeth', '(method) C1.pubMeth(): void'); +verify.completionListContains('pubProp', '(property) C1.pubProp: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberlistOnDDot.ts b/tests/cases/fourslash/memberlistOnDDot.ts index 604bf531fc7..11efdd5d523 100644 --- a/tests/cases/fourslash/memberlistOnDDot.ts +++ b/tests/cases/fourslash/memberlistOnDDot.ts @@ -6,4 +6,4 @@ goTo.marker(); edit.insert('.'); edit.insert('.'); -//verify.not.memberListContains('charAt'); \ No newline at end of file +//verify.not.completionListContains('charAt'); \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoOnNarrowedTypeInModule.ts b/tests/cases/fourslash/quickInfoOnNarrowedTypeInModule.ts index cfeaabfbb86..25e6cd4c68e 100644 --- a/tests/cases/fourslash/quickInfoOnNarrowedTypeInModule.ts +++ b/tests/cases/fourslash/quickInfoOnNarrowedTypeInModule.ts @@ -64,12 +64,12 @@ verify.completionListContains("exportedStrOrNum", "var m.exportedStrOrNum: strin goTo.marker('7'); verify.quickInfoIs('var m.exportedStrOrNum: string | number'); -verify.memberListContains("exportedStrOrNum", "var m.exportedStrOrNum: string | number"); +verify.completionListContains("exportedStrOrNum", "var m.exportedStrOrNum: string | number"); goTo.marker('8'); verify.quickInfoIs('var m.exportedStrOrNum: number'); -verify.memberListContains("exportedStrOrNum", "var m.exportedStrOrNum: number"); +verify.completionListContains("exportedStrOrNum", "var m.exportedStrOrNum: number"); goTo.marker('9'); verify.quickInfoIs('var m.exportedStrOrNum: string'); -verify.memberListContains("exportedStrOrNum", "var m.exportedStrOrNum: string"); \ No newline at end of file +verify.completionListContains("exportedStrOrNum", "var m.exportedStrOrNum: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoOnObjectLiteralWithAccessors.ts b/tests/cases/fourslash/quickInfoOnObjectLiteralWithAccessors.ts index 3ae0533d340..e11af2beda4 100644 --- a/tests/cases/fourslash/quickInfoOnObjectLiteralWithAccessors.ts +++ b/tests/cases/fourslash/quickInfoOnObjectLiteralWithAccessors.ts @@ -17,8 +17,8 @@ verify.quickInfos({ }); goTo.marker('3'); -verify.memberListContains("x", "(property) x: number", undefined); -verify.memberListContains("b", "(property) b: number", undefined); +verify.completionListContains("x", "(property) x: number", undefined); +verify.completionListContains("b", "(property) b: number", undefined); verify.quickInfoIs("(property) x: number"); verify.quickInfoAt("4", "var point: {\n b: number;\n x: number;\n}"); diff --git a/tests/cases/fourslash/quickInfoOnObjectLiteralWithOnlyGetter.ts b/tests/cases/fourslash/quickInfoOnObjectLiteralWithOnlyGetter.ts index 7beaf5548fb..f592b255ac0 100644 --- a/tests/cases/fourslash/quickInfoOnObjectLiteralWithOnlyGetter.ts +++ b/tests/cases/fourslash/quickInfoOnObjectLiteralWithOnlyGetter.ts @@ -14,6 +14,6 @@ verify.quickInfos({ }); goTo.marker('3'); -verify.memberListContains("x", "(property) x: number", undefined); +verify.completionListContains("x", "(property) x: number", undefined); verify.quickInfoAt("4", "var point: {\n readonly x: number;\n}"); diff --git a/tests/cases/fourslash/quickInfoOnObjectLiteralWithOnlySetter.ts b/tests/cases/fourslash/quickInfoOnObjectLiteralWithOnlySetter.ts index 95a304329f2..d66626cc99d 100644 --- a/tests/cases/fourslash/quickInfoOnObjectLiteralWithOnlySetter.ts +++ b/tests/cases/fourslash/quickInfoOnObjectLiteralWithOnlySetter.ts @@ -12,8 +12,8 @@ verify.quickInfoAt("1", "function makePoint(x: number): {\n b: number;\n x: number;\n}"); goTo.marker('2'); -verify.memberListContains("x", "(property) x: number", undefined); -verify.memberListContains("b", "(property) b: number", undefined); +verify.completionListContains("x", "(property) x: number", undefined); +verify.completionListContains("b", "(property) b: number", undefined); verify.quickInfoIs("(property) x: number"); verify.quickInfoAt("3", "var point: {\n b: number;\n x: number;\n}"); diff --git a/tests/cases/fourslash/server/completions01.ts b/tests/cases/fourslash/server/completions01.ts index a837a74849d..38fdbab4eda 100644 --- a/tests/cases/fourslash/server/completions01.ts +++ b/tests/cases/fourslash/server/completions01.ts @@ -6,11 +6,11 @@ goTo.marker('1'); edit.insert('.'); -verify.memberListContains('trim'); -verify.memberListCount(21); +verify.completionListContains('trim'); +verify.completionListCount(21); edit.insert('});'); // need the following lines to not have parse errors in order for completion list to appear goTo.marker('2'); edit.insert('.'); -verify.memberListContains('trim'); -verify.memberListCount(21); +verify.completionListContains('trim'); +verify.completionListCount(21); diff --git a/tests/cases/fourslash/server/jsdocTypedefTag.ts b/tests/cases/fourslash/server/jsdocTypedefTag.ts index 968e30a412d..9e980114835 100644 --- a/tests/cases/fourslash/server/jsdocTypedefTag.ts +++ b/tests/cases/fourslash/server/jsdocTypedefTag.ts @@ -52,37 +52,37 @@ //// d.dogAge./*dogAge*/; goTo.marker('numberLike'); -verify.memberListContains('charAt'); -verify.memberListContains('toExponential'); +verify.completionListContains('charAt'); +verify.completionListContains('toExponential'); goTo.marker('person'); -verify.memberListContains('personName'); -verify.memberListContains('personAge'); +verify.completionListContains('personName'); +verify.completionListContains('personAge'); goTo.marker('personName'); -verify.memberListContains('charAt'); +verify.completionListContains('charAt'); goTo.marker('personAge'); -verify.memberListContains('toExponential'); +verify.completionListContains('toExponential'); goTo.marker('animal'); -verify.memberListContains('animalName'); -verify.memberListContains('animalAge'); +verify.completionListContains('animalName'); +verify.completionListContains('animalAge'); goTo.marker('animalName'); -verify.memberListContains('charAt'); +verify.completionListContains('charAt'); goTo.marker('animalAge'); -verify.memberListContains('toExponential'); +verify.completionListContains('toExponential'); goTo.marker('dog'); -verify.memberListContains('dogName'); -verify.memberListContains('dogAge'); +verify.completionListContains('dogName'); +verify.completionListContains('dogAge'); goTo.marker('dogName'); -verify.memberListContains('charAt'); +verify.completionListContains('charAt'); goTo.marker('dogAge'); -verify.memberListContains('toExponential'); +verify.completionListContains('toExponential'); goTo.marker('cat'); -verify.memberListContains('catName'); -verify.memberListContains('catAge'); +verify.completionListContains('catName'); +verify.completionListContains('catAge'); goTo.marker('catName'); -verify.memberListContains('charAt'); +verify.completionListContains('charAt'); goTo.marker('catAge'); -verify.memberListContains('toExponential'); \ No newline at end of file +verify.completionListContains('toExponential'); \ No newline at end of file diff --git a/tests/cases/fourslash/server/jsdocTypedefTagNamespace.ts b/tests/cases/fourslash/server/jsdocTypedefTagNamespace.ts index 1d7a0bf318a..29330a73d3c 100644 --- a/tests/cases/fourslash/server/jsdocTypedefTagNamespace.ts +++ b/tests/cases/fourslash/server/jsdocTypedefTagNamespace.ts @@ -16,12 +16,12 @@ //// var x1; x1./*3*/; goTo.marker("1"); -verify.memberListContains('charAt'); -verify.memberListContains('toExponential'); +verify.completionListContains('charAt'); +verify.completionListContains('toExponential'); goTo.marker("2"); -verify.memberListContains('age'); +verify.completionListContains('age'); goTo.marker("3"); -verify.memberListContains('charAt'); -verify.memberListContains('toExponential'); \ No newline at end of file +verify.completionListContains('charAt'); +verify.completionListContains('toExponential'); \ No newline at end of file diff --git a/tests/cases/fourslash/tsxCompletion10.ts b/tests/cases/fourslash/tsxCompletion10.ts index f10e014c282..d36b2369218 100644 --- a/tests/cases/fourslash/tsxCompletion10.ts +++ b/tests/cases/fourslash/tsxCompletion10.ts @@ -10,5 +10,5 @@ //// var x1 =
goTo.marker("1"); -verify.memberListCount(1); +verify.completionListCount(1); verify.completionListContains('div'); goTo.marker("2"); -verify.memberListCount(1); +verify.completionListCount(1); verify.completionListContains('h1') diff --git a/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts b/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts index 742009b487e..7719e04a9ef 100644 --- a/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts +++ b/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts @@ -4,5 +4,5 @@ //// var x1 =
goTo.marker("1"); -verify.memberListCount(1); +verify.completionListCount(1); verify.completionListContains('div'); goTo.marker("2"); -verify.memberListCount(1); +verify.completionListCount(1); verify.completionListContains('h1') diff --git a/tests/cases/fourslash/tsxCompletionOnOpeningTagWithoutJSX1.ts b/tests/cases/fourslash/tsxCompletionOnOpeningTagWithoutJSX1.ts index d0ef579f401..f208b0a44a4 100644 --- a/tests/cases/fourslash/tsxCompletionOnOpeningTagWithoutJSX1.ts +++ b/tests/cases/fourslash/tsxCompletionOnOpeningTagWithoutJSX1.ts @@ -4,4 +4,4 @@ //// var x = Date: Wed, 7 Dec 2016 14:07:35 -0800 Subject: [PATCH 19/21] Remove debug statement --- tests/cases/fourslash/untypedModuleImport.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/cases/fourslash/untypedModuleImport.ts b/tests/cases/fourslash/untypedModuleImport.ts index d128ad24ea3..da6473cf992 100644 --- a/tests/cases/fourslash/untypedModuleImport.ts +++ b/tests/cases/fourslash/untypedModuleImport.ts @@ -8,7 +8,6 @@ ////[|foo|](); goTo.file("a.ts"); -debug.printErrorList(); verify.numberOfErrorsInCurrentFile(0); goTo.marker("fooModule"); From 7eca4bc9be0940f4213d13a9b91606d1df93d3b6 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 7 Dec 2016 15:48:23 -0800 Subject: [PATCH 20/21] Fix decorator emit for accessors --- src/compiler/transformers/ts.ts | 5 +- .../decoratorOnClassAccessor7.errors.txt | 41 ++++++ .../reference/decoratorOnClassAccessor7.js | 125 ++++++++++++++++++ .../accessor/decoratorOnClassAccessor7.ts | 34 +++++ 4 files changed, 203 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/decoratorOnClassAccessor7.errors.txt create mode 100644 tests/baselines/reference/decoratorOnClassAccessor7.js create mode 100644 tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor7.ts diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 749ea46c8f2..77af854269e 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -1223,11 +1223,12 @@ namespace ts { } const { firstAccessor, secondAccessor, setAccessor } = getAllAccessorDeclarations(node.members, accessor); - if (accessor !== firstAccessor) { + const firstAccessorWithDecorators = firstAccessor.decorators ? firstAccessor : secondAccessor && secondAccessor.decorators ? secondAccessor : undefined; + if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) { return undefined; } - const decorators = firstAccessor.decorators || (secondAccessor && secondAccessor.decorators); + const decorators = firstAccessorWithDecorators.decorators; const parameters = getDecoratorsOfParameters(setAccessor); if (!decorators && !parameters) { return undefined; diff --git a/tests/baselines/reference/decoratorOnClassAccessor7.errors.txt b/tests/baselines/reference/decoratorOnClassAccessor7.errors.txt new file mode 100644 index 00000000000..d776297fcf4 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor7.errors.txt @@ -0,0 +1,41 @@ +tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor7.ts(26,5): error TS1207: Decorators cannot be applied to multiple get/set accessors of the same name. +tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor7.ts(31,5): error TS1207: Decorators cannot be applied to multiple get/set accessors of the same name. + + +==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor7.ts (2 errors) ==== + declare function dec1(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; + declare function dec2(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; + + class A { + @dec1 get x() { return 0; } + set x(value: number) { } + } + + class B { + get x() { return 0; } + @dec2 set x(value: number) { } + } + + class C { + @dec1 set x(value: number) { } + get x() { return 0; } + } + + class D { + set x(value: number) { } + @dec2 get x() { return 0; } + } + + class E { + @dec1 get x() { return 0; } + @dec2 set x(value: number) { } + ~ +!!! error TS1207: Decorators cannot be applied to multiple get/set accessors of the same name. + } + + class F { + @dec1 set x(value: number) { } + @dec2 get x() { return 0; } + ~ +!!! error TS1207: Decorators cannot be applied to multiple get/set accessors of the same name. + } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassAccessor7.js b/tests/baselines/reference/decoratorOnClassAccessor7.js new file mode 100644 index 00000000000..5ae0c29c14b --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor7.js @@ -0,0 +1,125 @@ +//// [decoratorOnClassAccessor7.ts] +declare function dec1(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +declare function dec2(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; + +class A { + @dec1 get x() { return 0; } + set x(value: number) { } +} + +class B { + get x() { return 0; } + @dec2 set x(value: number) { } +} + +class C { + @dec1 set x(value: number) { } + get x() { return 0; } +} + +class D { + set x(value: number) { } + @dec2 get x() { return 0; } +} + +class E { + @dec1 get x() { return 0; } + @dec2 set x(value: number) { } +} + +class F { + @dec1 set x(value: number) { } + @dec2 get x() { return 0; } +} + +//// [decoratorOnClassAccessor7.js] +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var A = (function () { + function A() { + } + Object.defineProperty(A.prototype, "x", { + get: function () { return 0; }, + set: function (value) { }, + enumerable: true, + configurable: true + }); + return A; +}()); +__decorate([ + dec1 +], A.prototype, "x", null); +var B = (function () { + function B() { + } + Object.defineProperty(B.prototype, "x", { + get: function () { return 0; }, + set: function (value) { }, + enumerable: true, + configurable: true + }); + return B; +}()); +__decorate([ + dec2 +], B.prototype, "x", null); +var C = (function () { + function C() { + } + Object.defineProperty(C.prototype, "x", { + get: function () { return 0; }, + set: function (value) { }, + enumerable: true, + configurable: true + }); + return C; +}()); +__decorate([ + dec1 +], C.prototype, "x", null); +var D = (function () { + function D() { + } + Object.defineProperty(D.prototype, "x", { + get: function () { return 0; }, + set: function (value) { }, + enumerable: true, + configurable: true + }); + return D; +}()); +__decorate([ + dec2 +], D.prototype, "x", null); +var E = (function () { + function E() { + } + Object.defineProperty(E.prototype, "x", { + get: function () { return 0; }, + set: function (value) { }, + enumerable: true, + configurable: true + }); + return E; +}()); +__decorate([ + dec1 +], E.prototype, "x", null); +var F = (function () { + function F() { + } + Object.defineProperty(F.prototype, "x", { + get: function () { return 0; }, + set: function (value) { }, + enumerable: true, + configurable: true + }); + return F; +}()); +__decorate([ + dec1 +], F.prototype, "x", null); diff --git a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor7.ts b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor7.ts new file mode 100644 index 00000000000..b20a5a85dfb --- /dev/null +++ b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor7.ts @@ -0,0 +1,34 @@ +// @target:es5 +// @experimentaldecorators: true +declare function dec1(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +declare function dec2(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; + +class A { + @dec1 get x() { return 0; } + set x(value: number) { } +} + +class B { + get x() { return 0; } + @dec2 set x(value: number) { } +} + +class C { + @dec1 set x(value: number) { } + get x() { return 0; } +} + +class D { + set x(value: number) { } + @dec2 get x() { return 0; } +} + +class E { + @dec1 get x() { return 0; } + @dec2 set x(value: number) { } +} + +class F { + @dec1 set x(value: number) { } + @dec2 get x() { return 0; } +} \ No newline at end of file From 8dcbea9675f66787ef3c560ff17e45f8932964ce Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 7 Dec 2016 17:17:17 -0800 Subject: [PATCH 21/21] Fix await for inherited promise --- src/compiler/checker.ts | 2 +- .../reference/awaitInheritedPromise_es2017.js | 11 +++++++++++ .../awaitInheritedPromise_es2017.symbols | 15 +++++++++++++++ .../reference/awaitInheritedPromise_es2017.types | 16 ++++++++++++++++ .../async/es2017/awaitInheritedPromise_es2017.ts | 7 +++++++ 5 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/awaitInheritedPromise_es2017.js create mode 100644 tests/baselines/reference/awaitInheritedPromise_es2017.symbols create mode 100644 tests/baselines/reference/awaitInheritedPromise_es2017.types create mode 100644 tests/cases/conformance/async/es2017/awaitInheritedPromise_es2017.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cdef31ee400..dc97d347e95 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16207,7 +16207,7 @@ namespace ts { return undefined; } - const onfulfilledParameterType = getTypeWithFacts(getUnionType(map(thenSignatures, getTypeOfFirstParameterOfSignature)), TypeFacts.NEUndefined); + const onfulfilledParameterType = getTypeWithFacts(getUnionType(map(thenSignatures, getTypeOfFirstParameterOfSignature)), TypeFacts.NEUndefinedOrNull); if (isTypeAny(onfulfilledParameterType)) { return undefined; } diff --git a/tests/baselines/reference/awaitInheritedPromise_es2017.js b/tests/baselines/reference/awaitInheritedPromise_es2017.js new file mode 100644 index 00000000000..e973d0b166a --- /dev/null +++ b/tests/baselines/reference/awaitInheritedPromise_es2017.js @@ -0,0 +1,11 @@ +//// [awaitInheritedPromise_es2017.ts] +interface A extends Promise {} +declare var a: A; +async function f() { + await a; +} + +//// [awaitInheritedPromise_es2017.js] +async function f() { + await a; +} diff --git a/tests/baselines/reference/awaitInheritedPromise_es2017.symbols b/tests/baselines/reference/awaitInheritedPromise_es2017.symbols new file mode 100644 index 00000000000..ef68d16b678 --- /dev/null +++ b/tests/baselines/reference/awaitInheritedPromise_es2017.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/async/es2017/awaitInheritedPromise_es2017.ts === +interface A extends Promise {} +>A : Symbol(A, Decl(awaitInheritedPromise_es2017.ts, 0, 0)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) + +declare var a: A; +>a : Symbol(a, Decl(awaitInheritedPromise_es2017.ts, 1, 11)) +>A : Symbol(A, Decl(awaitInheritedPromise_es2017.ts, 0, 0)) + +async function f() { +>f : Symbol(f, Decl(awaitInheritedPromise_es2017.ts, 1, 17)) + + await a; +>a : Symbol(a, Decl(awaitInheritedPromise_es2017.ts, 1, 11)) +} diff --git a/tests/baselines/reference/awaitInheritedPromise_es2017.types b/tests/baselines/reference/awaitInheritedPromise_es2017.types new file mode 100644 index 00000000000..bed681181b0 --- /dev/null +++ b/tests/baselines/reference/awaitInheritedPromise_es2017.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/async/es2017/awaitInheritedPromise_es2017.ts === +interface A extends Promise {} +>A : A +>Promise : Promise + +declare var a: A; +>a : A +>A : A + +async function f() { +>f : () => Promise + + await a; +>await a : string +>a : A +} diff --git a/tests/cases/conformance/async/es2017/awaitInheritedPromise_es2017.ts b/tests/cases/conformance/async/es2017/awaitInheritedPromise_es2017.ts new file mode 100644 index 00000000000..c5cd486e0f0 --- /dev/null +++ b/tests/cases/conformance/async/es2017/awaitInheritedPromise_es2017.ts @@ -0,0 +1,7 @@ +// @target: es2017 +// @strictNullChecks: true +interface A extends Promise {} +declare var a: A; +async function f() { + await a; +} \ No newline at end of file