Make isDefinition aware of declaring symbol (#45920)

* Make isDefinition aware of target symbol

Initial code, haven't fixed any tests yet.

* Update baselines

This commit includes a regression for commonjs aliases:

```js
// @filename: a.js
function f() { }
module.exports.f = f

// @filename: b.js
const { f } = require('./a')
f/**/
```

Now says that `f` in b.js has 1 reference --
the alias `module.exports.f = f`. This is not correct (or not exactly
correct), but correctly fixing will involve re-creating the ad-hoc
commonjs alias resolution code from the checker. I don't think it's
worth it for an edge case like this.

* update more unit tests

* Fix symbol lookup for constructors

* More baselines + two fixes

1. Fix `default` support.
2. Add a secondary declaration location for commonjs assignment
declarations.

* Update rest of baselines

* Switch a few more tests over to baselines
This commit is contained in:
Nathan Shively-Sanders
2021-09-22 13:43:52 -07:00
committed by GitHub
parent 110b05987e
commit f0fe1b88ca
145 changed files with 3552 additions and 705 deletions
+14 -8
View File
@@ -208,11 +208,12 @@ namespace ts.FindAllReferences {
const node = getTouchingPropertyName(sourceFile, position);
const referencedSymbols = Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, { use: FindReferencesUse.References });
const checker = program.getTypeChecker();
const symbol = checker.getSymbolAtLocation(node);
return !referencedSymbols || !referencedSymbols.length ? undefined : mapDefined<SymbolAndEntries, ReferencedSymbol>(referencedSymbols, ({ definition, references }) =>
// Only include referenced symbols that have a valid definition.
definition && {
definition: checker.runWithCancellationToken(cancellationToken, checker => definitionToReferencedSymbolDefinitionInfo(definition, checker, node)),
references: references.map(toReferenceEntry)
references: references.map(r => toReferenceEntry(r, symbol))
});
}
@@ -387,7 +388,7 @@ namespace ts.FindAllReferences {
return { ...entryToDocumentSpan(entry), ...(providePrefixAndSuffixText && getPrefixAndSuffixText(entry, originalNode, checker)) };
}
export function toReferenceEntry(entry: Entry): ReferenceEntry {
export function toReferenceEntry(entry: Entry, symbol: Symbol | undefined): ReferenceEntry {
const documentSpan = entryToDocumentSpan(entry);
if (entry.kind === EntryKind.Span) {
return { ...documentSpan, isWriteAccess: false, isDefinition: false };
@@ -396,7 +397,7 @@ namespace ts.FindAllReferences {
return {
...documentSpan,
isWriteAccess: isWriteAccessForReference(node),
isDefinition: isDefinitionForReference(node),
isDefinition: isDeclarationOfSymbol(node, symbol),
isInString: kind === EntryKind.StringLiteral ? true : undefined,
};
}
@@ -544,11 +545,16 @@ namespace ts.FindAllReferences {
return !!decl && declarationIsWriteAccess(decl) || node.kind === SyntaxKind.DefaultKeyword || isWriteAccess(node);
}
function isDefinitionForReference(node: Node): boolean {
return node.kind === SyntaxKind.DefaultKeyword
|| !!getDeclarationFromName(node)
|| isLiteralComputedPropertyDeclarationName(node)
|| (node.kind === SyntaxKind.ConstructorKeyword && isConstructorDeclaration(node.parent));
/** Whether a reference, `node`, is a definition of the `target` symbol */
function isDeclarationOfSymbol(node: Node, target: Symbol | undefined): boolean {
if (!target) return false;
const source = getDeclarationFromName(node) ||
(node.kind === SyntaxKind.DefaultKeyword ? node.parent
: isLiteralComputedPropertyDeclarationName(node) ? node.parent.parent
: node.kind === SyntaxKind.ConstructorKeyword && isConstructorDeclaration(node.parent) ? node.parent.parent
: undefined);
const commonjsSource = source && isBinaryExpression(source) ? source.left as unknown as Declaration : undefined;
return !!(source && target.declarations?.some(d => d === source || d === commonjsSource));
}
/**
+3 -2
View File
@@ -1763,7 +1763,7 @@ namespace ts {
function getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[] | undefined {
synchronizeHostData();
return getReferencesWorker(getTouchingPropertyName(getValidSourceFile(fileName), position), position, { use: FindAllReferences.FindReferencesUse.References }, FindAllReferences.toReferenceEntry);
return getReferencesWorker(getTouchingPropertyName(getValidSourceFile(fileName), position), position, { use: FindAllReferences.FindReferencesUse.References }, (entry, node, checker) => FindAllReferences.toReferenceEntry(entry, checker.getSymbolAtLocation(node)));
}
function getReferencesWorker<T>(node: Node, position: number, options: FindAllReferences.Options, cb: FindAllReferences.ToReferenceOrRenameEntry<T>): T[] | undefined {
@@ -1784,7 +1784,8 @@ namespace ts {
function getFileReferences(fileName: string): ReferenceEntry[] {
synchronizeHostData();
return FindAllReferences.Core.getReferencesForFileName(fileName, program, program.getSourceFiles()).map(FindAllReferences.toReferenceEntry);
const moduleSymbol = program.getSourceFile(fileName)?.symbol;
return FindAllReferences.Core.getReferencesForFileName(fileName, program, program.getSourceFiles()).map(r => FindAllReferences.toReferenceEntry(r, moduleSymbol));
}
function getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string, excludeDtsFiles = false): NavigateToItem[] {
@@ -32,7 +32,8 @@ ${exportNestedObject}
const referenceMainTs = (mainTs: File, text: string): protocol.ReferencesResponseItem =>
makeReferenceItem({
file: mainTs,
isDefinition: true,
isDefinition: false,
isWriteAccess: true,
lineText: mainTs.content,
contextText: mainTs.content,
text,
@@ -113,8 +114,11 @@ ${exportNestedObject}
referenceMainTs(mainTs, "valueC"),
referenceModTs(
{ text: "valueC", lineText: exportObjectDestructured, contextText: "valueC: 0" },
{ options: { index: 1 } },
),
{
options: { index: 1 },
isDefinition: false,
isWriteAccess: true,
}),
],
symbolDisplayString: "const valueC: number",
symbolName: "valueC",
@@ -171,7 +175,11 @@ ${exportNestedObject}
lineText: exportNestedObject,
contextText: "valueF: 1",
},
{ options: { index: 1 } },
{
options: { index: 1 },
isDefinition: false,
isWriteAccess: true,
},
),
],
symbolDisplayString: "const valueF: number",
@@ -186,7 +186,8 @@ function foo() {
file: keyboardTestTs,
text: searchStr,
contextText: importStr,
isDefinition: true,
isDefinition: false,
isWriteAccess: true,
lineText: importStr
}),
makeReferenceItem({
@@ -200,7 +201,8 @@ function foo() {
file: terminalTs,
text: searchStr,
contextText: importStr,
isDefinition: true,
isDefinition: false,
isWriteAccess: true,
lineText: importStr
}),
makeReferenceItem({
@@ -141,7 +141,7 @@
"length": 49
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -219,7 +219,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -368,7 +368,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -455,7 +455,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -613,7 +613,7 @@
"length": 49
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -691,7 +691,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -78,7 +78,7 @@
"length": 7
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -151,7 +151,7 @@
"length": 39
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -0,0 +1,425 @@
// === /typings/global.d.ts ===
// import * as _THREE from '[|three|]';
// declare global {
// const [|THREE|]: typeof _THREE;
// }
// === /src/index.ts ===
// export const a = {};
// let v = new [|THREE|].Vector2();
// === /node_modules/@types/three/index.d.ts ===
// export * from "./three-core";
// export as namespace /*FIND ALL REFS*/[|THREE|];
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/node_modules/@types/three/index.d.ts",
"kind": "var",
"name": "module THREE\nvar THREE: typeof import(\"/node_modules/@types/three/index\")",
"textSpan": {
"start": 0,
"length": 56
},
"displayParts": [
{
"text": "module",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "THREE",
"kind": "localName"
},
{
"text": "\n",
"kind": "lineBreak"
},
{
"text": "var",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "THREE",
"kind": "localName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "typeof",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "import",
"kind": "keyword"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": "\"/node_modules/@types/three/index\"",
"kind": "stringLiteral"
},
{
"text": ")",
"kind": "punctuation"
}
]
},
"references": [
{
"textSpan": {
"start": 50,
"length": 5
},
"fileName": "/node_modules/@types/three/index.d.ts",
"contextSpan": {
"start": 30,
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
},
{
"textSpan": {
"start": 25,
"length": 5
},
"fileName": "/typings/global.d.ts",
"contextSpan": {
"start": 0,
"length": 32
},
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 60,
"length": 5
},
"fileName": "/typings/global.d.ts",
"contextSpan": {
"start": 54,
"length": 27
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 33,
"length": 5
},
"fileName": "/src/index.ts",
"isWriteAccess": false,
"isDefinition": false
}
]
}
]
// === /typings/global.d.ts ===
// import * as _THREE from '/*FIND ALL REFS*/[|three|]';
// declare global {
// const [|THREE|]: typeof _THREE;
// }
// === /src/index.ts ===
// export const a = {};
// let v = new [|THREE|].Vector2();
// === /node_modules/@types/three/index.d.ts ===
// export * from "./three-core";
// export as namespace [|THREE|];
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/node_modules/@types/three/index.d.ts",
"kind": "var",
"name": "module THREE\nvar THREE: typeof import(\"/node_modules/@types/three/index\")",
"textSpan": {
"start": 0,
"length": 56
},
"displayParts": [
{
"text": "module",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "THREE",
"kind": "localName"
},
{
"text": "\n",
"kind": "lineBreak"
},
{
"text": "var",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "THREE",
"kind": "localName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "typeof",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "import",
"kind": "keyword"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": "\"/node_modules/@types/three/index\"",
"kind": "stringLiteral"
},
{
"text": ")",
"kind": "punctuation"
}
]
},
"references": [
{
"textSpan": {
"start": 50,
"length": 5
},
"fileName": "/node_modules/@types/three/index.d.ts",
"contextSpan": {
"start": 30,
"length": 26
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 25,
"length": 5
},
"fileName": "/typings/global.d.ts",
"contextSpan": {
"start": 0,
"length": 32
},
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 60,
"length": 5
},
"fileName": "/typings/global.d.ts",
"contextSpan": {
"start": 54,
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
},
{
"textSpan": {
"start": 33,
"length": 5
},
"fileName": "/src/index.ts",
"isWriteAccess": false,
"isDefinition": false
}
]
}
]
// === /typings/global.d.ts ===
// import * as _THREE from '[|three|]';
// declare global {
// const /*FIND ALL REFS*/[|THREE|]: typeof _THREE;
// }
// === /src/index.ts ===
// export const a = {};
// let v = new [|THREE|].Vector2();
// === /node_modules/@types/three/index.d.ts ===
// export * from "./three-core";
// export as namespace [|THREE|];
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/node_modules/@types/three/index.d.ts",
"kind": "var",
"name": "module THREE\nvar THREE: typeof import(\"/node_modules/@types/three/index\")",
"textSpan": {
"start": 0,
"length": 56
},
"displayParts": [
{
"text": "module",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "THREE",
"kind": "localName"
},
{
"text": "\n",
"kind": "lineBreak"
},
{
"text": "var",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "THREE",
"kind": "localName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "typeof",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "import",
"kind": "keyword"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": "\"/node_modules/@types/three/index\"",
"kind": "stringLiteral"
},
{
"text": ")",
"kind": "punctuation"
}
]
},
"references": [
{
"textSpan": {
"start": 50,
"length": 5
},
"fileName": "/node_modules/@types/three/index.d.ts",
"contextSpan": {
"start": 30,
"length": 26
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 25,
"length": 5
},
"fileName": "/typings/global.d.ts",
"contextSpan": {
"start": 0,
"length": 32
},
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 60,
"length": 5
},
"fileName": "/typings/global.d.ts",
"contextSpan": {
"start": 54,
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
},
{
"textSpan": {
"start": 33,
"length": 5
},
"fileName": "/src/index.ts",
"isWriteAccess": false,
"isDefinition": false
}
]
}
]
@@ -181,7 +181,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -379,7 +379,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -577,7 +577,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -775,7 +775,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -170,7 +170,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -366,7 +366,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -553,7 +553,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -174,7 +174,7 @@
"length": 24
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -374,7 +374,7 @@
"length": 21
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -565,7 +565,7 @@
"length": 21
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -176,7 +176,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -189,7 +189,7 @@
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -208,7 +208,7 @@
"length": 20
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -176,7 +176,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -185,7 +185,7 @@
},
"fileName": "/a.js",
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -165,7 +165,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -338,7 +338,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -101,7 +101,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -197,7 +197,7 @@
"length": 11
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -91,7 +91,7 @@
"length": 28
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -177,7 +177,7 @@
"length": 21
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -422,7 +422,7 @@
"length": 28
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -508,7 +508,7 @@
"length": 19
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -90,7 +90,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -175,7 +175,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -331,7 +331,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -416,7 +416,7 @@
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -178,7 +178,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -355,7 +355,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -550,7 +550,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -166,7 +166,7 @@
"length": 24
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -340,7 +340,7 @@
"length": 19
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -199,7 +199,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -271,7 +271,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -406,7 +406,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -613,7 +613,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -807,7 +807,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -947,7 +947,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1082,7 +1082,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -119,7 +119,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -197,7 +197,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -311,7 +311,7 @@
"length": 22
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -324,7 +324,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -516,7 +516,7 @@
"length": 22
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -607,7 +607,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -107,7 +107,7 @@
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -185,7 +185,7 @@
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -287,7 +287,7 @@
"length": 13
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -300,7 +300,7 @@
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -480,7 +480,7 @@
"length": 13
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -571,7 +571,7 @@
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -166,7 +166,7 @@
"length": 20
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -164,7 +164,7 @@
"length": 20
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -345,7 +345,7 @@
"length": 20
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -553,7 +553,7 @@
"length": 20
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -770,7 +770,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -978,7 +978,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -109,7 +109,7 @@
"length": 20
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -226,7 +226,7 @@
"length": 28
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -109,7 +109,7 @@
"length": 20
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -166,7 +166,7 @@
"length": 35
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -256,7 +256,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -430,7 +430,7 @@
"length": 35
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -520,7 +520,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -713,7 +713,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -771,7 +771,7 @@
"length": 14
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -977,7 +977,7 @@
"length": 35
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1035,7 +1035,7 @@
"length": 14
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -166,7 +166,7 @@
"length": 35
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -256,7 +256,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -430,7 +430,7 @@
"length": 35
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -520,7 +520,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -713,7 +713,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -771,7 +771,7 @@
"length": 14
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -977,7 +977,7 @@
"length": 35
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1035,7 +1035,7 @@
"length": 14
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -0,0 +1,109 @@
// === /tests/cases/fourslash/findAllRefsForMappedType.ts ===
// interface T { /*FIND ALL REFS*/[|a|]: number };
// type U = { [K in keyof T]: string };
// type V = { [K in keyof U]: boolean };
// const u: U = { [|a|]: "" }
// const v: V = { [|a|]: true }
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/findAllRefsForMappedType.ts",
"kind": "property",
"name": "(property) T.a: number",
"textSpan": {
"start": 14,
"length": 1
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "property",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "T",
"kind": "interfaceName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "a",
"kind": "propertyName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "number",
"kind": "keyword"
}
],
"contextSpan": {
"start": 14,
"length": 9
}
},
"references": [
{
"textSpan": {
"start": 14,
"length": 1
},
"fileName": "/tests/cases/fourslash/findAllRefsForMappedType.ts",
"contextSpan": {
"start": 14,
"length": 9
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 117,
"length": 1
},
"fileName": "/tests/cases/fourslash/findAllRefsForMappedType.ts",
"contextSpan": {
"start": 117,
"length": 5
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 140,
"length": 1
},
"fileName": "/tests/cases/fourslash/findAllRefsForMappedType.ts",
"contextSpan": {
"start": 140,
"length": 7
},
"isWriteAccess": true,
"isDefinition": false
}
]
}
]
@@ -0,0 +1,71 @@
// === /b.ts ===
// /// <reference types="[|foo|]" />
// import { x } from "/*FIND ALL REFS*/[|foo|]";
// declare module "[|foo|]" {}
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/node_modules/foo/index.d.ts",
"kind": "module",
"name": "module \"/node_modules/foo/index\"",
"textSpan": {
"start": 0,
"length": 19
},
"displayParts": [
{
"text": "module",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "\"/node_modules/foo/index\"",
"kind": "stringLiteral"
}
]
},
"references": [
{
"textSpan": {
"start": 22,
"length": 3
},
"fileName": "/b.ts",
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 49,
"length": 3
},
"fileName": "/b.ts",
"contextSpan": {
"start": 30,
"length": 24
},
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 71,
"length": 3
},
"fileName": "/b.ts",
"contextSpan": {
"start": 55,
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
}
]
}
]
@@ -200,7 +200,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -551,7 +551,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -184,7 +184,7 @@
"length": 7
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -511,7 +511,7 @@
"length": 7
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -804,7 +804,7 @@
"length": 7
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1005,7 +1005,7 @@
"length": 7
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1114,7 +1114,7 @@
"length": 7
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -262,7 +262,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -400,7 +400,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -260,7 +260,7 @@
"length": 21
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -250,7 +250,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -398,7 +398,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -674,7 +674,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -822,7 +822,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1098,7 +1098,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1246,7 +1246,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1826,7 +1826,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1839,7 +1839,7 @@
"length": 51
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1982,7 +1982,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2250,7 +2250,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2263,7 +2263,7 @@
"length": 51
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2406,7 +2406,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2674,7 +2674,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2687,7 +2687,7 @@
"length": 51
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2830,7 +2830,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -165,7 +165,7 @@
"length": 8
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -256,7 +256,7 @@
"length": 13
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -177,7 +177,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -355,7 +355,7 @@
"length": 17
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -549,7 +549,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -727,7 +727,7 @@
"length": 17
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -839,7 +839,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -921,7 +921,7 @@
"length": 16
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1115,7 +1115,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1197,7 +1197,7 @@
"length": 16
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1383,7 +1383,7 @@
"length": 17
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1457,7 +1457,7 @@
"length": 17
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1635,7 +1635,7 @@
"length": 17
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1709,7 +1709,7 @@
"length": 17
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -157,7 +157,7 @@
"length": 14
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -257,7 +257,7 @@
"length": 14
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -431,7 +431,7 @@
"length": 14
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -0,0 +1,945 @@
// === /tests/cases/fourslash/findAllRefsIsDefinition.ts ===
// declare function [|foo|](a: number): number;
// declare function [|foo|](a: string): string;
// declare function [|foo|]/*FIND ALL REFS*/(a: string | number): string | number;
//
// function foon(a: number): number;
// function foon(a: string): string;
// function foon(a: string | number): string | number {
// return a
// }
//
// [|foo|]; foon;
//
// export const bar = 123;
// console.log({ bar });
//
// interface IFoo {
// foo(): void;
// }
// class Foo implements IFoo {
// constructor(n: number)
// constructor()
// constructor(n: number?) { }
// foo(): void { }
// static init() { return new this() }
// }
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"kind": "function",
"name": "function foo(a: number): number (+2 overloads)",
"textSpan": {
"start": 17,
"length": 3
},
"displayParts": [
{
"text": "function",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "foo",
"kind": "functionName"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": "a",
"kind": "parameterName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "number",
"kind": "keyword"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "number",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": "+",
"kind": "operator"
},
{
"text": "2",
"kind": "numericLiteral"
},
{
"text": " ",
"kind": "space"
},
{
"text": "overloads",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
}
],
"contextSpan": {
"start": 0,
"length": 40
}
},
"references": [
{
"textSpan": {
"start": 17,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 0,
"length": 40
},
"isWriteAccess": true,
"isDefinition": true
},
{
"textSpan": {
"start": 58,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 41,
"length": 40
},
"isWriteAccess": true,
"isDefinition": true
},
{
"textSpan": {
"start": 99,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 82,
"length": 58
},
"isWriteAccess": true,
"isDefinition": true
},
{
"textSpan": {
"start": 279,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"isWriteAccess": false,
"isDefinition": false
}
]
}
]
// === /tests/cases/fourslash/findAllRefsIsDefinition.ts ===
// declare function foo(a: number): number;
// declare function foo(a: string): string;
// declare function foo(a: string | number): string | number;
//
// function [|foon|](a: number): number;
// function [|foon|](a: string): string;
// function [|foon|]/*FIND ALL REFS*/(a: string | number): string | number {
// return a
// }
//
// foo; [|foon|];
//
// export const bar = 123;
// console.log({ bar });
//
// interface IFoo {
// foo(): void;
// }
// class Foo implements IFoo {
// constructor(n: number)
// constructor()
// constructor(n: number?) { }
// foo(): void { }
// static init() { return new this() }
// }
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"kind": "function",
"name": "function foon(a: number): number (+1 overload)",
"textSpan": {
"start": 151,
"length": 4
},
"displayParts": [
{
"text": "function",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "foon",
"kind": "functionName"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": "a",
"kind": "parameterName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "number",
"kind": "keyword"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "number",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": "+",
"kind": "operator"
},
{
"text": "1",
"kind": "numericLiteral"
},
{
"text": " ",
"kind": "space"
},
{
"text": "overload",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
}
],
"contextSpan": {
"start": 142,
"length": 33
}
},
"references": [
{
"textSpan": {
"start": 151,
"length": 4
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 142,
"length": 33
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 185,
"length": 4
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 176,
"length": 33
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 219,
"length": 4
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 210,
"length": 67
},
"isWriteAccess": true,
"isDefinition": true
},
{
"textSpan": {
"start": 284,
"length": 4
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"isWriteAccess": false,
"isDefinition": false
}
]
}
]
// === /tests/cases/fourslash/findAllRefsIsDefinition.ts ===
// declare function foo(a: number): number;
// declare function foo(a: string): string;
// declare function foo(a: string | number): string | number;
//
// function foon(a: number): number;
// function foon(a: string): string;
// function foon(a: string | number): string | number {
// return a
// }
//
// foo; foon;
//
// export const [|bar|]/*FIND ALL REFS*/ = 123;
// console.log({ [|bar|] });
//
// interface IFoo {
// foo(): void;
// }
// class Foo implements IFoo {
// constructor(n: number)
// constructor()
// constructor(n: number?) { }
// foo(): void { }
// static init() { return new this() }
// }
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"kind": "const",
"name": "const bar: 123",
"textSpan": {
"start": 304,
"length": 3
},
"displayParts": [
{
"text": "const",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "bar",
"kind": "localName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "123",
"kind": "stringLiteral"
}
],
"contextSpan": {
"start": 291,
"length": 23
}
},
"references": [
{
"textSpan": {
"start": 304,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 291,
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
},
{
"textSpan": {
"start": 329,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"isWriteAccess": true,
"isDefinition": false
}
]
}
]
// === /tests/cases/fourslash/findAllRefsIsDefinition.ts ===
// declare function foo(a: number): number;
// declare function foo(a: string): string;
// declare function foo(a: string | number): string | number;
//
// function foon(a: number): number;
// function foon(a: string): string;
// function foon(a: string | number): string | number {
// return a
// }
//
// foo; foon;
//
// export const bar = 123;
// console.log({ bar });
//
// interface IFoo {
// [|foo|]/*FIND ALL REFS*/(): void;
// }
// class Foo implements IFoo {
// constructor(n: number)
// constructor()
// constructor(n: number?) { }
// [|foo|](): void { }
// static init() { return new this() }
// }
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"kind": "method",
"name": "(method) IFoo.foo(): void",
"textSpan": {
"start": 359,
"length": 3
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "method",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "IFoo",
"kind": "interfaceName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "foo",
"kind": "methodName"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "void",
"kind": "keyword"
}
],
"contextSpan": {
"start": 359,
"length": 12
}
},
"references": [
{
"textSpan": {
"start": 359,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 359,
"length": 12
},
"isWriteAccess": false,
"isDefinition": true
}
]
},
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"kind": "method",
"name": "(method) Foo.foo(): void",
"textSpan": {
"start": 483,
"length": 3
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "method",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "Foo",
"kind": "className"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "foo",
"kind": "methodName"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "void",
"kind": "keyword"
}
],
"contextSpan": {
"start": 483,
"length": 15
}
},
"references": [
{
"textSpan": {
"start": 483,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 483,
"length": 15
},
"isWriteAccess": true,
"isDefinition": false
}
]
}
]
// === /tests/cases/fourslash/findAllRefsIsDefinition.ts ===
// declare function foo(a: number): number;
// declare function foo(a: string): string;
// declare function foo(a: string | number): string | number;
//
// function foon(a: number): number;
// function foon(a: string): string;
// function foon(a: string | number): string | number {
// return a
// }
//
// foo; foon;
//
// export const bar = 123;
// console.log({ bar });
//
// interface IFoo {
// foo(): void;
// }
// class Foo implements IFoo {
// [|constructor|](n: number)
// [|constructor|]()
// /*FIND ALL REFS*/[|constructor|](n: number?) { }
// foo(): void { }
// static init() { return new [|this|]() }
// }
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"kind": "class",
"name": "class Foo",
"textSpan": {
"start": 380,
"length": 3
},
"displayParts": [
{
"text": "class",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "Foo",
"kind": "className"
}
],
"contextSpan": {
"start": 374,
"length": 166
}
},
"references": [
{
"textSpan": {
"start": 406,
"length": 11
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 406,
"length": 22
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 433,
"length": 11
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 433,
"length": 13
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 451,
"length": 11
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 451,
"length": 27
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 530,
"length": 4
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"isWriteAccess": false,
"isDefinition": false
}
]
}
]
// === /tests/cases/fourslash/findAllRefsIsDefinition.ts ===
// declare function foo(a: number): number;
// declare function foo(a: string): string;
// declare function foo(a: string | number): string | number;
//
// function foon(a: number): number;
// function foon(a: string): string;
// function foon(a: string | number): string | number {
// return a
// }
//
// foo; foon;
//
// export const bar = 123;
// console.log({ bar });
//
// interface IFoo {
// [|foo|](): void;
// }
// class Foo implements IFoo {
// constructor(n: number)
// constructor()
// constructor(n: number?) { }
// [|foo|]/*FIND ALL REFS*/(): void { }
// static init() { return new this() }
// }
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"kind": "method",
"name": "(method) IFoo.foo(): void",
"textSpan": {
"start": 359,
"length": 3
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "method",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "IFoo",
"kind": "interfaceName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "foo",
"kind": "methodName"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "void",
"kind": "keyword"
}
],
"contextSpan": {
"start": 359,
"length": 12
}
},
"references": [
{
"textSpan": {
"start": 359,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 359,
"length": 12
},
"isWriteAccess": false,
"isDefinition": false
}
]
},
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"kind": "method",
"name": "(method) Foo.foo(): void",
"textSpan": {
"start": 483,
"length": 3
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "method",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "Foo",
"kind": "className"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "foo",
"kind": "methodName"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "void",
"kind": "keyword"
}
],
"contextSpan": {
"start": 483,
"length": 15
}
},
"references": [
{
"textSpan": {
"start": 483,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsIsDefinition.ts",
"contextSpan": {
"start": 483,
"length": 15
},
"isWriteAccess": true,
"isDefinition": true
}
]
}
]
@@ -104,7 +104,7 @@
"length": 68
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -190,7 +190,7 @@
"length": 18
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -108,7 +108,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -224,7 +224,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -314,7 +314,7 @@
"length": 18
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -112,7 +112,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -138,7 +138,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -258,7 +258,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -284,7 +284,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -404,7 +404,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -430,7 +430,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -524,7 +524,7 @@
"length": 18
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -550,7 +550,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -670,7 +670,7 @@
"length": 18
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -709,7 +709,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -0,0 +1,86 @@
// === /tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName07.ts ===
// let p, b;
//
// p, [{ /*FIND ALL REFS*/[|a|]: p, b }] = [{ [|a|]: 10, b: true }];
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName07.ts",
"kind": "property",
"name": "(property) a: any",
"textSpan": {
"start": 17,
"length": 1
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "property",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "a",
"kind": "propertyName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "any",
"kind": "keyword"
}
],
"contextSpan": {
"start": 14,
"length": 36
}
},
"references": [
{
"textSpan": {
"start": 17,
"length": 1
},
"fileName": "/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName07.ts",
"contextSpan": {
"start": 14,
"length": 36
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 33,
"length": 1
},
"fileName": "/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName07.ts",
"contextSpan": {
"start": 33,
"length": 5
},
"isWriteAccess": true,
"isDefinition": false
}
]
}
]
@@ -72,7 +72,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -118,7 +118,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -274,7 +274,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -131,7 +131,7 @@
"length": 28
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -218,7 +218,7 @@
"length": 28
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -366,7 +366,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -444,7 +444,7 @@
"length": 28
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -592,7 +592,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -670,7 +670,7 @@
"length": 28
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -155,7 +155,7 @@
"length": 34
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -242,7 +242,7 @@
"length": 34
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -405,7 +405,7 @@
"length": 34
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -492,7 +492,7 @@
"length": 34
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -655,7 +655,7 @@
"length": 34
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -742,7 +742,7 @@
"length": 34
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -217,7 +217,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -466,7 +466,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -81,7 +81,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -171,7 +171,7 @@
"length": 28
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -256,7 +256,7 @@
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -359,7 +359,7 @@
"length": 28
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -543,7 +543,7 @@
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -556,7 +556,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -731,7 +731,7 @@
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -744,7 +744,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -836,7 +836,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -915,7 +915,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -0,0 +1,129 @@
// === /tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts ===
// interface IFoo {
// /*FIND ALL REFS*/[|a|]: string;
// }
// class C<T extends IFoo> {
// method() {
// var x: T = {
// [|a|]: ""
// };
// x.[|a|];
// }
// }
//
//
// var x: IFoo = {
// [|a|]: "ss"
// };
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts",
"kind": "property",
"name": "(property) IFoo.a: string",
"textSpan": {
"start": 21,
"length": 1
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "property",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "IFoo",
"kind": "interfaceName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "a",
"kind": "propertyName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "string",
"kind": "keyword"
}
],
"contextSpan": {
"start": 21,
"length": 10
}
},
"references": [
{
"textSpan": {
"start": 21,
"length": 1
},
"fileName": "/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts",
"contextSpan": {
"start": 21,
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 108,
"length": 1
},
"fileName": "/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts",
"contextSpan": {
"start": 108,
"length": 5
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 135,
"length": 1
},
"fileName": "/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts",
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 168,
"length": 1
},
"fileName": "/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts",
"contextSpan": {
"start": 168,
"length": 7
},
"isWriteAccess": true,
"isDefinition": false
}
]
}
]
@@ -75,7 +75,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -178,7 +178,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -277,7 +277,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -367,7 +367,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -446,7 +446,7 @@
"length": 6
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -562,7 +562,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -661,7 +661,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -751,7 +751,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -843,7 +843,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -946,7 +946,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1045,7 +1045,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1135,7 +1135,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1313,7 +1313,7 @@
"length": 6
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1326,7 +1326,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1429,7 +1429,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1519,7 +1519,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1697,7 +1697,7 @@
"length": 6
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1710,7 +1710,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1813,7 +1813,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1903,7 +1903,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2104,7 +2104,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2314,7 +2314,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -2515,7 +2515,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -151,7 +151,7 @@
"length": 24
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -322,7 +322,7 @@
"length": 24
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -412,7 +412,7 @@
"length": 24
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -606,7 +606,7 @@
"length": 24
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -664,7 +664,7 @@
"length": 19
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -832,7 +832,7 @@
"length": 19
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1000,7 +1000,7 @@
"length": 19
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1194,7 +1194,7 @@
"length": 24
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1252,7 +1252,7 @@
"length": 19
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -165,7 +165,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -338,7 +338,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -288,7 +288,7 @@
"length": 35
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -408,7 +408,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -519,7 +519,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -204,7 +204,7 @@
"length": 33
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -302,7 +302,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -409,7 +409,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -520,7 +520,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -618,7 +618,7 @@
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -725,7 +725,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -832,7 +832,7 @@
"length": 38
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1053,7 +1053,7 @@
"length": 33
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1151,7 +1151,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1258,7 +1258,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1369,7 +1369,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1467,7 +1467,7 @@
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1574,7 +1574,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1681,7 +1681,7 @@
"length": 38
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1902,7 +1902,7 @@
"length": 33
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -2000,7 +2000,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2107,7 +2107,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2218,7 +2218,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -2316,7 +2316,7 @@
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2423,7 +2423,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2530,7 +2530,7 @@
"length": 38
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2748,7 +2748,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2975,7 +2975,7 @@
"length": 33
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -3193,7 +3193,7 @@
"length": 33
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -3418,7 +3418,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -3516,7 +3516,7 @@
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3623,7 +3623,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3730,7 +3730,7 @@
"length": 38
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3964,7 +3964,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -4062,7 +4062,7 @@
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -4169,7 +4169,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -4276,7 +4276,7 @@
"length": 38
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -4503,7 +4503,7 @@
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -4578,7 +4578,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -4702,7 +4702,7 @@
"length": 33
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -4800,7 +4800,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -4907,7 +4907,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -5018,7 +5018,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -5125,7 +5125,7 @@
"length": 38
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -5355,7 +5355,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -5466,7 +5466,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -5564,7 +5564,7 @@
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -5671,7 +5671,7 @@
"length": 38
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -5901,7 +5901,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -6012,7 +6012,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -6110,7 +6110,7 @@
"length": 23
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -6217,7 +6217,7 @@
"length": 38
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -6687,7 +6687,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -6753,7 +6753,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -6877,7 +6877,7 @@
"length": 33
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -6975,7 +6975,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -7082,7 +7082,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -7193,7 +7193,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -7300,7 +7300,7 @@
"length": 38
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -7536,7 +7536,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -7602,7 +7602,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -7726,7 +7726,7 @@
"length": 33
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -7824,7 +7824,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -7931,7 +7931,7 @@
"length": 37
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -8042,7 +8042,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -8149,7 +8149,7 @@
"length": 38
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -178,7 +178,7 @@
"length": 33
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -448,7 +448,7 @@
"length": 15
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -536,7 +536,7 @@
"length": 34
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -604,7 +604,7 @@
"length": 31
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -705,7 +705,7 @@
"length": 34
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -828,7 +828,7 @@
"length": 31
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -841,7 +841,7 @@
"length": 15
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -997,7 +997,7 @@
"length": 31
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1010,7 +1010,7 @@
"length": 15
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1111,7 +1111,7 @@
"length": 31
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1212,7 +1212,7 @@
"length": 34
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -108,7 +108,7 @@
"length": 4
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -182,7 +182,7 @@
"length": 19
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -195,7 +195,7 @@
"length": 4
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -298,7 +298,7 @@
"length": 28
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -311,7 +311,7 @@
"length": 4
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -398,7 +398,7 @@
"length": 4
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -501,7 +501,7 @@
"length": 28
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -588,7 +588,7 @@
"length": 19
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -601,7 +601,7 @@
"length": 4
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -704,7 +704,7 @@
"length": 28
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -717,7 +717,7 @@
"length": 4
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -791,7 +791,7 @@
"length": 19
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -163,7 +163,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -343,7 +343,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -89,7 +89,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -164,7 +164,7 @@
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -335,7 +335,7 @@
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -348,7 +348,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -607,7 +607,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -866,7 +866,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -941,7 +941,7 @@
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1112,7 +1112,7 @@
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1125,7 +1125,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1371,7 +1371,7 @@
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1568,7 +1568,7 @@
"length": 7
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1634,7 +1634,7 @@
"length": 12
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1718,7 +1718,7 @@
"length": 12
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1731,7 +1731,7 @@
"length": 7
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1881,7 +1881,7 @@
"length": 12
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -69,7 +69,7 @@
},
"fileName": "/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment.ts",
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -155,7 +155,7 @@
},
"fileName": "/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment.ts",
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -232,7 +232,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -151,7 +151,7 @@
},
"fileName": "/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts",
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -230,7 +230,7 @@
"length": 14
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -0,0 +1,161 @@
// === /tests/cases/fourslash/findAllRefsWriteAccess.ts ===
// interface Obj {
// [`/*FIND ALL REFS*/[|num|]`]: number;
// }
//
// let o: Obj = {
// [`[|num|]`]: 0
// };
//
// o = {
// ['[|num|]']: 1
// };
//
// o['[|num|]'] = 2;
// o[`[|num|]`] = 3;
//
// o['[|num|]'];
// o[`[|num|]`];
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/findAllRefsWriteAccess.ts",
"kind": "property",
"name": "(property) Obj[`num`]: number",
"textSpan": {
"start": 22,
"length": 3
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "property",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "Obj",
"kind": "interfaceName"
},
{
"text": "[",
"kind": "punctuation"
},
{
"text": "`num`",
"kind": "propertyName"
},
{
"text": "]",
"kind": "punctuation"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "number",
"kind": "keyword"
}
],
"contextSpan": {
"start": 20,
"length": 16
}
},
"references": [
{
"textSpan": {
"start": 22,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsWriteAccess.ts",
"contextSpan": {
"start": 20,
"length": 16
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 61,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsWriteAccess.ts",
"contextSpan": {
"start": 59,
"length": 10
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 86,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsWriteAccess.ts",
"contextSpan": {
"start": 84,
"length": 10
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 102,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsWriteAccess.ts",
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 116,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsWriteAccess.ts",
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 131,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsWriteAccess.ts",
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 141,
"length": 3
},
"fileName": "/tests/cases/fourslash/findAllRefsWriteAccess.ts",
"isWriteAccess": false,
"isDefinition": false
}
]
}
]
@@ -457,7 +457,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -470,7 +470,7 @@
"length": 43
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -643,7 +643,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -656,7 +656,7 @@
"length": 43
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -774,7 +774,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -787,7 +787,7 @@
"length": 43
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -239,7 +239,7 @@
"length": 64
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -473,7 +473,7 @@
"length": 51
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -132,7 +132,7 @@
"length": 4
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -205,7 +205,7 @@
"length": 32
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -150,7 +150,7 @@
"length": 24
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -326,7 +326,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -128,7 +128,7 @@
"length": 66
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -0,0 +1,111 @@
// === /tests/cases/fourslash/redeclaration.ts ===
// container = { "[|searchProp|]" : 18 };
// === /tests/cases/fourslash/declaration.ts ===
// var container = { /*FIND ALL REFS*/[|searchProp|] : 1 };
// === /tests/cases/fourslash/stringIndexer.ts ===
// function blah2() { container["[|searchProp|]"] };
// === /tests/cases/fourslash/expression.ts ===
// function blah() { return (1 + 2 + container.[|searchProp|]()) === 2; };
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/declaration.ts",
"kind": "property",
"name": "(property) searchProp: number",
"textSpan": {
"start": 18,
"length": 10
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "property",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "searchProp",
"kind": "propertyName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "number",
"kind": "keyword"
}
],
"contextSpan": {
"start": 18,
"length": 14
}
},
"references": [
{
"textSpan": {
"start": 18,
"length": 10
},
"fileName": "/tests/cases/fourslash/declaration.ts",
"contextSpan": {
"start": 18,
"length": 14
},
"isWriteAccess": true,
"isDefinition": true
},
{
"textSpan": {
"start": 44,
"length": 10
},
"fileName": "/tests/cases/fourslash/expression.ts",
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 30,
"length": 10
},
"fileName": "/tests/cases/fourslash/stringIndexer.ts",
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 15,
"length": 10
},
"fileName": "/tests/cases/fourslash/redeclaration.ts",
"contextSpan": {
"start": 14,
"length": 17
},
"isWriteAccess": true,
"isDefinition": false
}
]
}
]
@@ -0,0 +1,111 @@
// === /tests/cases/fourslash/redeclaration.ts ===
// container = { "[|42|]" : 18 };
// === /tests/cases/fourslash/declaration.ts ===
// var container = { /*FIND ALL REFS*/[|42|]: 1 };
// === /tests/cases/fourslash/stringIndexer.ts ===
// function blah2() { container["[|42|]"] };
// === /tests/cases/fourslash/expression.ts ===
// function blah() { return (container[[|42|]]) === 2; };
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/declaration.ts",
"kind": "property",
"name": "(property) 42: number",
"textSpan": {
"start": 18,
"length": 2
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "property",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "42",
"kind": "propertyName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "number",
"kind": "keyword"
}
],
"contextSpan": {
"start": 18,
"length": 5
}
},
"references": [
{
"textSpan": {
"start": 18,
"length": 2
},
"fileName": "/tests/cases/fourslash/declaration.ts",
"contextSpan": {
"start": 18,
"length": 5
},
"isWriteAccess": true,
"isDefinition": true
},
{
"textSpan": {
"start": 36,
"length": 2
},
"fileName": "/tests/cases/fourslash/expression.ts",
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 30,
"length": 2
},
"fileName": "/tests/cases/fourslash/stringIndexer.ts",
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 15,
"length": 2
},
"fileName": "/tests/cases/fourslash/redeclaration.ts",
"contextSpan": {
"start": 14,
"length": 9
},
"isWriteAccess": true,
"isDefinition": false
}
]
}
]
@@ -157,7 +157,7 @@
"length": 2
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -257,7 +257,7 @@
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -431,7 +431,7 @@
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -695,7 +695,7 @@
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -803,7 +803,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -993,7 +993,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -157,7 +157,7 @@
"length": 2
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -257,7 +257,7 @@
"length": 19
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -431,7 +431,7 @@
"length": 19
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -695,7 +695,7 @@
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -803,7 +803,7 @@
"length": 24
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -993,7 +993,7 @@
"length": 24
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -169,7 +169,7 @@
"length": 2
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -281,7 +281,7 @@
"length": 8
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -467,7 +467,7 @@
"length": 8
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -803,7 +803,7 @@
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -983,7 +983,7 @@
"length": 31
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1245,7 +1245,7 @@
"length": 31
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -0,0 +1,206 @@
// === /tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts ===
// interface IFoo { /*FIND ALL REFS*/[|xy|]: number; }
//
// // Assignment
// var a1: IFoo = { [|xy|]: 0 };
// var a2: IFoo = { [|xy|]: 0 };
//
// // Function call
// function consumer(f: IFoo) { }
// consumer({ [|xy|]: 1 });
//
// // Type cast
// var c = <IFoo>{ [|xy|]: 0 };
//
// // Array literal
// var ar: IFoo[] = [{ [|xy|]: 1 }, { [|xy|]: 2 }];
//
// // Nested object literal
// var ob: { ifoo: IFoo } = { ifoo: { [|xy|]: 0 } };
//
// // Widened type
// var w: IFoo = { [|xy|]: undefined };
//
// // Untped -- should not be included
// var u = { xy: 0 };
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts",
"kind": "property",
"name": "(property) IFoo.xy: number",
"textSpan": {
"start": 17,
"length": 2
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "property",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "IFoo",
"kind": "interfaceName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "xy",
"kind": "propertyName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "number",
"kind": "keyword"
}
],
"contextSpan": {
"start": 17,
"length": 11
}
},
"references": [
{
"textSpan": {
"start": 17,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts",
"contextSpan": {
"start": 17,
"length": 11
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 63,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts",
"contextSpan": {
"start": 63,
"length": 5
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 89,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts",
"contextSpan": {
"start": 89,
"length": 5
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 158,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts",
"contextSpan": {
"start": 158,
"length": 5
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 198,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts",
"contextSpan": {
"start": 198,
"length": 5
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 245,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts",
"contextSpan": {
"start": 245,
"length": 5
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 256,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts",
"contextSpan": {
"start": 256,
"length": 5
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 327,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts",
"contextSpan": {
"start": 327,
"length": 5
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 371,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts",
"contextSpan": {
"start": 371,
"length": 13
},
"isWriteAccess": true,
"isDefinition": false
}
]
}
]
@@ -186,7 +186,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -199,7 +199,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -212,7 +212,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -225,7 +225,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -238,7 +238,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -251,7 +251,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -264,7 +264,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -277,7 +277,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -471,7 +471,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -484,7 +484,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -497,7 +497,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -510,7 +510,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -523,7 +523,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -536,7 +536,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -549,7 +549,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -562,7 +562,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -674,7 +674,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -748,7 +748,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -843,7 +843,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -856,7 +856,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -869,7 +869,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -882,7 +882,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -895,7 +895,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -908,7 +908,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -921,7 +921,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1033,7 +1033,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1107,7 +1107,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1189,7 +1189,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1215,7 +1215,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1228,7 +1228,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1241,7 +1241,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1254,7 +1254,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1267,7 +1267,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1280,7 +1280,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1392,7 +1392,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1466,7 +1466,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1548,7 +1548,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1561,7 +1561,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1587,7 +1587,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1600,7 +1600,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1613,7 +1613,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1626,7 +1626,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1639,7 +1639,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1751,7 +1751,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1825,7 +1825,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1907,7 +1907,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1920,7 +1920,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1933,7 +1933,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1959,7 +1959,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1972,7 +1972,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1985,7 +1985,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1998,7 +1998,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -2110,7 +2110,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -2184,7 +2184,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -2266,7 +2266,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2279,7 +2279,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2292,7 +2292,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2305,7 +2305,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2331,7 +2331,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2344,7 +2344,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2357,7 +2357,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -2469,7 +2469,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -2543,7 +2543,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -2625,7 +2625,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2638,7 +2638,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2651,7 +2651,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2664,7 +2664,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2677,7 +2677,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2703,7 +2703,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2716,7 +2716,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -2828,7 +2828,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -2902,7 +2902,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -2984,7 +2984,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2997,7 +2997,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3010,7 +3010,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3023,7 +3023,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3036,7 +3036,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3049,7 +3049,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3075,7 +3075,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -3187,7 +3187,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -3261,7 +3261,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -3343,7 +3343,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3356,7 +3356,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3369,7 +3369,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3382,7 +3382,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3395,7 +3395,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3408,7 +3408,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3421,7 +3421,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -0,0 +1,189 @@
// === /tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts ===
// interface A {
// a: number;
// common: string;
// }
//
// interface B {
// /*FIND ALL REFS*/[|b|]: number;
// common: number;
// }
//
// // Assignment
// var v1: A | B = { a: 0, common: "" };
// var v2: A | B = { [|b|]: 0, common: 3 };
//
// // Function call
// function consumer(f: A | B) { }
// consumer({ a: 0, [|b|]: 0, common: 1 });
//
// // Type cast
// var c = <A | B> { common: 0, [|b|]: 0 };
//
// // Array literal
// var ar: Array<A|B> = [{ a: 0, common: "" }, { [|b|]: 0, common: 0 }];
//
// // Nested object literal
// var ob: { aorb: A|B } = { aorb: { [|b|]: 0, common: 0 } };
//
// // Widened type
// var w: A|B = { [|b|]:undefined, common: undefined };
//
// // Untped -- should not be included
// var u1 = { a: 0, b: 0, common: "" };
// var u2 = { b: 0, common: 0 };
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts",
"kind": "property",
"name": "(property) B.b: number",
"textSpan": {
"start": 70,
"length": 1
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "property",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "B",
"kind": "interfaceName"
},
{
"text": ".",
"kind": "punctuation"
},
{
"text": "b",
"kind": "propertyName"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "number",
"kind": "keyword"
}
],
"contextSpan": {
"start": 70,
"length": 10
}
},
"references": [
{
"textSpan": {
"start": 70,
"length": 1
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts",
"contextSpan": {
"start": 70,
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 174,
"length": 1
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts",
"contextSpan": {
"start": 174,
"length": 4
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 261,
"length": 1
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts",
"contextSpan": {
"start": 261,
"length": 4
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 324,
"length": 1
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts",
"contextSpan": {
"start": 324,
"length": 4
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 396,
"length": 1
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts",
"contextSpan": {
"start": 396,
"length": 4
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 476,
"length": 1
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts",
"contextSpan": {
"start": 476,
"length": 4
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 529,
"length": 1
},
"fileName": "/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts",
"contextSpan": {
"start": 529,
"length": 11
},
"isWriteAccess": true,
"isDefinition": false
}
]
}
]
@@ -132,7 +132,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -220,7 +220,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -329,7 +329,7 @@ undefined
"length": 21
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -342,7 +342,7 @@ undefined
"length": 11
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -440,7 +440,7 @@ undefined
"length": 21
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -453,7 +453,7 @@ undefined
"length": 11
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -523,7 +523,7 @@ undefined
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -593,7 +593,7 @@ undefined
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -703,7 +703,7 @@ undefined
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -773,7 +773,7 @@ undefined
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -843,7 +843,7 @@ undefined
"length": 15
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -913,7 +913,7 @@ undefined
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1085,7 +1085,7 @@ undefined
"length": 6
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1167,7 +1167,7 @@ undefined
"length": 6
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1249,7 +1249,7 @@ undefined
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -57,7 +57,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -203,7 +203,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -349,7 +349,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -495,7 +495,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -641,7 +641,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -787,7 +787,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -933,7 +933,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1079,7 +1079,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1253,7 +1253,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -181,7 +181,7 @@
"length": 16
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -263,7 +263,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -379,7 +379,7 @@
"length": 16
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -543,7 +543,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -659,7 +659,7 @@
"length": 16
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -741,7 +741,7 @@
"length": 16
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -939,7 +939,7 @@
"length": 16
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1021,7 +1021,7 @@
"length": 16
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -184,7 +184,7 @@
"length": 16
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -266,7 +266,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -182,7 +182,7 @@
"length": 16
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -356,7 +356,7 @@
"length": 17
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -170,7 +170,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -177,7 +177,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -355,7 +355,7 @@
"length": 17
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -549,7 +549,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -727,7 +727,7 @@
"length": 17
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -839,7 +839,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -921,7 +921,7 @@
"length": 16
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1107,7 +1107,7 @@
"length": 17
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1181,7 +1181,7 @@
"length": 17
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -155,7 +155,7 @@
"length": 14
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -54,7 +54,7 @@
"length": 105
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -116,7 +116,7 @@
"length": 105
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -206,7 +206,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -296,7 +296,7 @@
"length": 11
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -386,7 +386,7 @@
"length": 9
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -476,7 +476,7 @@
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -566,7 +566,7 @@
"length": 10
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -636,7 +636,7 @@
"length": 16
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -730,7 +730,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -792,7 +792,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -0,0 +1,125 @@
// === /tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts ===
// class Foo {
// public /*FIND ALL REFS*/[|12|]: any;
// }
//
// var x: Foo;
// x[[|12|]];
// x = { "[|12|]": 0 };
// x = { [|12|]: 0 };
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts",
"kind": "property",
"name": "(property) Foo[12]: any",
"textSpan": {
"start": 23,
"length": 2
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "property",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "Foo",
"kind": "className"
},
{
"text": "[",
"kind": "punctuation"
},
{
"text": "12",
"kind": "stringLiteral"
},
{
"text": "]",
"kind": "punctuation"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "any",
"kind": "keyword"
}
],
"contextSpan": {
"start": 16,
"length": 15
}
},
"references": [
{
"textSpan": {
"start": 23,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts",
"contextSpan": {
"start": 16,
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 49,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts",
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 61,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts",
"contextSpan": {
"start": 60,
"length": 7
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 77,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts",
"contextSpan": {
"start": 77,
"length": 5
},
"isWriteAccess": true,
"isDefinition": false
}
]
}
]
@@ -251,7 +251,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -519,7 +519,7 @@
"length": 13
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -787,7 +787,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1039,7 +1039,7 @@
"length": 14
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1121,7 +1121,7 @@
"length": 14
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1203,7 +1203,7 @@
"length": 21
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1285,7 +1285,7 @@
"length": 21
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -1553,7 +1553,7 @@
"length": 15
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1643,7 +1643,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -95,7 +95,7 @@
"length": 26
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -289,7 +289,7 @@
"length": 14
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -399,7 +399,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -445,7 +445,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -555,7 +555,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -601,7 +601,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -747,7 +747,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -822,7 +822,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -897,7 +897,7 @@
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1078,7 +1078,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1124,7 +1124,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1234,7 +1234,7 @@
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -1280,7 +1280,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1545,7 +1545,7 @@ undefined
"length": 40
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1904,7 +1904,7 @@ undefined
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -1979,7 +1979,7 @@ undefined
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -2054,7 +2054,7 @@ undefined
"length": 30
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -2235,7 +2235,7 @@ undefined
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -2281,7 +2281,7 @@ undefined
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -2391,7 +2391,7 @@ undefined
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -2437,7 +2437,7 @@ undefined
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -2702,7 +2702,7 @@ undefined
"length": 40
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -2793,7 +2793,7 @@ undefined
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2806,7 +2806,7 @@ undefined
"length": 19
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -2897,7 +2897,7 @@ undefined
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -2910,7 +2910,7 @@ undefined
"length": 19
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -2989,7 +2989,7 @@ undefined
"length": 29
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -3058,7 +3058,7 @@ undefined
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -3140,7 +3140,7 @@ undefined
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -0,0 +1,135 @@
// === /tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts ===
// class Foo {
// public "/*FIND ALL REFS*/[|ss|]": any;
// }
//
// var x: Foo;
// x.[|ss|];
// x["[|ss|]"];
// x = { "[|ss|]": 0 };
// x = { [|ss|]: 0 };
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts",
"kind": "property",
"name": "(property) Foo[\"ss\"]: any",
"textSpan": {
"start": 24,
"length": 2
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "property",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "Foo",
"kind": "className"
},
{
"text": "[",
"kind": "punctuation"
},
{
"text": "\"ss\"",
"kind": "stringLiteral"
},
{
"text": "]",
"kind": "punctuation"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "any",
"kind": "keyword"
}
],
"contextSpan": {
"start": 16,
"length": 17
}
},
"references": [
{
"textSpan": {
"start": 24,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts",
"contextSpan": {
"start": 16,
"length": 17
},
"isWriteAccess": false,
"isDefinition": true
},
{
"textSpan": {
"start": 51,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts",
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 58,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts",
"isWriteAccess": false,
"isDefinition": false
},
{
"textSpan": {
"start": 71,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts",
"contextSpan": {
"start": 70,
"length": 7
},
"isWriteAccess": true,
"isDefinition": false
},
{
"textSpan": {
"start": 87,
"length": 2
},
"fileName": "/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts",
"contextSpan": {
"start": 87,
"length": 5
},
"isWriteAccess": true,
"isDefinition": false
}
]
}
]
@@ -79,7 +79,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -92,7 +92,7 @@
"length": 19
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -179,7 +179,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -192,7 +192,7 @@
"length": 19
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -50,7 +50,7 @@
"length": 14
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -165,7 +165,7 @@
},
"fileName": "/tests/cases/fourslash/referencesForTypeKeywords.ts",
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -232,7 +232,7 @@
},
"fileName": "/tests/cases/fourslash/referencesForTypeKeywords.ts",
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -298,7 +298,7 @@
"length": 12
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -392,7 +392,7 @@
},
"fileName": "/tests/cases/fourslash/referencesForTypeKeywords.ts",
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -495,7 +495,7 @@
},
"fileName": "/tests/cases/fourslash/referencesForTypeKeywords.ts",
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -336,7 +336,7 @@
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -580,7 +580,7 @@
"length": 10
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -130,7 +130,7 @@
"length": 20
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -286,7 +286,7 @@
"length": 45
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -130,7 +130,7 @@
"length": 20
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -150,7 +150,7 @@
"length": 24
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -163,7 +163,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -276,7 +276,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -334,7 +334,7 @@
"length": 13
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -434,7 +434,7 @@
"length": 24
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -505,7 +505,7 @@
"length": 13
},
"isWriteAccess": false,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -148,7 +148,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -161,7 +161,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -239,7 +239,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -358,7 +358,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -404,7 +404,7 @@
"length": 49
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -495,7 +495,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -688,7 +688,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -701,7 +701,7 @@
"length": 13
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -747,7 +747,7 @@
"length": 49
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -148,7 +148,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -239,7 +239,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -330,7 +330,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -527,7 +527,7 @@
"length": 18
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -618,7 +618,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -815,7 +815,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -131,7 +131,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -209,7 +209,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -279,7 +279,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -435,7 +435,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -624,7 +624,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -670,7 +670,7 @@
"length": 17
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -144,7 +144,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
},
@@ -222,7 +222,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -402,7 +402,7 @@
"length": 22
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {
@@ -591,7 +591,7 @@
"length": 27
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -141,7 +141,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
}
]
}
@@ -142,7 +142,7 @@
"length": 25
},
"isWriteAccess": true,
"isDefinition": true
"isDefinition": false
},
{
"textSpan": {

Some files were not shown because too many files have changed in this diff Show More