diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f6927925428..279fef73d5e 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -739,6 +739,7 @@ namespace ts { } export interface ComputedPropertyName extends Node { + parent: Declaration; kind: SyntaxKind.ComputedPropertyName; expression: Expression; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 47bf4193bd6..7a128a41c69 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2384,29 +2384,33 @@ namespace ts { } // See GH#16030 - export function isAnyDeclarationName(name: Node): boolean { + export function getDeclarationFromName(name: Node): Declaration | undefined { + const parent = name.parent; switch (name.kind) { - case SyntaxKind.Identifier: case SyntaxKind.StringLiteral: - case SyntaxKind.NumericLiteral: { - const parent = name.parent; + case SyntaxKind.NumericLiteral: + if (isComputedPropertyName(parent)) return parent.parent; + // falls through + + case SyntaxKind.Identifier: if (isDeclaration(parent)) { - return parent.name === name; + return parent.name === name ? parent : undefined; } - else if (isQualifiedName(name.parent)) { - const tag = name.parent.parent; - return isJSDocParameterTag(tag) && tag.name === name.parent; + else if (isQualifiedName(parent)) { + const tag = parent.parent; + return isJSDocParameterTag(tag) && tag.name === parent ? tag : undefined; } else { - const binExp = name.parent.parent; + const binExp = parent.parent; return isBinaryExpression(binExp) && getSpecialPropertyAssignmentKind(binExp) !== SpecialPropertyAssignmentKind.None && (binExp.left.symbol || binExp.symbol) && - getNameOfDeclaration(binExp) === name; + getNameOfDeclaration(binExp) === name + ? binExp + : undefined; } - } default: - return false; + return undefined; } } diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 81da5a0d82f..bcc68162746 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -154,7 +154,7 @@ namespace ts.FindAllReferences { textSpan: getTextSpan(node, sourceFile), isWriteAccess: isWriteAccessForReference(node), isDefinition: node.kind === SyntaxKind.DefaultKeyword - || isAnyDeclarationName(node) + || !!getDeclarationFromName(node) || isLiteralComputedPropertyDeclarationName(node), isInString, }; @@ -223,7 +223,65 @@ namespace ts.FindAllReferences { /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ function isWriteAccessForReference(node: Node): boolean { - return node.kind === SyntaxKind.DefaultKeyword || isAnyDeclarationName(node) || isWriteAccess(node); + const decl = getDeclarationFromName(node); + return !!decl && declarationIsWriteAccess(decl) || node.kind === SyntaxKind.DefaultKeyword || isWriteAccess(node); + } + + /** + * True if 'decl' provides a value, as in `function f() {}`; + * false if 'decl' is just a location for a future write, as in 'let x;' + */ + function declarationIsWriteAccess(decl: Declaration): boolean { + // Consider anything in an ambient declaration to be a write access since it may be coming from JS. + if (!!(decl.flags & NodeFlags.Ambient)) return true; + + switch (decl.kind) { + case SyntaxKind.BinaryExpression: + case SyntaxKind.BindingElement: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: + case SyntaxKind.DefaultKeyword: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.EnumMember: + case SyntaxKind.ExportSpecifier: + case SyntaxKind.ImportClause: // default import + case SyntaxKind.ImportEqualsDeclaration: + case SyntaxKind.ImportSpecifier: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.JSDocCallbackTag: + case SyntaxKind.JSDocTypedefTag: + case SyntaxKind.JsxAttribute: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.NamespaceExportDeclaration: + case SyntaxKind.NamespaceImport: + case SyntaxKind.Parameter: + case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: + case SyntaxKind.TypeAliasDeclaration: + case SyntaxKind.TypeParameter: + return true; + + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.Constructor: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return !!(decl as FunctionDeclaration | FunctionExpression | ConstructorDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration).body; + + case SyntaxKind.VariableDeclaration: + case SyntaxKind.PropertyDeclaration: + return !!(decl as VariableDeclaration | PropertyDeclaration).initializer || isCatchClause(decl.parent); + + case SyntaxKind.MethodSignature: + case SyntaxKind.PropertySignature: + case SyntaxKind.JSDocPropertyTag: + case SyntaxKind.JSDocParameterTag: + return false; + + default: + return Debug.failBadSyntaxKind(decl); + } } } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 3e54190429b..2fa23f14a7b 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -536,6 +536,7 @@ declare namespace ts { name?: Identifier | StringLiteral | NumericLiteral; } interface ComputedPropertyName extends Node { + parent: Declaration; kind: SyntaxKind.ComputedPropertyName; expression: Expression; } diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 8d8690781d0..8290cb96236 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -536,6 +536,7 @@ declare namespace ts { name?: Identifier | StringLiteral | NumericLiteral; } interface ComputedPropertyName extends Node { + parent: Declaration; kind: SyntaxKind.ComputedPropertyName; expression: Expression; } diff --git a/tests/cases/fourslash/findAllReferencesJsDocTypeLiteral.ts b/tests/cases/fourslash/findAllReferencesJsDocTypeLiteral.ts index 48befe13442..25059d028ed 100644 --- a/tests/cases/fourslash/findAllReferencesJsDocTypeLiteral.ts +++ b/tests/cases/fourslash/findAllReferencesJsDocTypeLiteral.ts @@ -8,7 +8,7 @@ //// * @param {string} o.x - a thing, its ok //// * @param {number} o.y - another thing //// * @param {Object} o.nested - very nested -//// * @param {boolean} o.nested.[|{| "isWriteAccess": true, "isDefinition": true |}great|] - much greatness +//// * @param {boolean} o.nested.[|{| "isDefinition": true |}great|] - much greatness //// * @param {number} o.nested.times - twice? probably!?? //// */ //// function f(o) { return o.nested.[|great|]; } diff --git a/tests/cases/fourslash/findAllRefsDestructureGeneric.ts b/tests/cases/fourslash/findAllRefsDestructureGeneric.ts index f3d4635cebd..3d7a84cb35a 100644 --- a/tests/cases/fourslash/findAllRefsDestructureGeneric.ts +++ b/tests/cases/fourslash/findAllRefsDestructureGeneric.ts @@ -1,7 +1,7 @@ /// ////interface I { -//// [|{| "isWriteAccess": true, "isDefinition": true |}x|]: boolean; +//// [|{| "isDefinition": true |}x|]: boolean; ////} ////declare const i: I; ////const { [|{| "isWriteAccess": true, "isDefinition": true |}x|] } = i; diff --git a/tests/cases/fourslash/findAllRefsForComputedProperties.ts b/tests/cases/fourslash/findAllRefsForComputedProperties.ts index 7dac0432e94..3c442b8b63a 100644 --- a/tests/cases/fourslash/findAllRefsForComputedProperties.ts +++ b/tests/cases/fourslash/findAllRefsForComputedProperties.ts @@ -9,7 +9,7 @@ ////} //// ////var x: I = { -//// ["[|{| "isDefinition": true |}prop1|]"]: function () { }, +//// ["[|{| "isWriteAccess": true, "isDefinition": true |}prop1|]"]: function () { }, ////} const ranges = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsForComputedProperties2.ts b/tests/cases/fourslash/findAllRefsForComputedProperties2.ts index 81abd714d32..21f9d2c92ba 100644 --- a/tests/cases/fourslash/findAllRefsForComputedProperties2.ts +++ b/tests/cases/fourslash/findAllRefsForComputedProperties2.ts @@ -9,7 +9,7 @@ ////} //// ////var x: I = { -//// ["[|{| "isDefinition": true |}42|]"]: function () { } +//// ["[|{| "isWriteAccess": true, "isDefinition": true |}42|]"]: function () { } ////} const ranges = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsForMappedType.ts b/tests/cases/fourslash/findAllRefsForMappedType.ts index 904dc8c42c7..8965fa046ea 100644 --- a/tests/cases/fourslash/findAllRefsForMappedType.ts +++ b/tests/cases/fourslash/findAllRefsForMappedType.ts @@ -1,6 +1,6 @@ /// -////interface T { [|{| "isWriteAccess": true, "isDefinition": true |}a|]: number }; +////interface T { [|{| "isDefinition": true |}a|]: number }; ////type U = { [K in keyof T]: string }; ////type V = { [K in keyof U]: boolean }; ////const u: U = { [|{| "isWriteAccess": true, "isDefinition": true |}a|]: "" } diff --git a/tests/cases/fourslash/findAllRefsForObjectSpread.ts b/tests/cases/fourslash/findAllRefsForObjectSpread.ts index c6f111672c8..12c338ca529 100644 --- a/tests/cases/fourslash/findAllRefsForObjectSpread.ts +++ b/tests/cases/fourslash/findAllRefsForObjectSpread.ts @@ -1,7 +1,7 @@ /// -////interface A1 { readonly [|{| "isWriteAccess": true, "isDefinition": true |}a|]: string }; -////interface A2 { [|{| "isWriteAccess": true, "isDefinition": true |}a|]?: number }; +////interface A1 { readonly [|{| "isDefinition": true |}a|]: string }; +////interface A2 { [|{| "isDefinition": true |}a|]?: number }; ////let a1: A1; ////let a2: A2; ////let a12 = { ...a1, ...a2 }; diff --git a/tests/cases/fourslash/findAllRefsForRest.ts b/tests/cases/fourslash/findAllRefsForRest.ts index 026451d68b8..3dac71374f0 100644 --- a/tests/cases/fourslash/findAllRefsForRest.ts +++ b/tests/cases/fourslash/findAllRefsForRest.ts @@ -1,7 +1,7 @@ /// ////interface Gen { //// x: number -//// [|{| "isWriteAccess": true, "isDefinition": true |}parent|]: Gen; +//// [|{| "isDefinition": true |}parent|]: Gen; //// millenial: string; ////} ////let t: Gen; diff --git a/tests/cases/fourslash/findAllRefsInClassExpression.ts b/tests/cases/fourslash/findAllRefsInClassExpression.ts index 19ec2df35d2..8adc64e8e6d 100644 --- a/tests/cases/fourslash/findAllRefsInClassExpression.ts +++ b/tests/cases/fourslash/findAllRefsInClassExpression.ts @@ -1,6 +1,6 @@ /// -////interface I { [|{| "isWriteAccess": true, "isDefinition": true |}boom|](): void; } +////interface I { [|{| "isDefinition": true |}boom|](): void; } ////new class C implements I { //// [|{| "isWriteAccess": true, "isDefinition": true |}boom|](){} ////} diff --git a/tests/cases/fourslash/findAllRefsIndexedAccessTypes.ts b/tests/cases/fourslash/findAllRefsIndexedAccessTypes.ts index fdfb00439f6..49dac247294 100644 --- a/tests/cases/fourslash/findAllRefsIndexedAccessTypes.ts +++ b/tests/cases/fourslash/findAllRefsIndexedAccessTypes.ts @@ -1,8 +1,8 @@ /// ////interface I { -//// [|{| "isDefinition": true, "isWriteAccess": true |}0|]: number; -//// [|{| "isDefinition": true, "isWriteAccess": true |}s|]: string; +//// [|{| "isDefinition": true |}0|]: number; +//// [|{| "isDefinition": true |}s|]: string; ////} ////interface J { //// a: I[[|0|]], diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties1.ts b/tests/cases/fourslash/findAllRefsInheritedProperties1.ts index 3b14e686cc6..9e58a37c589 100644 --- a/tests/cases/fourslash/findAllRefsInheritedProperties1.ts +++ b/tests/cases/fourslash/findAllRefsInheritedProperties1.ts @@ -2,7 +2,7 @@ //// class class1 extends class1 { //// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|]() { } -//// [|{| "isWriteAccess": true, "isDefinition": true |}propName|]: string; +//// [|{| "isDefinition": true |}propName|]: string; //// } //// //// var v: class1; diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties2.ts b/tests/cases/fourslash/findAllRefsInheritedProperties2.ts index 23badd64d48..2e776e48acd 100644 --- a/tests/cases/fourslash/findAllRefsInheritedProperties2.ts +++ b/tests/cases/fourslash/findAllRefsInheritedProperties2.ts @@ -1,8 +1,8 @@ /// //// interface interface1 extends interface1 { -//// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|](): void; // r0 -//// [|{| "isWriteAccess": true, "isDefinition": true |}propName|]: string; // r1 +//// [|{| "isDefinition": true |}doStuff|](): void; // r0 +//// [|{| "isDefinition": true |}propName|]: string; // r1 //// } //// //// var v: interface1; diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties3.ts b/tests/cases/fourslash/findAllRefsInheritedProperties3.ts index 2c929a559fb..ea5b1ce7bf4 100644 --- a/tests/cases/fourslash/findAllRefsInheritedProperties3.ts +++ b/tests/cases/fourslash/findAllRefsInheritedProperties3.ts @@ -2,15 +2,15 @@ //// class class1 extends class1 { //// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|]() { } // r0 -//// [|{| "isWriteAccess": true, "isDefinition": true |}propName|]: string; // r1 +//// [|{| "isDefinition": true |}propName|]: string; // r1 //// } //// interface interface1 extends interface1 { -//// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|](): void; // r2 -//// [|{| "isWriteAccess": true, "isDefinition": true |}propName|]: string; // r3 +//// [|{| "isDefinition": true |}doStuff|](): void; // r2 +//// [|{| "isDefinition": true |}propName|]: string; // r3 //// } //// class class2 extends class1 implements interface1 { //// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|]() { } // r4 -//// [|{| "isWriteAccess": true, "isDefinition": true |}propName|]: string; // r5 +//// [|{| "isDefinition": true |}propName|]: string; // r5 //// } //// //// var v: class2; diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties4.ts b/tests/cases/fourslash/findAllRefsInheritedProperties4.ts index e2d8887bbe8..2528fef1939 100644 --- a/tests/cases/fourslash/findAllRefsInheritedProperties4.ts +++ b/tests/cases/fourslash/findAllRefsInheritedProperties4.ts @@ -1,12 +1,12 @@ /// //// interface C extends D { -//// [|{| "isWriteAccess": true, "isDefinition": true |}prop0|]: string; // r0 -//// [|{| "isWriteAccess": true, "isDefinition": true |}prop1|]: number; // r1 +//// [|{| "isDefinition": true |}prop0|]: string; // r0 +//// [|{| "isDefinition": true |}prop1|]: number; // r1 //// } //// //// interface D extends C { -//// [|{| "isWriteAccess": true, "isDefinition": true |}prop0|]: string; // r2 +//// [|{| "isDefinition": true |}prop0|]: string; // r2 //// } //// //// var d: D; diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties5.ts b/tests/cases/fourslash/findAllRefsInheritedProperties5.ts index c534a9d6aab..343328405d5 100644 --- a/tests/cases/fourslash/findAllRefsInheritedProperties5.ts +++ b/tests/cases/fourslash/findAllRefsInheritedProperties5.ts @@ -1,12 +1,12 @@ /// //// class C extends D { -//// [|{| "isWriteAccess": true, "isDefinition": true |}prop0|]: string; // r0 -//// [|{| "isWriteAccess": true, "isDefinition": true |}prop1|]: number; // r1 +//// [|{| "isDefinition": true |}prop0|]: string; // r0 +//// [|{| "isDefinition": true |}prop1|]: number; // r1 //// } //// //// class D extends C { -//// [|{| "isWriteAccess": true, "isDefinition": true |}prop0|]: string; // r2 +//// [|{| "isDefinition": true |}prop0|]: string; // r2 //// } //// //// var d: D; diff --git a/tests/cases/fourslash/findAllRefsMappedType.ts b/tests/cases/fourslash/findAllRefsMappedType.ts index 97658da08c1..8c6c59150af 100644 --- a/tests/cases/fourslash/findAllRefsMappedType.ts +++ b/tests/cases/fourslash/findAllRefsMappedType.ts @@ -1,6 +1,6 @@ /// -////interface T { [|{| "isWriteAccess": true, "isDefinition": true |}a|]: number; } +////interface T { [|{| "isDefinition": true |}a|]: number; } ////type U = { readonly [K in keyof T]?: string }; ////declare const t: T; ////t.[|a|]; diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName01.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName01.ts index d11bcee506f..5a72ca1c1ec 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName01.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName01.ts @@ -1,7 +1,7 @@ /// ////interface I { -//// [|{| "isWriteAccess": true, "isDefinition": true |}property1|]: number; +//// [|{| "isDefinition": true |}property1|]: number; //// property2: string; ////} //// diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName02.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName02.ts index 6ad98df9cd8..76b6d046b8e 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName02.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName02.ts @@ -1,7 +1,7 @@ /// ////interface I { -//// [|{| "isWriteAccess": true, "isDefinition": true |}property1|]: number; +//// [|{| "isDefinition": true |}property1|]: number; //// property2: string; ////} //// diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName03.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName03.ts index 520dbc8e1e4..f82eca087bb 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName03.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName03.ts @@ -1,7 +1,7 @@ /// ////interface I { -//// [|{| "isWriteAccess": true, "isDefinition": true |}property1|]: number; +//// [|{| "isDefinition": true |}property1|]: number; //// property2: string; ////} //// diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName04.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName04.ts index f25fff9da23..fe0d659f0ec 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName04.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName04.ts @@ -1,7 +1,7 @@ /// ////interface I { -//// [|{| "isWriteAccess": true, "isDefinition": true |}property1|]: number; +//// [|{| "isDefinition": true |}property1|]: number; //// property2: string; ////} //// diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName06.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName06.ts index a8dd5bda227..62d1637f3b3 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName06.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName06.ts @@ -1,7 +1,7 @@ /// ////interface I { -//// [|{| "isWriteAccess": true, "isDefinition": true |}property1|]: number; +//// [|{| "isDefinition": true |}property1|]: number; //// property2: string; ////} //// diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName10.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName10.ts index 500ca7fe3cf..7d31cfd4345 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName10.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName10.ts @@ -1,7 +1,7 @@ /// ////interface Recursive { -//// [|{| "isWriteAccess": true, "isDefinition": true |}next|]?: Recursive; +//// [|{| "isDefinition": true |}next|]?: Recursive; //// value: any; ////} //// diff --git a/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts b/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts index e4e9b830510..d4aefb58ac3 100644 --- a/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts +++ b/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts @@ -1,7 +1,7 @@ /// ////interface IFoo { -//// [|{| "isWriteAccess": true, "isDefinition": true |}a|]: string; +//// [|{| "isDefinition": true |}a|]: string; ////} ////class C { //// method() { diff --git a/tests/cases/fourslash/findAllRefsReExportLocal.ts b/tests/cases/fourslash/findAllRefsReExportLocal.ts index ed1d0b105b6..603971a2294 100644 --- a/tests/cases/fourslash/findAllRefsReExportLocal.ts +++ b/tests/cases/fourslash/findAllRefsReExportLocal.ts @@ -3,7 +3,7 @@ // @noLib: true // @Filename: /a.ts -////var [|{| "isWriteAccess": true, "isDefinition": true |}x|]; +////var [|{| "isDefinition": true |}x|]; ////export { [|{| "isWriteAccess": true, "isDefinition": true |}x|] }; ////export { [|x|] as [|{| "isWriteAccess": true, "isDefinition": true |}y|] }; diff --git a/tests/cases/fourslash/findAllRefsRedeclaredPropertyInDerivedInterface.ts b/tests/cases/fourslash/findAllRefsRedeclaredPropertyInDerivedInterface.ts index 1964ebf2c2c..dff05b219be 100644 --- a/tests/cases/fourslash/findAllRefsRedeclaredPropertyInDerivedInterface.ts +++ b/tests/cases/fourslash/findAllRefsRedeclaredPropertyInDerivedInterface.ts @@ -3,10 +3,10 @@ // @noLib: true ////interface A { -//// readonly [|{| "isWriteAccess": true, "isDefinition": true |}x|]: number | string; +//// readonly [|{| "isDefinition": true |}x|]: number | string; ////} ////interface B extends A { -//// readonly [|{| "isWriteAccess": true, "isDefinition": true |}x|]: number; +//// readonly [|{| "isDefinition": true |}x|]: number; ////} ////const a: A = { [|{| "isWriteAccess": true, "isDefinition": true |}x|]: 0 }; ////const b: B = { [|{| "isWriteAccess": true, "isDefinition": true |}x|]: 0 }; diff --git a/tests/cases/fourslash/findAllRefsRootSymbols.ts b/tests/cases/fourslash/findAllRefsRootSymbols.ts index 77eea3b46b0..0e209765b37 100644 --- a/tests/cases/fourslash/findAllRefsRootSymbols.ts +++ b/tests/cases/fourslash/findAllRefsRootSymbols.ts @@ -1,7 +1,7 @@ /// -////interface I { [|{| "isWriteAccess": true, "isDefinition": true |}x|]: {}; } -////interface J { [|{| "isWriteAccess": true, "isDefinition": true |}x|]: {}; } +////interface I { [|{| "isDefinition": true |}x|]: {}; } +////interface J { [|{| "isDefinition": true |}x|]: {}; } ////declare const o: (I | J) & { [|{| "isWriteAccess": true, "isDefinition": true |}x|]: string }; ////o.[|x|]; diff --git a/tests/cases/fourslash/findAllRefsTypedef.ts b/tests/cases/fourslash/findAllRefsTypedef.ts index ecd690c10e5..2e7d8601656 100644 --- a/tests/cases/fourslash/findAllRefsTypedef.ts +++ b/tests/cases/fourslash/findAllRefsTypedef.ts @@ -5,7 +5,7 @@ // @Filename: /a.js /////** //// * @typedef I {Object} -//// * @prop [|{| "isWriteAccess": true, "isDefinition": true |}p|] {number} +//// * @prop [|{| "isDefinition": true |}p|] {number} //// */ //// /////** @type {I} */ diff --git a/tests/cases/fourslash/findAllRefsUnionProperty.ts b/tests/cases/fourslash/findAllRefsUnionProperty.ts index 97b8972c457..3b7813f638b 100644 --- a/tests/cases/fourslash/findAllRefsUnionProperty.ts +++ b/tests/cases/fourslash/findAllRefsUnionProperty.ts @@ -1,8 +1,8 @@ /// ////type T = -//// | { [|{| "isWriteAccess": true, "isDefinition": true |}type|]: "a", [|{| "isWriteAccess": true, "isDefinition": true |}prop|]: number } -//// | { [|{| "isWriteAccess": true, "isDefinition": true |}type|]: "b", [|{| "isWriteAccess": true, "isDefinition": true |}prop|]: string }; +//// | { [|{| "isDefinition": true |}type|]: "a", [|{| "isDefinition": true |}prop|]: number } +//// | { [|{| "isDefinition": true |}type|]: "b", [|{| "isDefinition": true |}prop|]: string }; ////const tt: T = { //// [|{| "isWriteAccess": true, "isDefinition": true |}type|]: "a", //// [|{| "isWriteAccess": true, "isDefinition": true |}prop|]: 0, diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames5.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames5.ts index d54b48bf662..cf171662596 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames5.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames5.ts @@ -3,7 +3,7 @@ ////class Foo { //// public _bar; //// public __bar; -//// public [|{| "isWriteAccess": true, "isDefinition": true |}___bar|]; +//// public [|{| "isDefinition": true |}___bar|]; //// public ____bar; ////} //// diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames6.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames6.ts index 39bc1d73ca3..77197480eb1 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames6.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames6.ts @@ -2,7 +2,7 @@ ////class Foo { //// public _bar; -//// public [|{| "isWriteAccess": true, "isDefinition": true |}__bar|]; +//// public [|{| "isDefinition": true |}__bar|]; //// public ___bar; //// public ____bar; ////} diff --git a/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts b/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts index 6dbbf9e613b..f19640698cd 100644 --- a/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts +++ b/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts @@ -2,7 +2,7 @@ //// var [|{| "isWriteAccess": true, "isDefinition": true |}dx|] = "Foo"; //// -//// module M { export var [|{| "isWriteAccess": true, "isDefinition": true |}dx|]; } +//// module M { export var [|{| "isDefinition": true |}dx|]; } //// module M { //// var z = 100; //// export var y = { [|{| "isWriteAccess": true, "isDefinition": true |}dx|], z }; diff --git a/tests/cases/fourslash/findReferencesAcrossMultipleProjects.ts b/tests/cases/fourslash/findReferencesAcrossMultipleProjects.ts index f9feb5ddb62..2141399705f 100644 --- a/tests/cases/fourslash/findReferencesAcrossMultipleProjects.ts +++ b/tests/cases/fourslash/findReferencesAcrossMultipleProjects.ts @@ -1,7 +1,7 @@ /// //@Filename: a.ts -////var [|{| "isWriteAccess": true, "isDefinition": true |}x|]: number; +////var [|{| "isDefinition": true |}x|]: number; //@Filename: b.ts /////// diff --git a/tests/cases/fourslash/findReferencesAfterEdit.ts b/tests/cases/fourslash/findReferencesAfterEdit.ts index 599be2255a3..3787617692a 100644 --- a/tests/cases/fourslash/findReferencesAfterEdit.ts +++ b/tests/cases/fourslash/findReferencesAfterEdit.ts @@ -2,7 +2,7 @@ // @Filename: a.ts ////interface A { -//// [|{| "isWriteAccess": true, "isDefinition": true |}foo|]: string; +//// [|{| "isDefinition": true |}foo|]: string; ////} // @Filename: b.ts diff --git a/tests/cases/fourslash/findReferencesJSXTagName3.ts b/tests/cases/fourslash/findReferencesJSXTagName3.ts index 0d5d74b6e2e..58715ade2fa 100644 --- a/tests/cases/fourslash/findReferencesJSXTagName3.ts +++ b/tests/cases/fourslash/findReferencesJSXTagName3.ts @@ -6,7 +6,7 @@ ////namespace JSX { //// export interface Element { } //// export interface IntrinsicElements { -//// [|{| "isWriteAccess": true, "isDefinition": true |}div|]: any; +//// [|{| "isDefinition": true |}div|]: any; //// } ////} //// diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfComputedProperty.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfComputedProperty.ts index e4c3c93d0e1..88ab38e5428 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfComputedProperty.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfComputedProperty.ts @@ -1,5 +1,5 @@ /// -////let o = { ["[|{| "isDefinition": true |}foo|]"]: 12 }; +////let o = { ["[|{| "isWriteAccess": true, "isDefinition": true |}foo|]"]: 12 }; ////let y = o.[|foo|]; ////let z = o['[|foo|]']; diff --git a/tests/cases/fourslash/referencesForClassMembers.ts b/tests/cases/fourslash/referencesForClassMembers.ts index c2eb8706f59..e60c03524a1 100644 --- a/tests/cases/fourslash/referencesForClassMembers.ts +++ b/tests/cases/fourslash/referencesForClassMembers.ts @@ -1,11 +1,11 @@ /// ////class Base { -//// [|{| "isWriteAccess": true, "isDefinition": true |}a|]: number; +//// [|{| "isDefinition": true |}a|]: number; //// [|{| "isWriteAccess": true, "isDefinition": true |}method|](): void { } ////} ////class MyClass extends Base { -//// [|{| "isWriteAccess": true, "isDefinition": true |}a|]; +//// [|{| "isDefinition": true |}a|]; //// [|{| "isWriteAccess": true, "isDefinition": true |}method|]() { } ////} //// diff --git a/tests/cases/fourslash/referencesForClassMembersExtendingAbstractClass.ts b/tests/cases/fourslash/referencesForClassMembersExtendingAbstractClass.ts index 5aaee38d205..12df996629d 100644 --- a/tests/cases/fourslash/referencesForClassMembersExtendingAbstractClass.ts +++ b/tests/cases/fourslash/referencesForClassMembersExtendingAbstractClass.ts @@ -1,11 +1,11 @@ /// ////abstract class Base { -//// abstract [|{| "isWriteAccess": true, "isDefinition": true |}a|]: number; -//// abstract [|{| "isWriteAccess": true, "isDefinition": true |}method|](): void; +//// abstract [|{| "isDefinition": true |}a|]: number; +//// abstract [|{| "isDefinition": true |}method|](): void; ////} ////class MyClass extends Base { -//// [|{| "isWriteAccess": true, "isDefinition": true |}a|]; +//// [|{| "isDefinition": true |}a|]; //// [|{| "isWriteAccess": true, "isDefinition": true |}method|]() { } ////} //// diff --git a/tests/cases/fourslash/referencesForClassMembersExtendingGenericClass.ts b/tests/cases/fourslash/referencesForClassMembersExtendingGenericClass.ts index 6082033b078..103b66ff74b 100644 --- a/tests/cases/fourslash/referencesForClassMembersExtendingGenericClass.ts +++ b/tests/cases/fourslash/referencesForClassMembersExtendingGenericClass.ts @@ -1,11 +1,11 @@ /// ////class Base { -//// [|{| "isWriteAccess": true, "isDefinition": true |}a|]: this; +//// [|{| "isDefinition": true |}a|]: this; //// [|{| "isWriteAccess": true, "isDefinition": true |}method|](a?:T, b?:U): this { } ////} ////class MyClass extends Base { -//// [|{| "isWriteAccess": true, "isDefinition": true |}a|]; +//// [|{| "isDefinition": true |}a|]; //// [|{| "isWriteAccess": true, "isDefinition": true |}method|]() { } ////} //// diff --git a/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts b/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts index f4e0daaab00..67f09a9dcd1 100644 --- a/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts +++ b/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts @@ -1,6 +1,6 @@ /// -////interface IFoo { [|{| "isWriteAccess": true, "isDefinition": true |}xy|]: number; } +////interface IFoo { [|{| "isDefinition": true |}xy|]: number; } //// ////// Assignment ////var a1: IFoo = { [|{| "isWriteAccess": true, "isDefinition": true |}xy|]: 0 }; diff --git a/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties.ts b/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties.ts index 9ddd31f2fbb..b0bb5d62b4d 100644 --- a/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties.ts +++ b/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties.ts @@ -2,12 +2,12 @@ ////interface A { //// a: number; -//// [|{| "isWriteAccess": true, "isDefinition": true |}common|]: string; +//// [|{| "isDefinition": true |}common|]: string; ////} //// ////interface B { //// b: number; -//// [|{| "isWriteAccess": true, "isDefinition": true |}common|]: number; +//// [|{| "isDefinition": true |}common|]: number; ////} //// ////// Assignment diff --git a/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts b/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts index 3ea7cd9b275..a9741d3e39d 100644 --- a/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts +++ b/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts @@ -6,7 +6,7 @@ ////} //// ////interface B { -//// [|{| "isWriteAccess": true, "isDefinition": true |}b|]: number; +//// [|{| "isDefinition": true |}b|]: number; //// common: number; ////} //// diff --git a/tests/cases/fourslash/referencesForFunctionOverloads.ts b/tests/cases/fourslash/referencesForFunctionOverloads.ts index 7afa5a20133..2a1ea032e20 100644 --- a/tests/cases/fourslash/referencesForFunctionOverloads.ts +++ b/tests/cases/fourslash/referencesForFunctionOverloads.ts @@ -2,7 +2,7 @@ // Function overloads should be highlighted together. -////function [|{| "isWriteAccess": true, "isDefinition": true |}foo|](x: string); +////function [|{| "isDefinition": true |}foo|](x: string); ////function [|{| "isWriteAccess": true, "isDefinition": true |}foo|](x: string, y: number) { //// [|foo|]('', 43); ////} diff --git a/tests/cases/fourslash/referencesForIndexProperty.ts b/tests/cases/fourslash/referencesForIndexProperty.ts index dba2549e414..4bc0b3620ea 100644 --- a/tests/cases/fourslash/referencesForIndexProperty.ts +++ b/tests/cases/fourslash/referencesForIndexProperty.ts @@ -3,7 +3,7 @@ // References a class property using string index access ////class Foo { -//// [|{| "isWriteAccess": true, "isDefinition": true |}property|]: number; +//// [|{| "isDefinition": true |}property|]: number; //// [|{| "isWriteAccess": true, "isDefinition": true |}method|](): void { } ////} //// diff --git a/tests/cases/fourslash/referencesForIndexProperty3.ts b/tests/cases/fourslash/referencesForIndexProperty3.ts index a2e008c937e..69417700ed0 100644 --- a/tests/cases/fourslash/referencesForIndexProperty3.ts +++ b/tests/cases/fourslash/referencesForIndexProperty3.ts @@ -3,7 +3,7 @@ // References to a property of the apparent type using string indexer ////interface Object { -//// [|{| "isWriteAccess": true, "isDefinition": true |}toMyString|](); +//// [|{| "isDefinition": true |}toMyString|](); ////} //// ////var y: Object; diff --git a/tests/cases/fourslash/referencesForInheritedProperties.ts b/tests/cases/fourslash/referencesForInheritedProperties.ts index 808387d18f7..88d7ea7537d 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties.ts @@ -1,11 +1,11 @@ /// ////interface interface1 { -//// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|](): void; +//// [|{| "isDefinition": true |}doStuff|](): void; ////} //// ////interface interface2 extends interface1{ -//// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|](): void; +//// [|{| "isDefinition": true |}doStuff|](): void; ////} //// ////class class1 implements interface2 { diff --git a/tests/cases/fourslash/referencesForInheritedProperties2.ts b/tests/cases/fourslash/referencesForInheritedProperties2.ts index f41fbb7f8db..712c7f2ecf2 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties2.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties2.ts @@ -3,11 +3,11 @@ // extends statement in a diffrent declaration ////interface interface1 { -//// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|](): void; +//// [|{| "isDefinition": true |}doStuff|](): void; ////} //// ////interface interface2 { -//// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|](): void; +//// [|{| "isDefinition": true |}doStuff|](): void; ////} //// ////interface interface2 extends interface1 { diff --git a/tests/cases/fourslash/referencesForInheritedProperties3.ts b/tests/cases/fourslash/referencesForInheritedProperties3.ts index c6c870ca350..0eabc6cda9e 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties3.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties3.ts @@ -1,8 +1,8 @@ /// //// interface interface1 extends interface1 { -//// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|](): void; -//// [|{| "isWriteAccess": true, "isDefinition": true |}propName|]: string; +//// [|{| "isDefinition": true |}doStuff|](): void; +//// [|{| "isDefinition": true |}propName|]: string; //// } //// //// var v: interface1; diff --git a/tests/cases/fourslash/referencesForInheritedProperties4.ts b/tests/cases/fourslash/referencesForInheritedProperties4.ts index adf8240ea31..f6a7d48f9d1 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties4.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties4.ts @@ -2,7 +2,7 @@ //// class class1 extends class1 { //// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|]() { } -//// [|{| "isWriteAccess": true, "isDefinition": true |}propName|]: string; +//// [|{| "isDefinition": true |}propName|]: string; //// } //// //// var c: class1; diff --git a/tests/cases/fourslash/referencesForInheritedProperties5.ts b/tests/cases/fourslash/referencesForInheritedProperties5.ts index 12fe3919a1d..232b654c63f 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties5.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties5.ts @@ -1,12 +1,12 @@ /// //// interface interface1 extends interface1 { -//// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|](): void; -//// [|{| "isWriteAccess": true, "isDefinition": true |}propName|]: string; +//// [|{| "isDefinition": true |}doStuff|](): void; +//// [|{| "isDefinition": true |}propName|]: string; //// } //// interface interface2 extends interface1 { -//// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|](): void; -//// [|{| "isWriteAccess": true, "isDefinition": true |}propName|]: string; +//// [|{| "isDefinition": true |}doStuff|](): void; +//// [|{| "isDefinition": true |}propName|]: string; //// } //// //// var v: interface1; diff --git a/tests/cases/fourslash/referencesForInheritedProperties7.ts b/tests/cases/fourslash/referencesForInheritedProperties7.ts index 44cf510182a..25402d36b6e 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties7.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties7.ts @@ -2,15 +2,15 @@ //// class class1 extends class1 { //// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|]() { } -//// [|{| "isWriteAccess": true, "isDefinition": true |}propName|]: string; +//// [|{| "isDefinition": true |}propName|]: string; //// } //// interface interface1 extends interface1 { -//// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|](): void; -//// [|{| "isWriteAccess": true, "isDefinition": true |}propName|]: string; +//// [|{| "isDefinition": true |}doStuff|](): void; +//// [|{| "isDefinition": true |}propName|]: string; //// } //// class class2 extends class1 implements interface1 { //// [|{| "isWriteAccess": true, "isDefinition": true |}doStuff|]() { } -//// [|{| "isWriteAccess": true, "isDefinition": true |}propName|]: string; +//// [|{| "isDefinition": true |}propName|]: string; //// } //// //// var v: class2; diff --git a/tests/cases/fourslash/referencesForInheritedProperties8.ts b/tests/cases/fourslash/referencesForInheritedProperties8.ts index d0d94b49b57..331a90f9181 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties8.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties8.ts @@ -1,11 +1,11 @@ /// //// interface C extends D { -//// [|{| "isWriteAccess": true, "isDefinition": true |}propD|]: number; +//// [|{| "isDefinition": true |}propD|]: number; //// } //// interface D extends C { -//// [|{| "isWriteAccess": true, "isDefinition": true |}propD|]: string; -//// [|{| "isWriteAccess": true, "isDefinition": true |}propC|]: number; +//// [|{| "isDefinition": true |}propD|]: string; +//// [|{| "isDefinition": true |}propC|]: number; //// } //// var d: D; //// d.[|propD|]; diff --git a/tests/cases/fourslash/referencesForInheritedProperties9.ts b/tests/cases/fourslash/referencesForInheritedProperties9.ts index 27bc164a8fc..3648be2f989 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties9.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties9.ts @@ -1,11 +1,11 @@ /// //// class D extends C { -//// [|{| "isWriteAccess": true, "isDefinition": true |}prop1|]: string; +//// [|{| "isDefinition": true |}prop1|]: string; //// } //// //// class C extends D { -//// [|{| "isWriteAccess": true, "isDefinition": true |}prop1|]: string; +//// [|{| "isDefinition": true |}prop1|]: string; //// } //// //// var c: C; diff --git a/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts b/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts index 79dc04ecaee..1f28714daa1 100644 --- a/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts +++ b/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts @@ -1,7 +1,7 @@ /// ////class Foo { -//// public [|{| "isWriteAccess": true, "isDefinition": true |}12|]: any; +//// public [|{| "isDefinition": true |}12|]: any; ////} //// ////var x: Foo; diff --git a/tests/cases/fourslash/referencesForOverrides.ts b/tests/cases/fourslash/referencesForOverrides.ts index ab3d60f1b86..d5d9ea0a6b6 100644 --- a/tests/cases/fourslash/referencesForOverrides.ts +++ b/tests/cases/fourslash/referencesForOverrides.ts @@ -14,16 +14,16 @@ //// //// module SimpleInterfaceTest { //// export interface IFoo { -//// [|{| "isWriteAccess": true, "isDefinition": true |}ifoo|](): void; +//// [|{| "isDefinition": true |}ifoo|](): void; //// } //// export interface IBar extends IFoo { -//// [|{| "isWriteAccess": true, "isDefinition": true |}ifoo|](): void; +//// [|{| "isDefinition": true |}ifoo|](): void; //// } //// } //// //// module SimpleClassInterfaceTest { //// export interface IFoo { -//// [|{| "isWriteAccess": true, "isDefinition": true |}icfoo|](): void; +//// [|{| "isDefinition": true |}icfoo|](): void; //// } //// export class Bar implements IFoo { //// public [|{| "isWriteAccess": true, "isDefinition": true |}icfoo|](): void { @@ -33,29 +33,29 @@ //// //// module Test { //// export interface IBase { -//// [|{| "isWriteAccess": true, "isDefinition": true |}field|]: string; -//// [|{| "isWriteAccess": true, "isDefinition": true |}method|](): void; +//// [|{| "isDefinition": true |}field|]: string; +//// [|{| "isDefinition": true |}method|](): void; //// } //// //// export interface IBlah extends IBase { -//// [|{| "isWriteAccess": true, "isDefinition": true |}field|]: string; +//// [|{| "isDefinition": true |}field|]: string; //// } //// //// export interface IBlah2 extends IBlah { -//// [|{| "isWriteAccess": true, "isDefinition": true |}field|]: string; +//// [|{| "isDefinition": true |}field|]: string; //// } //// //// export interface IDerived extends IBlah2 { -//// [|{| "isWriteAccess": true, "isDefinition": true |}method|](): void; +//// [|{| "isDefinition": true |}method|](): void; //// } //// //// export class Bar implements IDerived { -//// public [|{| "isWriteAccess": true, "isDefinition": true |}field|]: string; +//// public [|{| "isDefinition": true |}field|]: string; //// public [|{| "isWriteAccess": true, "isDefinition": true |}method|](): void { } //// } //// //// export class BarBlah extends Bar { -//// public [|{| "isWriteAccess": true, "isDefinition": true |}field|]: string; +//// public [|{| "isDefinition": true |}field|]: string; //// } //// } //// diff --git a/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts b/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts index a84bdc6315a..be00bb7593f 100644 --- a/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts +++ b/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts @@ -1,7 +1,7 @@ /// ////interface IFoo { -//// [|{| "isWriteAccess": true, "isDefinition": true |}doSomething|](v: T): T; +//// [|{| "isDefinition": true |}doSomething|](v: T): T; ////} //// ////var x: IFoo; diff --git a/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts b/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts index 9e7f30f4c49..816b866421a 100644 --- a/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts +++ b/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts @@ -3,8 +3,8 @@ ////module FindRef4 { //// module MixedStaticsClassTest { //// export class Foo { -//// [|{| "isWriteAccess": true, "isDefinition": true |}bar|]: Foo; -//// static [|{| "isWriteAccess": true, "isDefinition": true |}bar|]: Foo; +//// [|{| "isDefinition": true |}bar|]: Foo; +//// static [|{| "isDefinition": true |}bar|]: Foo; //// //// public [|{| "isWriteAccess": true, "isDefinition": true |}foo|](): void { //// } diff --git a/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts b/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts index 5c98eddadce..88c9a74bc6e 100644 --- a/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts +++ b/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts @@ -1,7 +1,7 @@ /// ////class Foo { -//// public "[|{| "isWriteAccess": true, "isDefinition": true |}ss|]": any; +//// public "[|{| "isDefinition": true |}ss|]": any; ////} //// ////var x: Foo; diff --git a/tests/cases/fourslash/referencesForUnionProperties.ts b/tests/cases/fourslash/referencesForUnionProperties.ts index b8e24dfae1c..7efff1aabd0 100644 --- a/tests/cases/fourslash/referencesForUnionProperties.ts +++ b/tests/cases/fourslash/referencesForUnionProperties.ts @@ -1,16 +1,16 @@ /// ////interface One { -//// common: { [|{| "isWriteAccess": true, "isDefinition": true |}a|]: number; }; +//// common: { [|{| "isDefinition": true |}a|]: number; }; ////} //// ////interface Base { -//// [|{| "isWriteAccess": true, "isDefinition": true |}a|]: string; +//// [|{| "isDefinition": true |}a|]: string; //// b: string; ////} //// ////interface HasAOrB extends Base { -//// [|{| "isWriteAccess": true, "isDefinition": true |}a|]: string; +//// [|{| "isDefinition": true |}a|]: string; //// b: string; ////} //// diff --git a/tests/cases/fourslash/renameImportAndExportInDiffFiles.ts b/tests/cases/fourslash/renameImportAndExportInDiffFiles.ts index a961ebf2411..96d423529c2 100644 --- a/tests/cases/fourslash/renameImportAndExportInDiffFiles.ts +++ b/tests/cases/fourslash/renameImportAndExportInDiffFiles.ts @@ -1,7 +1,7 @@ /// // @Filename: a.ts -////export var [|{| "isWriteAccess": true, "isDefinition": true |}a|]; +////export var [|{| "isDefinition": true |}a|]; // @Filename: b.ts ////import { [|{| "isWriteAccess": true, "isDefinition": true |}a|] } from './a'; diff --git a/tests/cases/fourslash/tsxFindAllReferences10.ts b/tests/cases/fourslash/tsxFindAllReferences10.ts index 04ac864e4f2..58459c7df1f 100644 --- a/tests/cases/fourslash/tsxFindAllReferences10.ts +++ b/tests/cases/fourslash/tsxFindAllReferences10.ts @@ -15,7 +15,7 @@ //// className?: string; //// } //// interface ButtonProps extends ClickableProps { -//// [|{| "isWriteAccess": true, "isDefinition": true |}onClick|](event?: React.MouseEvent): void; +//// [|{| "isDefinition": true |}onClick|](event?: React.MouseEvent): void; //// } //// interface LinkProps extends ClickableProps { //// goTo: string; diff --git a/tests/cases/fourslash/tsxFindAllReferences3.ts b/tests/cases/fourslash/tsxFindAllReferences3.ts index 2682e01e7d1..e2f9215466a 100644 --- a/tests/cases/fourslash/tsxFindAllReferences3.ts +++ b/tests/cases/fourslash/tsxFindAllReferences3.ts @@ -9,7 +9,7 @@ //// } //// class MyClass { //// props: { -//// [|{| "isWriteAccess": true, "isDefinition": true |}name|]?: string; +//// [|{| "isDefinition": true |}name|]?: string; //// size?: number; //// } //// diff --git a/tests/cases/fourslash/tsxFindAllReferences7.ts b/tests/cases/fourslash/tsxFindAllReferences7.ts index 37ea60c7a38..471cf747258 100644 --- a/tests/cases/fourslash/tsxFindAllReferences7.ts +++ b/tests/cases/fourslash/tsxFindAllReferences7.ts @@ -11,7 +11,7 @@ //// interface ElementAttributesProperty { props; } //// } //// interface OptionPropBag { -//// [|{| "isWriteAccess": true, "isDefinition": true |}propx|]: number +//// [|{| "isDefinition": true |}propx|]: number //// propString: string //// optional?: boolean //// } diff --git a/tests/cases/fourslash/tsxFindAllReferences9.ts b/tests/cases/fourslash/tsxFindAllReferences9.ts index 9fe02500ad9..bb45ce590cf 100644 --- a/tests/cases/fourslash/tsxFindAllReferences9.ts +++ b/tests/cases/fourslash/tsxFindAllReferences9.ts @@ -18,7 +18,7 @@ //// onClick(event?: React.MouseEvent): void; //// } //// interface LinkProps extends ClickableProps { -//// [|{| "isWriteAccess": true, "isDefinition": true |}goTo|]: string; +//// [|{| "isDefinition": true |}goTo|]: string; //// } //// declare function MainButton(buttonProps: ButtonProps): JSX.Element; //// declare function MainButton(linkProps: LinkProps): JSX.Element;