From 493ddc2447fd1ea2a5c9372e40205ace2cbd0da6 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Mon, 4 Apr 2022 16:54:10 -0700 Subject: [PATCH] Remove non-baselining fourslash FAR validation (#48564) * Fix fourslash failures * Delete unused FAR fourslash helpers --- src/harness/fourslashImpl.ts | 101 +- src/harness/fourslashInterfaceImpl.ts | 8 +- ...indingAllRefsOnDefinition.1.baseline.jsonc | 116 + ...indingAllRefsOnDefinition.3.baseline.jsonc | 116 + .../findAllRefsPrimitive.baseline.jsonc | 953 ++ .../findReferencesAfterEdit.1.baseline.jsonc | 195 + .../findReferencesAfterEdit.2.baseline.jsonc | 197 + .../findReferencesJSXTagName3.baseline.jsonc | 1173 ++ .../reference/jsDocServices.baseline.jsonc | 290 + .../jsdocTypedefTagServices.baseline.jsonc | 241 + .../localGetReferences.baseline.jsonc | 10291 ++++++++++++++++ .../remoteGetReferences.baseline.jsonc | 8919 ++++++++++++++ ...cellationWhenfindingAllRefsOnDefinition.ts | 10 +- tests/cases/fourslash/findAllRefsPrimitive.ts | 22 +- .../fourslash/findReferencesAfterEdit.ts | 8 +- .../fourslash/findReferencesJSXTagName3.ts | 21 +- tests/cases/fourslash/fourslash.ts | 1 + tests/cases/fourslash/jsDocServices.ts | 6 +- .../fourslash/jsdocTypedefTagServices.ts | 4 +- tests/cases/fourslash/localGetReferences.ts | 130 +- tests/cases/fourslash/remoteGetReferences.ts | 77 +- 21 files changed, 22611 insertions(+), 268 deletions(-) create mode 100644 tests/baselines/reference/cancellationWhenfindingAllRefsOnDefinition.1.baseline.jsonc create mode 100644 tests/baselines/reference/cancellationWhenfindingAllRefsOnDefinition.3.baseline.jsonc create mode 100644 tests/baselines/reference/findAllRefsPrimitive.baseline.jsonc create mode 100644 tests/baselines/reference/findReferencesAfterEdit.1.baseline.jsonc create mode 100644 tests/baselines/reference/findReferencesAfterEdit.2.baseline.jsonc create mode 100644 tests/baselines/reference/findReferencesJSXTagName3.baseline.jsonc create mode 100644 tests/baselines/reference/jsDocServices.baseline.jsonc create mode 100644 tests/baselines/reference/jsdocTypedefTagServices.baseline.jsonc create mode 100644 tests/baselines/reference/remoteGetReferences.baseline.jsonc diff --git a/src/harness/fourslashImpl.ts b/src/harness/fourslashImpl.ts index dac3d672d75..f4b2832c00b 100644 --- a/src/harness/fourslashImpl.ts +++ b/src/harness/fourslashImpl.ts @@ -1122,83 +1122,18 @@ namespace FourSlash { } } - private verifyDocumentHighlightsRespectFilesList(files: readonly string[]): void { - const startFile = this.activeFile.fileName; - for (const fileName of files) { - const searchFileNames = startFile === fileName ? [startFile] : [startFile, fileName]; - const highlights = this.getDocumentHighlightsAtCurrentPosition(searchFileNames); - if (highlights && !highlights.every(dh => ts.contains(searchFileNames, dh.fileName))) { - this.raiseError(`When asking for document highlights only in files ${searchFileNames}, got document highlights in ${unique(highlights, dh => dh.fileName)}`); - } - } - } - - public verifyReferenceGroups(starts: ArrayOrSingle | ArrayOrSingle, parts: readonly FourSlashInterface.ReferenceGroup[]): void { - interface ReferenceGroupJson { - definition: string | { text: string, range: ts.TextSpan }; - references: ts.ReferenceEntry[]; - } - interface RangeMarkerData { - id?: string; - isWriteAccess?: boolean, - isDefinition?: boolean, - isInString?: true, - contextRangeIndex?: number, - contextRangeDelta?: number, - contextRangeId?: string - } - const fullExpected = ts.map(parts, ({ definition, ranges }) => ({ - definition: typeof definition === "string" ? definition : { ...definition, range: ts.createTextSpanFromRange(definition.range) }, - references: ranges.map(r => { - const { isWriteAccess = false, isDefinition = false, isInString, contextRangeIndex, contextRangeDelta, contextRangeId } = (r.marker && r.marker.data || {}) as RangeMarkerData; - let contextSpan: ts.TextSpan | undefined; - if (contextRangeDelta !== undefined) { - const allRanges = this.getRanges(); - const index = allRanges.indexOf(r); - if (index !== -1) { - contextSpan = ts.createTextSpanFromRange(allRanges[index + contextRangeDelta]); - } - } - else if (contextRangeId !== undefined) { - const allRanges = this.getRanges(); - const contextRange = ts.find(allRanges, range => (range.marker?.data as RangeMarkerData)?.id === contextRangeId); - if (contextRange) { - contextSpan = ts.createTextSpanFromRange(contextRange); - } - } - else if (contextRangeIndex !== undefined) { - contextSpan = ts.createTextSpanFromRange(this.getRanges()[contextRangeIndex]); - } - return { - textSpan: ts.createTextSpanFromRange(r), - fileName: r.fileName, - ...(contextSpan ? { contextSpan } : undefined), - isWriteAccess, - isDefinition, - ...(isInString ? { isInString: true } : undefined), - }; - }), - })); - - for (const start of toArray(starts)) { - this.goToMarkerOrRange(start); - const fullActual = ts.map(this.findReferencesAtCaret(), ({ definition, references }, i) => { - const text = definition.displayParts.map(d => d.text).join(""); - return { - definition: fullExpected.length > i && typeof fullExpected[i].definition === "string" ? text : { text, range: definition.textSpan }, - references, - }; - }); - this.assertObjectsEqual(fullActual, fullExpected); - - if (parts) { - this.verifyDocumentHighlightsRespectFilesList(unique(ts.flatMap(parts, p => p.ranges), r => r.fileName)); - } - } - } - public verifyBaselineFindAllReferences(...markerNames: string[]) { + ts.Debug.assert(markerNames.length > 0, "Must pass at least one marker name to `verifyBaselineFindAllReferences()`"); + this.verifyBaselineFindAllReferencesWorker("", markerNames); + } + + // Used when a single test needs to produce multiple baselines + public verifyBaselineFindAllReferencesMulti(seq: number, ...markerNames: string[]) { ts.Debug.assert(markerNames.length > 0, "Must pass at least one marker name to `baselineFindAllReferences()`"); + this.verifyBaselineFindAllReferencesWorker(`.${seq}`, markerNames); + } + + private verifyBaselineFindAllReferencesWorker(suffix: string, markerNames: string[]) { const baseline = markerNames.map(markerName => { this.goToMarker(markerName); const marker = this.getMarkerByName(markerName); @@ -1213,7 +1148,7 @@ namespace FourSlash { // Write response JSON return baselineContent + JSON.stringify(references, undefined, 2); }).join("\n\n"); - Harness.Baseline.runBaseline(this.getBaselineFileNameForContainingTestFile(".baseline.jsonc"), baseline); + Harness.Baseline.runBaseline(this.getBaselineFileNameForContainingTestFile(`${suffix}.baseline.jsonc`), baseline); } public verifyBaselineGetFileReferences(fileName: string) { @@ -1280,11 +1215,6 @@ namespace FourSlash { } } - public verifySingleReferenceGroup(definition: FourSlashInterface.ReferenceGroupDefinition, ranges?: Range[] | string) { - ranges = ts.isString(ranges) ? this.rangesByText().get(ranges)! : ranges || this.getRanges(); - this.verifyReferenceGroups(ranges, [{ definition, ranges }]); - } - private assertObjectsEqual(fullActual: T, fullExpected: T, msgPrefix = ""): void { const recur = (actual: U, expected: U, path: string) => { const fail = (msg: string) => { @@ -2403,15 +2333,6 @@ namespace FourSlash { this.goToPosition(len); } - private goToMarkerOrRange(markerOrRange: string | Range) { - if (typeof markerOrRange === "string") { - this.goToMarker(markerOrRange); - } - else { - this.goToRangeStart(markerOrRange); - } - } - public goToRangeStart({ fileName, pos }: Range) { this.openFile(fileName); this.goToPosition(pos); diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index 064ec8b745a..ea07f4f386f 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -352,12 +352,12 @@ namespace FourSlashInterface { this.state.verifyBaselineFindAllReferences(...markerNames); } - public baselineGetFileReferences(fileName: string) { - this.state.verifyBaselineGetFileReferences(fileName); + public baselineFindAllReferencesMulti(seq: number, ...markerNames: string[]) { + this.state.verifyBaselineFindAllReferencesMulti(seq, ...markerNames); } - public singleReferenceGroup(definition: ReferenceGroupDefinition, ranges?: FourSlash.Range[] | string) { - this.state.verifySingleReferenceGroup(definition, ranges); + public baselineGetFileReferences(fileName: string) { + this.state.verifyBaselineGetFileReferences(fileName); } public findReferencesDefinitionDisplayPartsAtCaretAre(expected: ts.SymbolDisplayPart[]) { diff --git a/tests/baselines/reference/cancellationWhenfindingAllRefsOnDefinition.1.baseline.jsonc b/tests/baselines/reference/cancellationWhenfindingAllRefsOnDefinition.1.baseline.jsonc new file mode 100644 index 00000000000..fac647eb0ac --- /dev/null +++ b/tests/baselines/reference/cancellationWhenfindingAllRefsOnDefinition.1.baseline.jsonc @@ -0,0 +1,116 @@ +// === /tests/cases/fourslash/findAllRefsOnDefinition-import.ts === +// export class Test{ +// +// constructor(){ +// +// } +// +// public /*FIND ALL REFS*/[|start|](){ +// return this; +// } +// +// public stop(){ +// return this; +// } +// } + +// === /tests/cases/fourslash/findAllRefsOnDefinition.ts === +// import Second = require("./findAllRefsOnDefinition-import"); +// +// var second = new Second.Test() +// second.[|start|](); +// second.stop(); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/findAllRefsOnDefinition-import.ts", + "kind": "method", + "name": "(method) Test.start(): this", + "textSpan": { + "start": 58, + "length": 5 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Test", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "start", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 51, + "length": 42 + } + }, + "references": [ + { + "textSpan": { + "start": 58, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/findAllRefsOnDefinition-import.ts", + "contextSpan": { + "start": 51, + "length": 42 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 100, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/findAllRefsOnDefinition.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] \ No newline at end of file diff --git a/tests/baselines/reference/cancellationWhenfindingAllRefsOnDefinition.3.baseline.jsonc b/tests/baselines/reference/cancellationWhenfindingAllRefsOnDefinition.3.baseline.jsonc new file mode 100644 index 00000000000..fac647eb0ac --- /dev/null +++ b/tests/baselines/reference/cancellationWhenfindingAllRefsOnDefinition.3.baseline.jsonc @@ -0,0 +1,116 @@ +// === /tests/cases/fourslash/findAllRefsOnDefinition-import.ts === +// export class Test{ +// +// constructor(){ +// +// } +// +// public /*FIND ALL REFS*/[|start|](){ +// return this; +// } +// +// public stop(){ +// return this; +// } +// } + +// === /tests/cases/fourslash/findAllRefsOnDefinition.ts === +// import Second = require("./findAllRefsOnDefinition-import"); +// +// var second = new Second.Test() +// second.[|start|](); +// second.stop(); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/findAllRefsOnDefinition-import.ts", + "kind": "method", + "name": "(method) Test.start(): this", + "textSpan": { + "start": 58, + "length": 5 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Test", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "start", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 51, + "length": 42 + } + }, + "references": [ + { + "textSpan": { + "start": 58, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/findAllRefsOnDefinition-import.ts", + "contextSpan": { + "start": 51, + "length": 42 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 100, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/findAllRefsOnDefinition.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] \ No newline at end of file diff --git a/tests/baselines/reference/findAllRefsPrimitive.baseline.jsonc b/tests/baselines/reference/findAllRefsPrimitive.baseline.jsonc new file mode 100644 index 00000000000..4a4a47a031a --- /dev/null +++ b/tests/baselines/reference/findAllRefsPrimitive.baseline.jsonc @@ -0,0 +1,953 @@ +// === /tests/cases/fourslash/a.ts === +// const x: /*FIND ALL REFS*/[|any|] = 0; +// const any = 2; +// const y: [|any|] = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +// === /tests/cases/fourslash/b.ts === +// const z: [|any|] = 0; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "any", + "textSpan": { + "start": 9, + "length": 3 + }, + "displayParts": [ + { + "text": "any", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 9, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 42, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 9, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/b.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: [|any|] = 0; +// const any = 2; +// const y: /*FIND ALL REFS*/[|any|] = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +// === /tests/cases/fourslash/b.ts === +// const z: [|any|] = 0; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "any", + "textSpan": { + "start": 9, + "length": 3 + }, + "displayParts": [ + { + "text": "any", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 9, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 42, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 9, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/b.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: /*FIND ALL REFS*/[|boolean|]): [|boolean|]; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "boolean", + "textSpan": { + "start": 67, + "length": 7 + }, + "displayParts": [ + { + "text": "boolean", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 67, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 77, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: [|boolean|]): /*FIND ALL REFS*/[|boolean|]; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "boolean", + "textSpan": { + "start": 67, + "length": 7 + }, + "displayParts": [ + { + "text": "boolean", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 67, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 77, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: boolean): boolean; +// type T = /*FIND ALL REFS*/[|never|]; type U = [|never|]; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "never", + "textSpan": { + "start": 95, + "length": 5 + }, + "displayParts": [ + { + "text": "never", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 95, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 111, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: boolean): boolean; +// type T = [|never|]; type U = /*FIND ALL REFS*/[|never|]; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "never", + "textSpan": { + "start": 95, + "length": 5 + }, + "displayParts": [ + { + "text": "never", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 95, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 111, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: /*FIND ALL REFS*/[|number|]): [|number|]; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "number", + "textSpan": { + "start": 132, + "length": 6 + }, + "displayParts": [ + { + "text": "number", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 132, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 141, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: [|number|]): /*FIND ALL REFS*/[|number|]; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "number", + "textSpan": { + "start": 132, + "length": 6 + }, + "displayParts": [ + { + "text": "number", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 132, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 141, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: /*FIND ALL REFS*/[|object|]): [|object|]; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "object", + "textSpan": { + "start": 163, + "length": 6 + }, + "displayParts": [ + { + "text": "object", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 163, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 172, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: [|object|]): /*FIND ALL REFS*/[|object|]; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "object", + "textSpan": { + "start": 163, + "length": 6 + }, + "displayParts": [ + { + "text": "object", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 163, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 172, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: /*FIND ALL REFS*/[|string|]): [|string|]; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "string", + "textSpan": { + "start": 194, + "length": 6 + }, + "displayParts": [ + { + "text": "string", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 194, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 203, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: [|string|]): /*FIND ALL REFS*/[|string|]; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "string", + "textSpan": { + "start": 194, + "length": 6 + }, + "displayParts": [ + { + "text": "string", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 194, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 203, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: /*FIND ALL REFS*/[|symbol|]): [|symbol|]; +// function v(v: void): void; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "symbol", + "textSpan": { + "start": 226, + "length": 6 + }, + "displayParts": [ + { + "text": "symbol", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 226, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 235, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: [|symbol|]): /*FIND ALL REFS*/[|symbol|]; +// function v(v: void): void; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "symbol", + "textSpan": { + "start": 226, + "length": 6 + }, + "displayParts": [ + { + "text": "symbol", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 226, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 235, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: /*FIND ALL REFS*/[|void|]): [|void|]; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "void", + "textSpan": { + "start": 257, + "length": 4 + }, + "displayParts": [ + { + "text": "void", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 257, + "length": 4 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 264, + "length": 4 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: any = 0; +// const any = 2; +// const y: any = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: [|void|]): /*FIND ALL REFS*/[|void|]; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "void", + "textSpan": { + "start": 257, + "length": 4 + }, + "displayParts": [ + { + "text": "void", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 257, + "length": 4 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 264, + "length": 4 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// const x: [|any|] = 0; +// const any = 2; +// const y: [|any|] = any; +// function f(b: boolean): boolean; +// type T = never; type U = never; +// function n(x: number): number; +// function o(x: object): object; +// function s(x: string): string; +// function sy(s: symbol): symbol; +// function v(v: void): void; + +// === /tests/cases/fourslash/b.ts === +// const z: /*FIND ALL REFS*/[|any|] = 0; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "keyword", + "name": "any", + "textSpan": { + "start": 9, + "length": 3 + }, + "displayParts": [ + { + "text": "any", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 9, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 42, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 9, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/b.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] \ No newline at end of file diff --git a/tests/baselines/reference/findReferencesAfterEdit.1.baseline.jsonc b/tests/baselines/reference/findReferencesAfterEdit.1.baseline.jsonc new file mode 100644 index 00000000000..4c45cf3c272 --- /dev/null +++ b/tests/baselines/reference/findReferencesAfterEdit.1.baseline.jsonc @@ -0,0 +1,195 @@ +// === /tests/cases/fourslash/a.ts === +// interface A { +// /*FIND ALL REFS*/[|foo|]: string; +// } + +// === /tests/cases/fourslash/b.ts === +// /// +// +// function foo(x: A) { +// x.[|foo|] +// } + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "property", + "name": "(property) A.foo: string", + "textSpan": { + "start": 18, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "foo", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 18, + "length": 12 + } + }, + "references": [ + { + "textSpan": { + "start": 18, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "contextSpan": { + "start": 18, + "length": 12 + }, + "isWriteAccess": false, + "isDefinition": true + }, + { + "textSpan": { + "start": 56, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/b.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// interface A { +// [|foo|]: string; +// } + +// === /tests/cases/fourslash/b.ts === +// /// +// +// function foo(x: A) { +// x./*FIND ALL REFS*/[|foo|] +// } + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "property", + "name": "(property) A.foo: string", + "textSpan": { + "start": 18, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "foo", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 18, + "length": 12 + } + }, + "references": [ + { + "textSpan": { + "start": 18, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "contextSpan": { + "start": 18, + "length": 12 + }, + "isWriteAccess": false, + "isDefinition": true + }, + { + "textSpan": { + "start": 56, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/b.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] \ No newline at end of file diff --git a/tests/baselines/reference/findReferencesAfterEdit.2.baseline.jsonc b/tests/baselines/reference/findReferencesAfterEdit.2.baseline.jsonc new file mode 100644 index 00000000000..193611f636c --- /dev/null +++ b/tests/baselines/reference/findReferencesAfterEdit.2.baseline.jsonc @@ -0,0 +1,197 @@ +// === /tests/cases/fourslash/a.ts === +// interface A { +// /*FIND ALL REFS*/[|foo|]: string; +// } + +// === /tests/cases/fourslash/b.ts === +// /// +// +// +// function foo(x: A) { +// x.[|foo|] +// } + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "property", + "name": "(property) A.foo: string", + "textSpan": { + "start": 18, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "foo", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 18, + "length": 12 + } + }, + "references": [ + { + "textSpan": { + "start": 18, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "contextSpan": { + "start": 18, + "length": 12 + }, + "isWriteAccess": false, + "isDefinition": true + }, + { + "textSpan": { + "start": 57, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/b.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.ts === +// interface A { +// [|foo|]: string; +// } + +// === /tests/cases/fourslash/b.ts === +// /// +// +// +// function foo(x: A) { +// x./*FIND ALL REFS*/[|foo|] +// } + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.ts", + "kind": "property", + "name": "(property) A.foo: string", + "textSpan": { + "start": 18, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "foo", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 18, + "length": 12 + } + }, + "references": [ + { + "textSpan": { + "start": 18, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/a.ts", + "contextSpan": { + "start": 18, + "length": 12 + }, + "isWriteAccess": false, + "isDefinition": true + }, + { + "textSpan": { + "start": 57, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/b.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] \ No newline at end of file diff --git a/tests/baselines/reference/findReferencesJSXTagName3.baseline.jsonc b/tests/baselines/reference/findReferencesJSXTagName3.baseline.jsonc new file mode 100644 index 00000000000..c7b6b7c1c6c --- /dev/null +++ b/tests/baselines/reference/findReferencesJSXTagName3.baseline.jsonc @@ -0,0 +1,1173 @@ +// === /a.tsx === +// namespace JSX { +// export interface Element { } +// export interface IntrinsicElements { +// /*FIND ALL REFS*/[|div|]: any; +// } +// } +// +// const Comp = () => +// <[|div|]> +// Some content +// <[|div|]>More content +// ; +// +// const x = +// Content +// ; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/a.tsx", + "kind": "property", + "name": "(property) JSX.IntrinsicElements.div: any", + "textSpan": { + "start": 98, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSX", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "IntrinsicElements", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "div", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 98, + "length": 9 + } + }, + "references": [ + { + "textSpan": { + "start": 98, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 98, + "length": 9 + }, + "isWriteAccess": false, + "isDefinition": true + }, + { + "textSpan": { + "start": 141, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 140, + "length": 69 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 176, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 175, + "length": 23 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 194, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 175, + "length": 23 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 205, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 140, + "length": 69 + }, + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /a.tsx === +// namespace JSX { +// export interface Element { } +// export interface IntrinsicElements { +// [|div|]: any; +// } +// } +// +// const Comp = () => +// +// Some content +// <[|div|]>More content +// ; +// +// const x = +// Content +// ; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/a.tsx", + "kind": "property", + "name": "(property) JSX.IntrinsicElements.div: any", + "textSpan": { + "start": 98, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSX", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "IntrinsicElements", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "div", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 98, + "length": 9 + } + }, + "references": [ + { + "textSpan": { + "start": 98, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 98, + "length": 9 + }, + "isWriteAccess": false, + "isDefinition": true + }, + { + "textSpan": { + "start": 141, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 140, + "length": 69 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 176, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 175, + "length": 23 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 194, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 175, + "length": 23 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 205, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 140, + "length": 69 + }, + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /a.tsx === +// namespace JSX { +// export interface Element { } +// export interface IntrinsicElements { +// [|div|]: any; +// } +// } +// +// const Comp = () => +// <[|div|]> +// Some content +// More content +// ; +// +// const x = +// Content +// ; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/a.tsx", + "kind": "property", + "name": "(property) JSX.IntrinsicElements.div: any", + "textSpan": { + "start": 98, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSX", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "IntrinsicElements", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "div", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 98, + "length": 9 + } + }, + "references": [ + { + "textSpan": { + "start": 98, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 98, + "length": 9 + }, + "isWriteAccess": false, + "isDefinition": true + }, + { + "textSpan": { + "start": 141, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 140, + "length": 69 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 176, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 175, + "length": 23 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 194, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 175, + "length": 23 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 205, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 140, + "length": 69 + }, + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /a.tsx === +// namespace JSX { +// export interface Element { } +// export interface IntrinsicElements { +// [|div|]: any; +// } +// } +// +// const Comp = () => +// <[|div|]> +// Some content +// <[|div|]>More content +// ; +// +// const x = +// Content +// ; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/a.tsx", + "kind": "property", + "name": "(property) JSX.IntrinsicElements.div: any", + "textSpan": { + "start": 98, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSX", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "IntrinsicElements", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "div", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 98, + "length": 9 + } + }, + "references": [ + { + "textSpan": { + "start": 98, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 98, + "length": 9 + }, + "isWriteAccess": false, + "isDefinition": true + }, + { + "textSpan": { + "start": 141, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 140, + "length": 69 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 176, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 175, + "length": 23 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 194, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 175, + "length": 23 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 205, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 140, + "length": 69 + }, + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /a.tsx === +// namespace JSX { +// export interface Element { } +// export interface IntrinsicElements { +// [|div|]: any; +// } +// } +// +// const Comp = () => +// <[|div|]> +// Some content +// <[|div|]>More content +// ; +// +// const x = +// Content +// ; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/a.tsx", + "kind": "property", + "name": "(property) JSX.IntrinsicElements.div: any", + "textSpan": { + "start": 98, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSX", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "IntrinsicElements", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "div", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 98, + "length": 9 + } + }, + "references": [ + { + "textSpan": { + "start": 98, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 98, + "length": 9 + }, + "isWriteAccess": false, + "isDefinition": true + }, + { + "textSpan": { + "start": 141, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 140, + "length": 69 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 176, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 175, + "length": 23 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 194, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 175, + "length": 23 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 205, + "length": 3 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 140, + "length": 69 + }, + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /a.tsx === +// namespace JSX { +// export interface Element { } +// export interface IntrinsicElements { +// div: any; +// } +// } +// +// const /*FIND ALL REFS*/[|Comp|] = () => +//
+// Some content +//
More content
+//
; +// +// const x = <[|Comp|]> +// Content +// ; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/a.tsx", + "kind": "const", + "name": "const Comp: () => JSX.Element", + "textSpan": { + "start": 123, + "length": 4 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Comp", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSX", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "Element", + "kind": "interfaceName" + } + ], + "contextSpan": { + "start": 117, + "length": 93 + } + }, + "references": [ + { + "textSpan": { + "start": 123, + "length": 4 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 117, + "length": 93 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 223, + "length": 4 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 222, + "length": 26 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 243, + "length": 4 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 222, + "length": 26 + }, + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /a.tsx === +// namespace JSX { +// export interface Element { } +// export interface IntrinsicElements { +// div: any; +// } +// } +// +// const [|Comp|] = () => +//
+// Some content +//
More content
+//
; +// +// const x = +// Content +// ; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/a.tsx", + "kind": "const", + "name": "const Comp: () => JSX.Element", + "textSpan": { + "start": 123, + "length": 4 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Comp", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSX", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "Element", + "kind": "interfaceName" + } + ], + "contextSpan": { + "start": 117, + "length": 93 + } + }, + "references": [ + { + "textSpan": { + "start": 123, + "length": 4 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 117, + "length": 93 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 223, + "length": 4 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 222, + "length": 26 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 243, + "length": 4 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 222, + "length": 26 + }, + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /a.tsx === +// namespace JSX { +// export interface Element { } +// export interface IntrinsicElements { +// div: any; +// } +// } +// +// const [|Comp|] = () => +//
+// Some content +//
More content
+//
; +// +// const x = <[|Comp|]> +// Content +// ; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/a.tsx", + "kind": "const", + "name": "const Comp: () => JSX.Element", + "textSpan": { + "start": 123, + "length": 4 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Comp", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSX", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "Element", + "kind": "interfaceName" + } + ], + "contextSpan": { + "start": 117, + "length": 93 + } + }, + "references": [ + { + "textSpan": { + "start": 123, + "length": 4 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 117, + "length": 93 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 223, + "length": 4 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 222, + "length": 26 + }, + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 243, + "length": 4 + }, + "fileName": "/a.tsx", + "contextSpan": { + "start": 222, + "length": 26 + }, + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] \ No newline at end of file diff --git a/tests/baselines/reference/jsDocServices.baseline.jsonc b/tests/baselines/reference/jsDocServices.baseline.jsonc new file mode 100644 index 00000000000..570bc451f21 --- /dev/null +++ b/tests/baselines/reference/jsDocServices.baseline.jsonc @@ -0,0 +1,290 @@ +// === /tests/cases/fourslash/jsDocServices.ts === +// interface I {} +// +// /** +// * @param /*FIND ALL REFS*/[|foo|] I pity the foo +// */ +// function f([|foo|]: I) { +// return [|foo|]; +// } + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/jsDocServices.ts", + "kind": "parameter", + "name": "(parameter) foo: I", + "textSpan": { + "start": 64, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + } + ], + "contextSpan": { + "start": 64, + "length": 6 + } + }, + "references": [ + { + "textSpan": { + "start": 30, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/jsDocServices.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 64, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/jsDocServices.ts", + "contextSpan": { + "start": 64, + "length": 6 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 85, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/jsDocServices.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/jsDocServices.ts === +// interface I {} +// +// /** +// * @param [|foo|] I pity the foo +// */ +// function f(/*FIND ALL REFS*/[|foo|]: I) { +// return [|foo|]; +// } + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/jsDocServices.ts", + "kind": "parameter", + "name": "(parameter) foo: I", + "textSpan": { + "start": 64, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + } + ], + "contextSpan": { + "start": 64, + "length": 6 + } + }, + "references": [ + { + "textSpan": { + "start": 30, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/jsDocServices.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 64, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/jsDocServices.ts", + "contextSpan": { + "start": 64, + "length": 6 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 85, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/jsDocServices.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/jsDocServices.ts === +// interface I {} +// +// /** +// * @param [|foo|] I pity the foo +// */ +// function f([|foo|]: I) { +// return /*FIND ALL REFS*/[|foo|]; +// } + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/jsDocServices.ts", + "kind": "parameter", + "name": "(parameter) foo: I", + "textSpan": { + "start": 64, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + } + ], + "contextSpan": { + "start": 64, + "length": 6 + } + }, + "references": [ + { + "textSpan": { + "start": 30, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/jsDocServices.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 64, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/jsDocServices.ts", + "contextSpan": { + "start": 64, + "length": 6 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 85, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/jsDocServices.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] \ No newline at end of file diff --git a/tests/baselines/reference/jsdocTypedefTagServices.baseline.jsonc b/tests/baselines/reference/jsdocTypedefTagServices.baseline.jsonc new file mode 100644 index 00000000000..f6e6bbfd98d --- /dev/null +++ b/tests/baselines/reference/jsdocTypedefTagServices.baseline.jsonc @@ -0,0 +1,241 @@ +// === /tests/cases/fourslash/a.js === +// /** +// * Doc comment +// * @typedef [|Product|] +// * @property {string} title +// */ +// /** +// * @type {/*FIND ALL REFS*/[|Product|]} +// */ +// const product = null; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.js", + "kind": "type", + "name": "type Product = {\n title: string;\n}", + "textSpan": { + "start": 31, + "length": 7 + }, + "displayParts": [ + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Product", + "kind": "aliasName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "title", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "contextSpan": { + "start": 22, + "length": 46 + } + }, + "references": [ + { + "textSpan": { + "start": 31, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/a.js", + "contextSpan": { + "start": 22, + "length": 46 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 85, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/a.js", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/a.js === +// /** +// * Doc comment +// * @typedef /*FIND ALL REFS*/[|Product|] +// * @property {string} title +// */ +// /** +// * @type {[|Product|]} +// */ +// const product = null; + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/a.js", + "kind": "type", + "name": "type Product = {\n title: string;\n}", + "textSpan": { + "start": 31, + "length": 7 + }, + "displayParts": [ + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Product", + "kind": "aliasName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "title", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "contextSpan": { + "start": 22, + "length": 46 + } + }, + "references": [ + { + "textSpan": { + "start": 31, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/a.js", + "contextSpan": { + "start": 22, + "length": 46 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 85, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/a.js", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] \ No newline at end of file diff --git a/tests/baselines/reference/localGetReferences.baseline.jsonc b/tests/baselines/reference/localGetReferences.baseline.jsonc index 56e8f0fd8e9..436ad073390 100644 --- a/tests/baselines/reference/localGetReferences.baseline.jsonc +++ b/tests/baselines/reference/localGetReferences.baseline.jsonc @@ -1,3 +1,10294 @@ +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// /*FIND ALL REFS*/var [|globalVar|]: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// [|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// [|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls([|globalVar|]); +// // References to a function argument. +// foo([|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// [|globalVar|] = [|globalVar|] + [|globalVar|]; +// +// //ETC - Other cases +// [|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "var", + "name": "var globalVar: number", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 83, + "length": 26 + } + }, + "references": [ + { + "textSpan": { + "start": 87, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 83, + "length": 26 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 351, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 701, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 865, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1047, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1266, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1320, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1382, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1394, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1406, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1438, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var /*FIND ALL REFS*/[|globalVar|]: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// [|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// [|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls([|globalVar|]); +// // References to a function argument. +// foo([|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// [|globalVar|] = [|globalVar|] + [|globalVar|]; +// +// //ETC - Other cases +// [|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "var", + "name": "var globalVar: number", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 83, + "length": 26 + } + }, + "references": [ + { + "textSpan": { + "start": 87, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 83, + "length": 26 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 351, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 701, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 865, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1047, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1266, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1320, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1382, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1394, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1406, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1438, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// /*FIND ALL REFS*/static [|clsSVar|] = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.[|clsSVar|]++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.[|clsSVar|]++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.[|clsSVar|]++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "property", + "name": "(property) fooCls.clsSVar: number", + "textSpan": { + "start": 195, + "length": 7 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "clsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 188, + "length": 19 + } + }, + "references": [ + { + "textSpan": { + "start": 195, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 188, + "length": 19 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 402, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 686, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 889, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1075, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1353, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static /*FIND ALL REFS*/[|clsSVar|] = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.[|clsSVar|]++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.[|clsSVar|]++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.[|clsSVar|]++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "property", + "name": "(property) fooCls.clsSVar: number", + "textSpan": { + "start": 195, + "length": 7 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "clsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 188, + "length": 19 + } + }, + "references": [ + { + "textSpan": { + "start": 195, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 188, + "length": 19 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 402, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 686, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 889, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1075, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1353, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// /*FIND ALL REFS*/[|clsVar|] = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.[|clsVar|]++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "property", + "name": "(property) fooCls.clsVar: number", + "textSpan": { + "start": 265, + "length": 6 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "clsVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 265, + "length": 11 + } + }, + "references": [ + { + "textSpan": { + "start": 265, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 265, + "length": 11 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 377, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (/*FIND ALL REFS*/public [|clsParam|]: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.[|clsParam|]++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "property", + "name": "(property) fooCls.clsParam: number", + "textSpan": { + "start": 302, + "length": 8 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "clsParam", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 295, + "length": 23 + } + }, + "references": [ + { + "textSpan": { + "start": 302, + "length": 8 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 295, + "length": 23 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 470, + "length": 8 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public /*FIND ALL REFS*/[|clsParam|]: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.[|clsParam|]++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "property", + "name": "(property) fooCls.clsParam: number", + "textSpan": { + "start": 302, + "length": 8 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "clsParam", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 295, + "length": 23 + } + }, + "references": [ + { + "textSpan": { + "start": 302, + "length": 8 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 295, + "length": 23 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 470, + "length": 8 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var [|globalVar|]: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// /*FIND ALL REFS*/[|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// [|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls([|globalVar|]); +// // References to a function argument. +// foo([|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// [|globalVar|] = [|globalVar|] + [|globalVar|]; +// +// //ETC - Other cases +// [|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "var", + "name": "var globalVar: number", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 83, + "length": 26 + } + }, + "references": [ + { + "textSpan": { + "start": 87, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 83, + "length": 26 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 351, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 701, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 865, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1047, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1266, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1320, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1382, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1394, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1406, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1438, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// [|clsVar|] = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this./*FIND ALL REFS*/[|clsVar|]++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "property", + "name": "(property) fooCls.clsVar: number", + "textSpan": { + "start": 265, + "length": 6 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "clsVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 265, + "length": 11 + } + }, + "references": [ + { + "textSpan": { + "start": 265, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 265, + "length": 11 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 377, + "length": 6 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static [|clsSVar|] = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls./*FIND ALL REFS*/[|clsSVar|]++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.[|clsSVar|]++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.[|clsSVar|]++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "property", + "name": "(property) fooCls.clsSVar: number", + "textSpan": { + "start": 195, + "length": 7 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "clsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 188, + "length": 19 + } + }, + "references": [ + { + "textSpan": { + "start": 195, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 188, + "length": 19 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 402, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 686, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 889, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1075, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1353, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public [|clsParam|]: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this./*FIND ALL REFS*/[|clsParam|]++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "property", + "name": "(property) fooCls.clsParam: number", + "textSpan": { + "start": 302, + "length": 8 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "clsParam", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 295, + "length": 23 + } + }, + "references": [ + { + "textSpan": { + "start": 302, + "length": 8 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 295, + "length": 23 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 470, + "length": 8 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// /*FIND ALL REFS*/function [|foo|](x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = [|foo|]; +// } +// +// function testFn(){ +// static boo = [|foo|]; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = [|foo|]; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// [|foo|](globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// [|foo|] = [|foo|] + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "function", + "name": "function foo(x: number): number", + "textSpan": { + "start": 565, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "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" + } + ], + "contextSpan": { + "start": 556, + "length": 224 + } + }, + "references": [ + { + "textSpan": { + "start": 565, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 556, + "length": 224 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 956, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1012, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1150, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1316, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1490, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function /*FIND ALL REFS*/[|foo|](x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = [|foo|]; +// } +// +// function testFn(){ +// static boo = [|foo|]; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = [|foo|]; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// [|foo|](globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// [|foo|] = [|foo|] + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "function", + "name": "function foo(x: number): number", + "textSpan": { + "start": 565, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "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" + } + ], + "contextSpan": { + "start": 556, + "length": 224 + } + }, + "references": [ + { + "textSpan": { + "start": 565, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 556, + "length": 224 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 956, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1012, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1150, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1316, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1490, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(/*FIND ALL REFS*/[|x|]: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return [|x|]++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "parameter", + "name": "(parameter) x: number", + "textSpan": { + "start": 569, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 569, + "length": 9 + } + }, + "references": [ + { + "textSpan": { + "start": 569, + "length": 1 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 569, + "length": 9 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 774, + "length": 1 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// /*FIND ALL REFS*/var [|fnVar|] = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// [|fnVar|]++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "local var", + "name": "(local var) fnVar: number", + "textSpan": { + "start": 646, + "length": 5 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local var", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fnVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 642, + "length": 14 + } + }, + "references": [ + { + "textSpan": { + "start": 646, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 642, + "length": 14 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 740, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var /*FIND ALL REFS*/[|fnVar|] = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// [|fnVar|]++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "local var", + "name": "(local var) fnVar: number", + "textSpan": { + "start": 646, + "length": 5 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local var", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fnVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 642, + "length": 14 + } + }, + "references": [ + { + "textSpan": { + "start": 646, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 642, + "length": 14 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 740, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static [|clsSVar|] = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.[|clsSVar|]++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls./*FIND ALL REFS*/[|clsSVar|]++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.[|clsSVar|]++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "property", + "name": "(property) fooCls.clsSVar: number", + "textSpan": { + "start": 195, + "length": 7 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "clsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 188, + "length": 19 + } + }, + "references": [ + { + "textSpan": { + "start": 195, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 188, + "length": 19 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 402, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 686, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 889, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1075, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1353, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var [|globalVar|]: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// [|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// /*FIND ALL REFS*/[|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls([|globalVar|]); +// // References to a function argument. +// foo([|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// [|globalVar|] = [|globalVar|] + [|globalVar|]; +// +// //ETC - Other cases +// [|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "var", + "name": "var globalVar: number", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 83, + "length": 26 + } + }, + "references": [ + { + "textSpan": { + "start": 87, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 83, + "length": 26 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 351, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 701, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 865, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1047, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1266, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1320, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1382, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1394, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1406, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1438, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var [|fnVar|] = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// /*FIND ALL REFS*/[|fnVar|]++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "local var", + "name": "(local var) fnVar: number", + "textSpan": { + "start": 646, + "length": 5 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local var", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fnVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 642, + "length": 14 + } + }, + "references": [ + { + "textSpan": { + "start": 646, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 642, + "length": 14 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 740, + "length": 5 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo([|x|]: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return /*FIND ALL REFS*/[|x|]++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "parameter", + "name": "(parameter) x: number", + "textSpan": { + "start": 569, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 569, + "length": 9 + } + }, + "references": [ + { + "textSpan": { + "start": 569, + "length": 1 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 569, + "length": 9 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 774, + "length": 1 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var [|globalVar|]: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// [|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// [|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// /*FIND ALL REFS*/[|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls([|globalVar|]); +// // References to a function argument. +// foo([|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// [|globalVar|] = [|globalVar|] + [|globalVar|]; +// +// //ETC - Other cases +// [|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "var", + "name": "var globalVar: number", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 83, + "length": 26 + } + }, + "references": [ + { + "textSpan": { + "start": 87, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 83, + "length": 26 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 351, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 701, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 865, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1047, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1266, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1320, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1382, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1394, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1406, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1438, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static [|clsSVar|] = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.[|clsSVar|]++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.[|clsSVar|]++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls./*FIND ALL REFS*/[|clsSVar|]++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.[|clsSVar|]++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "property", + "name": "(property) fooCls.clsSVar: number", + "textSpan": { + "start": 195, + "length": 7 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "clsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 188, + "length": 19 + } + }, + "references": [ + { + "textSpan": { + "start": 195, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 188, + "length": 19 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 402, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 686, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 889, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1075, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1353, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function [|foo|](x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = /*FIND ALL REFS*/[|foo|]; +// } +// +// function testFn(){ +// static boo = [|foo|]; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = [|foo|]; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// [|foo|](globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// [|foo|] = [|foo|] + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "function", + "name": "function foo(x: number): number", + "textSpan": { + "start": 565, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "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" + } + ], + "contextSpan": { + "start": 556, + "length": 224 + } + }, + "references": [ + { + "textSpan": { + "start": 565, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 556, + "length": 224 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 956, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1012, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1150, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1316, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1490, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function [|foo|](x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = [|foo|]; +// } +// +// function testFn(){ +// static boo = /*FIND ALL REFS*/[|foo|]; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = [|foo|]; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// [|foo|](globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// [|foo|] = [|foo|] + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "function", + "name": "function foo(x: number): number", + "textSpan": { + "start": 565, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "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" + } + ], + "contextSpan": { + "start": 556, + "length": 224 + } + }, + "references": [ + { + "textSpan": { + "start": 565, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 556, + "length": 224 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 956, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1012, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1150, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1316, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1490, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var [|globalVar|]: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// [|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// [|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// /*FIND ALL REFS*/[|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls([|globalVar|]); +// // References to a function argument. +// foo([|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// [|globalVar|] = [|globalVar|] + [|globalVar|]; +// +// //ETC - Other cases +// [|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "var", + "name": "var globalVar: number", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 83, + "length": 26 + } + }, + "references": [ + { + "textSpan": { + "start": 87, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 83, + "length": 26 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 351, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 701, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 865, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1047, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1266, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1320, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1382, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1394, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1406, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1438, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static [|clsSVar|] = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.[|clsSVar|]++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.[|clsSVar|]++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls./*FIND ALL REFS*/[|clsSVar|]++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.[|clsSVar|]++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "property", + "name": "(property) fooCls.clsSVar: number", + "textSpan": { + "start": 195, + "length": 7 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "clsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 188, + "length": 19 + } + }, + "references": [ + { + "textSpan": { + "start": 195, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 188, + "length": 19 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 402, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 686, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 889, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1075, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1353, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function [|foo|](x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = [|foo|]; +// } +// +// function testFn(){ +// static boo = [|foo|]; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = /*FIND ALL REFS*/[|foo|]; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// [|foo|](globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// [|foo|] = [|foo|] + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "function", + "name": "function foo(x: number): number", + "textSpan": { + "start": 565, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "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" + } + ], + "contextSpan": { + "start": 556, + "length": 224 + } + }, + "references": [ + { + "textSpan": { + "start": 565, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 556, + "length": 224 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 956, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1012, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1150, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1316, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1490, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var [|globalVar|]: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// [|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// [|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(/*FIND ALL REFS*/[|globalVar|]); +// // References to a function argument. +// foo([|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// [|globalVar|] = [|globalVar|] + [|globalVar|]; +// +// //ETC - Other cases +// [|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "var", + "name": "var globalVar: number", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 83, + "length": 26 + } + }, + "references": [ + { + "textSpan": { + "start": 87, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 83, + "length": 26 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 351, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 701, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 865, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1047, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1266, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1320, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1382, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1394, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1406, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1438, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function [|foo|](x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = [|foo|]; +// } +// +// function testFn(){ +// static boo = [|foo|]; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = [|foo|]; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// /*FIND ALL REFS*/[|foo|](globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// [|foo|] = [|foo|] + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "function", + "name": "function foo(x: number): number", + "textSpan": { + "start": 565, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "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" + } + ], + "contextSpan": { + "start": 556, + "length": 224 + } + }, + "references": [ + { + "textSpan": { + "start": 565, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 556, + "length": 224 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 956, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1012, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1150, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1316, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1490, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var [|globalVar|]: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// [|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// [|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls([|globalVar|]); +// // References to a function argument. +// foo(/*FIND ALL REFS*/[|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// [|globalVar|] = [|globalVar|] + [|globalVar|]; +// +// //ETC - Other cases +// [|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "var", + "name": "var globalVar: number", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 83, + "length": 26 + } + }, + "references": [ + { + "textSpan": { + "start": 87, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 83, + "length": 26 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 351, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 701, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 865, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1047, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1266, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1320, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1382, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1394, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1406, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1438, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static [|clsSVar|] = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.[|clsSVar|]++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.[|clsSVar|]++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls./*FIND ALL REFS*/[|clsSVar|]++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "property", + "name": "(property) fooCls.clsSVar: number", + "textSpan": { + "start": 195, + "length": 7 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "fooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "clsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 188, + "length": 19 + } + }, + "references": [ + { + "textSpan": { + "start": 195, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 188, + "length": 19 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 402, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 686, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 889, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1075, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1353, + "length": 7 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var [|globalVar|]: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// [|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// [|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls([|globalVar|]); +// // References to a function argument. +// foo([|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// /*FIND ALL REFS*/[|globalVar|] = [|globalVar|] + [|globalVar|]; +// +// //ETC - Other cases +// [|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "var", + "name": "var globalVar: number", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 83, + "length": 26 + } + }, + "references": [ + { + "textSpan": { + "start": 87, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 83, + "length": 26 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 351, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 701, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 865, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1047, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1266, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1320, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1382, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1394, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1406, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1438, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var [|globalVar|]: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// [|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// [|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls([|globalVar|]); +// // References to a function argument. +// foo([|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// [|globalVar|] = /*FIND ALL REFS*/[|globalVar|] + [|globalVar|]; +// +// //ETC - Other cases +// [|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "var", + "name": "var globalVar: number", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 83, + "length": 26 + } + }, + "references": [ + { + "textSpan": { + "start": 87, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 83, + "length": 26 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 351, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 701, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 865, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1047, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1266, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1320, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1382, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1394, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1406, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1438, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var [|globalVar|]: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// [|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// [|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls([|globalVar|]); +// // References to a function argument. +// foo([|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// [|globalVar|] = [|globalVar|] + /*FIND ALL REFS*/[|globalVar|]; +// +// //ETC - Other cases +// [|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "var", + "name": "var globalVar: number", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 83, + "length": 26 + } + }, + "references": [ + { + "textSpan": { + "start": 87, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 83, + "length": 26 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 351, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 701, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 865, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1047, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1266, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1320, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1382, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1394, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1406, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1438, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var [|globalVar|]: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// [|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// [|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls([|globalVar|]); +// // References to a function argument. +// foo([|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// [|globalVar|] = [|globalVar|] + [|globalVar|]; +// +// //ETC - Other cases +// /*FIND ALL REFS*/[|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "var", + "name": "var globalVar: number", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 83, + "length": 26 + } + }, + "references": [ + { + "textSpan": { + "start": 87, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 83, + "length": 26 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 351, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 701, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 865, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1047, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1266, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1320, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1382, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1394, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1406, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1438, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function [|foo|](x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = [|foo|]; +// } +// +// function testFn(){ +// static boo = [|foo|]; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = [|foo|]; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// [|foo|](globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// /*FIND ALL REFS*/[|foo|] = [|foo|] + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "function", + "name": "function foo(x: number): number", + "textSpan": { + "start": 565, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "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" + } + ], + "contextSpan": { + "start": 556, + "length": 224 + } + }, + "references": [ + { + "textSpan": { + "start": 565, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 556, + "length": 224 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 956, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1012, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1150, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1316, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1490, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function [|foo|](x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = [|foo|]; +// } +// +// function testFn(){ +// static boo = [|foo|]; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = [|foo|]; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// [|foo|](globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// [|foo|] = /*FIND ALL REFS*/[|foo|] + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "function", + "name": "function foo(x: number): number", + "textSpan": { + "start": 565, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "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" + } + ], + "contextSpan": { + "start": 556, + "length": 224 + } + }, + "references": [ + { + "textSpan": { + "start": 565, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 556, + "length": 224 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 956, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1012, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1150, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1316, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1490, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(/*FIND ALL REFS*/[|globalVar|]: number) { +// //Increments +// [|globalVar|]++; +// return [|globalVar|]; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "parameter", + "name": "(parameter) globalVar: number", + "textSpan": { + "start": 1557, + "length": 9 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 1557, + "length": 17 + } + }, + "references": [ + { + "textSpan": { + "start": 1557, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 1557, + "length": 17 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 1599, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1623, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw([|globalVar|]: number) { +// //Increments +// /*FIND ALL REFS*/[|globalVar|]++; +// return [|globalVar|]; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "parameter", + "name": "(parameter) globalVar: number", + "textSpan": { + "start": 1557, + "length": 9 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 1557, + "length": 17 + } + }, + "references": [ + { + "textSpan": { + "start": 1557, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 1557, + "length": 17 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 1599, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1623, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw([|globalVar|]: number) { +// //Increments +// [|globalVar|]++; +// return /*FIND ALL REFS*/[|globalVar|]; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// // Reference misses function parameter. +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "parameter", + "name": "(parameter) globalVar: number", + "textSpan": { + "start": 1557, + "length": 9 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalVar", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 1557, + "length": 17 + } + }, + "references": [ + { + "textSpan": { + "start": 1557, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "contextSpan": { + "start": 1557, + "length": 17 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 1599, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1623, + "length": 9 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(/*FIND ALL REFS*/[|str|]) { +// +// +// +// // Reference misses function parameter. +// return [|str|] + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "parameter", + "name": "(parameter) str: string", + "textSpan": { + "start": 2052, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "str", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 2052, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 2115, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/localGetReferences_1.ts === +// // Comment Refence Test: globalVar +// // References to a variable declared in global. +// var globalVar: number = 2; +// +// class fooCls { +// // References to static variable declared in a class. +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// // References to a function parameter. +// function foo(x: number) { +// // References to a variable declared in a function. +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function([|str|]) { +// +// +// +// // Reference misses function parameter. +// return /*FIND ALL REFS*/[|str|] + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "kind": "parameter", + "name": "(parameter) str: string", + "textSpan": { + "start": 2052, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "str", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ] + }, + "references": [ + { + "textSpan": { + "start": 2052, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 2115, + "length": 3 + }, + "fileName": "/tests/cases/fourslash/localGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + undefined undefined diff --git a/tests/baselines/reference/remoteGetReferences.baseline.jsonc b/tests/baselines/reference/remoteGetReferences.baseline.jsonc new file mode 100644 index 00000000000..7c89ba1bfd0 --- /dev/null +++ b/tests/baselines/reference/remoteGetReferences.baseline.jsonc @@ -0,0 +1,8919 @@ +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class [|remotefooCls|] { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// [|remotefooCls|].remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: /*FIND ALL REFS*/[|remotefooCls|]; +// +// //Arguments +// remoteclsTest = new [|remotefooCls|](remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "class", + "name": "class remotefooCls", + "textSpan": { + "start": 40, + "length": 12 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + } + ], + "contextSpan": { + "start": 34, + "length": 277 + } + }, + "references": [ + { + "textSpan": { + "start": 1298, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1345, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1418, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 40, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 34, + "length": 277 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 220, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 400, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 634, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 844, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class [|remotefooCls|] { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// [|remotefooCls|].remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: [|remotefooCls|]; +// +// //Arguments +// remoteclsTest = new /*FIND ALL REFS*/[|remotefooCls|](remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "class", + "name": "class remotefooCls", + "textSpan": { + "start": 40, + "length": 12 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + } + ], + "contextSpan": { + "start": 34, + "length": 277 + } + }, + "references": [ + { + "textSpan": { + "start": 1298, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1345, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1418, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 40, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 34, + "length": 277 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 220, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 400, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 634, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 844, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var [|remoteglobalVar|]: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// [|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// [|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(/*FIND ALL REFS*/[|remoteglobalVar|]); +// remotefoo([|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// [|remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|]; +// +// //ETC - Other cases +// [|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "var", + "name": "var remoteglobalVar: number", + "textSpan": { + "start": 4, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remoteglobalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 0, + "length": 32 + } + }, + "references": [ + { + "textSpan": { + "start": 1358, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1386, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1478, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1514, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1552, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 4, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 0, + "length": 32 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 176, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 431, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 614, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 823, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var [|remoteglobalVar|]: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// [|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// [|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls([|remoteglobalVar|]); +// remotefoo(/*FIND ALL REFS*/[|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// [|remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|]; +// +// //ETC - Other cases +// [|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "var", + "name": "var remoteglobalVar: number", + "textSpan": { + "start": 4, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remoteglobalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 0, + "length": 32 + } + }, + "references": [ + { + "textSpan": { + "start": 1358, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1386, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1478, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1514, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1552, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 4, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 0, + "length": 32 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 176, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 431, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 614, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 823, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class [|remotefooCls|] { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// [|remotefooCls|].remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: [|remotefooCls|]; +// +// //Arguments +// remoteclsTest = new [|remotefooCls|](remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// /*FIND ALL REFS*/[|remotefooCls|].remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "class", + "name": "class remotefooCls", + "textSpan": { + "start": 40, + "length": 12 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + } + ], + "contextSpan": { + "start": 34, + "length": 277 + } + }, + "references": [ + { + "textSpan": { + "start": 1298, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1345, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1418, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 40, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 34, + "length": 277 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 220, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 400, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 634, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 844, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static [|remoteclsSVar|] = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// remotefooCls.[|remoteclsSVar|]++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls./*FIND ALL REFS*/[|remoteclsSVar|]++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "property", + "name": "(property) remotefooCls.remoteclsSVar: number", + "textSpan": { + "start": 93, + "length": 13 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "remoteclsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 86, + "length": 25 + } + }, + "references": [ + { + "textSpan": { + "start": 1431, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 93, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 86, + "length": 25 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 233, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 413, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 647, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 857, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var [|remoteglobalVar|]: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// [|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// [|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls([|remoteglobalVar|]); +// remotefoo([|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// /*FIND ALL REFS*/[|remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|]; +// +// //ETC - Other cases +// [|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "var", + "name": "var remoteglobalVar: number", + "textSpan": { + "start": 4, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remoteglobalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 0, + "length": 32 + } + }, + "references": [ + { + "textSpan": { + "start": 1358, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1386, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1478, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1514, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1552, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 4, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 0, + "length": 32 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 176, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 431, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 614, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 823, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var [|remoteglobalVar|]: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// [|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// [|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls([|remoteglobalVar|]); +// remotefoo([|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// [|remoteglobalVar|] = /*FIND ALL REFS*/[|remoteglobalVar|] + [|remoteglobalVar|]; +// +// //ETC - Other cases +// [|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "var", + "name": "var remoteglobalVar: number", + "textSpan": { + "start": 4, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remoteglobalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 0, + "length": 32 + } + }, + "references": [ + { + "textSpan": { + "start": 1358, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1386, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1478, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1514, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1552, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 4, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 0, + "length": 32 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 176, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 431, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 614, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 823, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var [|remoteglobalVar|]: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// [|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// [|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls([|remoteglobalVar|]); +// remotefoo([|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// [|remoteglobalVar|] = [|remoteglobalVar|] + /*FIND ALL REFS*/[|remoteglobalVar|]; +// +// //ETC - Other cases +// [|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "var", + "name": "var remoteglobalVar: number", + "textSpan": { + "start": 4, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remoteglobalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 0, + "length": 32 + } + }, + "references": [ + { + "textSpan": { + "start": 1358, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1386, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1478, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1514, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1552, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 4, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 0, + "length": 32 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 176, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 431, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 614, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 823, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var [|remoteglobalVar|]: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// [|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// [|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls([|remoteglobalVar|]); +// remotefoo([|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// [|remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|]; +// +// //ETC - Other cases +// /*FIND ALL REFS*/[|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "var", + "name": "var remoteglobalVar: number", + "textSpan": { + "start": 4, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remoteglobalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 0, + "length": 32 + } + }, + "references": [ + { + "textSpan": { + "start": 1358, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1386, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1478, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1514, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1552, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 4, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 0, + "length": 32 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 176, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 431, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 614, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 823, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// /*FIND ALL REFS*/var [|remoteglobalVar|]: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// [|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// [|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls([|remoteglobalVar|]); +// remotefoo([|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// [|remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|]; +// +// //ETC - Other cases +// [|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "var", + "name": "var remoteglobalVar: number", + "textSpan": { + "start": 4, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remoteglobalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 0, + "length": 32 + } + }, + "references": [ + { + "textSpan": { + "start": 1358, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1386, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1478, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1514, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1552, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 4, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 0, + "length": 32 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 176, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 431, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 614, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 823, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var /*FIND ALL REFS*/[|remoteglobalVar|]: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// [|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// [|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls([|remoteglobalVar|]); +// remotefoo([|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// [|remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|]; +// +// //ETC - Other cases +// [|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "var", + "name": "var remoteglobalVar: number", + "textSpan": { + "start": 4, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remoteglobalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 0, + "length": 32 + } + }, + "references": [ + { + "textSpan": { + "start": 1358, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1386, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1478, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1514, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1552, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 4, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 0, + "length": 32 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 176, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 431, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 614, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 823, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// /*FIND ALL REFS*/class [|remotefooCls|] { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// [|remotefooCls|].remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: [|remotefooCls|]; +// +// //Arguments +// remoteclsTest = new [|remotefooCls|](remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "class", + "name": "class remotefooCls", + "textSpan": { + "start": 40, + "length": 12 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + } + ], + "contextSpan": { + "start": 34, + "length": 277 + } + }, + "references": [ + { + "textSpan": { + "start": 1298, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1345, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1418, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 40, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 34, + "length": 277 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 220, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 400, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 634, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 844, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class /*FIND ALL REFS*/[|remotefooCls|] { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// [|remotefooCls|].remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: [|remotefooCls|]; +// +// //Arguments +// remoteclsTest = new [|remotefooCls|](remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "class", + "name": "class remotefooCls", + "textSpan": { + "start": 40, + "length": 12 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + } + ], + "contextSpan": { + "start": 34, + "length": 277 + } + }, + "references": [ + { + "textSpan": { + "start": 1298, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1345, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1418, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 40, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 34, + "length": 277 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 220, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 400, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 634, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 844, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class remotefooCls { +// //Declare +// /*FIND ALL REFS*/[|remoteclsVar|] = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.[|remoteclsVar|]++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "property", + "name": "(property) remotefooCls.remoteclsVar: number", + "textSpan": { + "start": 67, + "length": 12 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "remoteclsVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 67, + "length": 17 + } + }, + "references": [ + { + "textSpan": { + "start": 67, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 67, + "length": 17 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 202, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// /*FIND ALL REFS*/static [|remoteclsSVar|] = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// remotefooCls.[|remoteclsSVar|]++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "property", + "name": "(property) remotefooCls.remoteclsSVar: number", + "textSpan": { + "start": 93, + "length": 13 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "remoteclsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 86, + "length": 25 + } + }, + "references": [ + { + "textSpan": { + "start": 1431, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 93, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 86, + "length": 25 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 233, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 413, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 647, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 857, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static /*FIND ALL REFS*/[|remoteclsSVar|] = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// remotefooCls.[|remoteclsSVar|]++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "property", + "name": "(property) remotefooCls.remoteclsSVar: number", + "textSpan": { + "start": 93, + "length": 13 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "remoteclsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 86, + "length": 25 + } + }, + "references": [ + { + "textSpan": { + "start": 1431, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 93, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 86, + "length": 25 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 233, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 413, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 647, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 857, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var [|remoteglobalVar|]: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// /*FIND ALL REFS*/[|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// [|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls([|remoteglobalVar|]); +// remotefoo([|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// [|remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|]; +// +// //ETC - Other cases +// [|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "var", + "name": "var remoteglobalVar: number", + "textSpan": { + "start": 4, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remoteglobalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 0, + "length": 32 + } + }, + "references": [ + { + "textSpan": { + "start": 1358, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1386, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1478, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1514, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1552, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 4, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 0, + "length": 32 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 176, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 431, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 614, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 823, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class remotefooCls { +// //Declare +// [|remoteclsVar|] = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this./*FIND ALL REFS*/[|remoteclsVar|]++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "property", + "name": "(property) remotefooCls.remoteclsVar: number", + "textSpan": { + "start": 67, + "length": 12 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "remoteclsVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 67, + "length": 17 + } + }, + "references": [ + { + "textSpan": { + "start": 67, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 67, + "length": 17 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 202, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class [|remotefooCls|] { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// /*FIND ALL REFS*/[|remotefooCls|].remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: [|remotefooCls|]; +// +// //Arguments +// remoteclsTest = new [|remotefooCls|](remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "class", + "name": "class remotefooCls", + "textSpan": { + "start": 40, + "length": 12 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + } + ], + "contextSpan": { + "start": 34, + "length": 277 + } + }, + "references": [ + { + "textSpan": { + "start": 1298, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1345, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1418, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 40, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 34, + "length": 277 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 220, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 400, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 634, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 844, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static [|remoteclsSVar|] = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// remotefooCls./*FIND ALL REFS*/[|remoteclsSVar|]++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "property", + "name": "(property) remotefooCls.remoteclsSVar: number", + "textSpan": { + "start": 93, + "length": 13 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "remoteclsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 86, + "length": 25 + } + }, + "references": [ + { + "textSpan": { + "start": 1431, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 93, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 86, + "length": 25 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 233, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 413, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 647, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 857, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class [|remotefooCls|] { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// [|remotefooCls|].remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// /*FIND ALL REFS*/[|remotefooCls|].remoteclsSVar++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: [|remotefooCls|]; +// +// //Arguments +// remoteclsTest = new [|remotefooCls|](remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "class", + "name": "class remotefooCls", + "textSpan": { + "start": 40, + "length": 12 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + } + ], + "contextSpan": { + "start": 34, + "length": 277 + } + }, + "references": [ + { + "textSpan": { + "start": 1298, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1345, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1418, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 40, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 34, + "length": 277 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 220, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 400, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 634, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 844, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static [|remoteclsSVar|] = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// remotefooCls.[|remoteclsSVar|]++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls./*FIND ALL REFS*/[|remoteclsSVar|]++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "property", + "name": "(property) remotefooCls.remoteclsSVar: number", + "textSpan": { + "start": 93, + "length": 13 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "remoteclsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 86, + "length": 25 + } + }, + "references": [ + { + "textSpan": { + "start": 1431, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 93, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 86, + "length": 25 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 233, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 413, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 647, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 857, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var [|remoteglobalVar|]: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// [|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// /*FIND ALL REFS*/[|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls([|remoteglobalVar|]); +// remotefoo([|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// [|remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|]; +// +// //ETC - Other cases +// [|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "var", + "name": "var remoteglobalVar: number", + "textSpan": { + "start": 4, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remoteglobalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 0, + "length": 32 + } + }, + "references": [ + { + "textSpan": { + "start": 1358, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1386, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1478, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1514, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1552, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 4, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 0, + "length": 32 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 176, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 431, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 614, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 823, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var [|remoteglobalVar|]: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// [|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// [|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// /*FIND ALL REFS*/[|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls([|remoteglobalVar|]); +// remotefoo([|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// [|remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|]; +// +// //ETC - Other cases +// [|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "var", + "name": "var remoteglobalVar: number", + "textSpan": { + "start": 4, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remoteglobalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 0, + "length": 32 + } + }, + "references": [ + { + "textSpan": { + "start": 1358, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1386, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1478, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1514, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1552, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 4, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 0, + "length": 32 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 176, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 431, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 614, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 823, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class [|remotefooCls|] { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// [|remotefooCls|].remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// /*FIND ALL REFS*/[|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: [|remotefooCls|]; +// +// //Arguments +// remoteclsTest = new [|remotefooCls|](remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "class", + "name": "class remotefooCls", + "textSpan": { + "start": 40, + "length": 12 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + } + ], + "contextSpan": { + "start": 34, + "length": 277 + } + }, + "references": [ + { + "textSpan": { + "start": 1298, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1345, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1418, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 40, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 34, + "length": 277 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 220, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 400, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 634, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 844, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static [|remoteclsSVar|] = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// remotefooCls.[|remoteclsSVar|]++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// remotefooCls./*FIND ALL REFS*/[|remoteclsSVar|]++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "property", + "name": "(property) remotefooCls.remoteclsSVar: number", + "textSpan": { + "start": 93, + "length": 13 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "remoteclsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 86, + "length": 25 + } + }, + "references": [ + { + "textSpan": { + "start": 1431, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 93, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 86, + "length": 25 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 233, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 413, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 647, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 857, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var [|remoteglobalVar|]: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// [|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.remoteclsSVar++; +// [|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// /*FIND ALL REFS*/[|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls([|remoteglobalVar|]); +// remotefoo([|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// [|remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|]; +// +// //ETC - Other cases +// [|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "var", + "name": "var remoteglobalVar: number", + "textSpan": { + "start": 4, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remoteglobalVar", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 0, + "length": 32 + } + }, + "references": [ + { + "textSpan": { + "start": 1358, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1386, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1478, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 1496, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1514, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1552, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 4, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 0, + "length": 32 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 176, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 431, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 614, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 823, + "length": 15 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class [|remotefooCls|] { +// //Declare +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// [|remotefooCls|].remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// /*FIND ALL REFS*/[|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: [|remotefooCls|]; +// +// //Arguments +// remoteclsTest = new [|remotefooCls|](remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "class", + "name": "class remotefooCls", + "textSpan": { + "start": 40, + "length": 12 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + } + ], + "contextSpan": { + "start": 34, + "length": 277 + } + }, + "references": [ + { + "textSpan": { + "start": 1298, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1345, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 1418, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 40, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 34, + "length": 277 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 220, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 400, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 634, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + }, + { + "textSpan": { + "start": 844, + "length": 12 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] + +// === /tests/cases/fourslash/remoteGetReferences_2.ts === +// var remoteglobalVar: number = 2; +// +// class remotefooCls { +// //Declare +// remoteclsVar = 1; +// static [|remoteclsSVar|] = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// remotefooCls.[|remoteclsSVar|]++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// } +// +// function remotefoo(remotex: number) { +// //Declare +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// //Return +// return remotex++; +// } +// +// module remotemodTest { +// //Declare +// export var remotemodVar: number; +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// +// class remotetestCls { +// static remoteboo = remotefoo; +// } +// +// function remotetestFn(){ +// static remoteboo = remotefoo; +// +// //Increments +// remoteglobalVar++; +// remotefooCls./*FIND ALL REFS*/[|remoteclsSVar|]++; +// remotemodVar++; +// } +// +// module remotetestMod { +// var remoteboo = remotefoo; +// } +// } + +// === /tests/cases/fourslash/remoteGetReferences_1.ts === +// // Comment Refence Test: globalVar +// var globalVar: number = 2; +// +// class fooCls { +// static clsSVar = 1; +// //Declare +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.clsSVar++; +// this.clsParam++; +// modTest.modVar++; +// } +// } +// +// function foo(x: number) { +// //Declare +// var fnVar = 1; +// +// //Increments +// fooCls.clsSVar++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// +// //Return +// return x++; +// } +// +// module modTest { +// //Declare +// export var modVar:number; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// +// class testCls { +// static boo = foo; +// } +// +// function testFn(){ +// static boo = foo; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = foo; +// } +// } +// +// //Type test +// var clsTest: fooCls; +// +// //Arguments +// clsTest = new fooCls(globalVar); +// foo(globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// foo = foo + 1; +// err = err++; +// +// //Shadowed fn Parameter +// function shdw(globalVar: number) { +// //Increments +// globalVar++; +// return globalVar; +// } +// +// //Remotes +// //Type test +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls(remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// //ETC - Other cases +// remoteglobalVar = 3; +// +// //Find References misses method param +// var +// +// +// +// array = ["f", "o", "o"]; +// +// array.forEach( +// +// +// function(str) { +// +// +// +// return str + " "; +// +// }); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "kind": "property", + "name": "(property) remotefooCls.remoteclsSVar: number", + "textSpan": { + "start": 93, + "length": 13 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "remotefooCls", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "remoteclsSVar", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "contextSpan": { + "start": 86, + "length": 25 + } + }, + "references": [ + { + "textSpan": { + "start": 1431, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_1.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 93, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "contextSpan": { + "start": 86, + "length": 25 + }, + "isWriteAccess": true, + "isDefinition": true + }, + { + "textSpan": { + "start": 233, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 413, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 647, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + }, + { + "textSpan": { + "start": 857, + "length": 13 + }, + "fileName": "/tests/cases/fourslash/remoteGetReferences_2.ts", + "isWriteAccess": true, + "isDefinition": false + } + ] + } +] \ No newline at end of file diff --git a/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts b/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts index aafb491008b..4017383e2e5 100644 --- a/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts +++ b/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts @@ -7,9 +7,9 @@ //// //// } //// -//// [|public /**/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}start|](){ +//// public /*1*/start(){ //// return this; -//// }|] +//// } //// //// public stop(){ //// return this; @@ -20,9 +20,11 @@ ////import Second = require("./findAllRefsOnDefinition-import"); //// ////var second = new Second.Test() -////second.[|start|](); +////second./*2*/start(); ////second.stop(); +let count = 1; + checkRefs(); cancellation.setCancelled(); @@ -33,5 +35,5 @@ cancellation.resetCancelled(); checkRefs(); function checkRefs() { - verify.singleReferenceGroup("(method) Test.start(): this", "start"); + verify.baselineFindAllReferencesMulti(count++, '1'); } diff --git a/tests/cases/fourslash/findAllRefsPrimitive.ts b/tests/cases/fourslash/findAllRefsPrimitive.ts index 016b9e4bbb9..5b810c7a43c 100644 --- a/tests/cases/fourslash/findAllRefsPrimitive.ts +++ b/tests/cases/fourslash/findAllRefsPrimitive.ts @@ -3,28 +3,28 @@ /// // @Filename: a.ts -////const x: [|any|] = 0; +////const x: /*1*/[|any|] = 0; ////const any = 2; -////const y: [|any|] = any; +////const y: /*2*/[|any|] = any; -////function f(b: [|boolean|]): [|boolean|]; +////function f(b: /*3*/[|boolean|]): /*4*/[|boolean|]; -////type T = [|never|]; type U = [|never|]; +////type T = /*5*/[|never|]; type U = /*6*/[|never|]; -////function n(x: [|number|]): [|number|]; +////function n(x: /*7*/[|number|]): /*8*/[|number|]; -////function o(x: [|object|]): [|object|]; +////function o(x: /*9*/[|object|]): /*10*/[|object|]; -////function s(x: [|string|]): [|string|]; +////function s(x: /*11*/[|string|]): /*12*/[|string|]; -////function sy(s: [|symbol|]): [|symbol|]; +////function sy(s: /*13*/[|symbol|]): /*14*/[|symbol|]; -////function v(v: [|void|]): [|void|]; +////function v(v: /*15*/[|void|]): /*16*/[|void|]; // @Filename: b.ts -// const z: [|any|] = 0; +//// const z: /*17*/[|any|] = 0; -test.rangesByText().forEach((ranges, text) => verify.singleReferenceGroup(text, ranges)); +verify.baselineFindAllReferences('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17'); verify.rangesWithSameTextAreDocumentHighlights(); goTo.rangeStart(test.ranges()[0]); diff --git a/tests/cases/fourslash/findReferencesAfterEdit.ts b/tests/cases/fourslash/findReferencesAfterEdit.ts index 4974132dd12..1fed3434cb2 100644 --- a/tests/cases/fourslash/findReferencesAfterEdit.ts +++ b/tests/cases/fourslash/findReferencesAfterEdit.ts @@ -2,19 +2,19 @@ // @Filename: a.ts ////interface A { -//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}foo|]: string;|] +//// /*1*/foo: string; ////} // @Filename: b.ts /////// /////**/ ////function foo(x: A) { -//// x.[|foo|] +//// x./*2*/foo ////} -verify.singleReferenceGroup("(property) A.foo: string", "foo"); +verify.baselineFindAllReferencesMulti(1, '1', '2'); goTo.marker(""); edit.insert("\n"); -verify.singleReferenceGroup("(property) A.foo: string", "foo"); +verify.baselineFindAllReferencesMulti(2, '1', '2'); diff --git a/tests/cases/fourslash/findReferencesJSXTagName3.ts b/tests/cases/fourslash/findReferencesJSXTagName3.ts index 2613f864730..b55a4a8e694 100644 --- a/tests/cases/fourslash/findReferencesJSXTagName3.ts +++ b/tests/cases/fourslash/findReferencesJSXTagName3.ts @@ -6,27 +6,30 @@ ////namespace JSX { //// export interface Element { } //// export interface IntrinsicElements { -//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}div|]: any;|] +//// [|[|/*1*/div|]: any;|] //// } ////} //// -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}Comp|] = () => -//// [|<[|{| "contextRangeIndex": 4 |}div|]> +////[|const [|/*6*/Comp|] = () => +//// [|<[|/*2*/div|]> //// Some content -//// [|<[|{| "contextRangeIndex": 6 |}div|]>More content|] -//// |];|] +//// [|<[|/*3*/div|]>More content|] +//// |];|] //// -////const x = [|<[|{| "contextRangeIndex": 10 |}Comp|]> +////const x = [|<[|/*7*/Comp|]> //// Content -////|]; +////|]; const [d0Def, d0, c0Def, c0, d1Def, d1, d2Def, d2, d3, d4, c1Def, c1, c2] = test.ranges(); const allD = [d0, d1, d2, d3, d4]; const allC = [c0, c1, c2]; -verify.singleReferenceGroup("(property) JSX.IntrinsicElements.div: any", allD); -verify.singleReferenceGroup("const Comp: () => JSX.Element", allC); +verify.baselineFindAllReferences( + // div occurrences + '1', '2', '3', '4', '5', + // Comp occurrences + '6', '7', '8'); // For document highlights, we will just do tag matching if on a tag. Otherwise we find-all-references. verify.documentHighlightsOf(d0, [d0, d1, d2, d3, d4]); diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index d6e0d3ce80c..486d24d4922 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -322,6 +322,7 @@ declare namespace FourSlashInterface { verifyGetEmitOutputForCurrentFile(expected: string): void; verifyGetEmitOutputContentsForCurrentFile(expected: ts.OutputFile[]): void; baselineFindAllReferences(...markerNames: string[]): void; + baselineFindAllReferencesMulti(seq: number, ...markerNames: string[]): void; baselineGetFileReferences(fileName: string): void; symbolAtLocation(startRange: Range, ...declarationRanges: Range[]): void; typeOfSymbolAtLocation(range: Range, symbol: any, expected: string): void; diff --git a/tests/cases/fourslash/jsDocServices.ts b/tests/cases/fourslash/jsDocServices.ts index 01619abe44d..3710647aff3 100644 --- a/tests/cases/fourslash/jsDocServices.ts +++ b/tests/cases/fourslash/jsDocServices.ts @@ -7,8 +7,8 @@ /////** //// * @param /*use*/[|foo|] I pity the foo //// */ -////function f([|[|/*def*/{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 1 |}foo|]: I|]) { -//// return [|foo|]; +////function f([|[|/*def*/{| "contextRangeIndex": 1 |}foo|]: I|]) { +//// return /*use2*/[|foo|]; ////} const [r0, r1Def, r1, r2] = test.ranges(); @@ -20,6 +20,6 @@ verify.goToType("use", "I"); goTo.marker("use"); verify.quickInfoIs("(parameter) foo: I", "I pity the foo"); -verify.singleReferenceGroup("(parameter) foo: I", ranges); +verify.baselineFindAllReferences("use", "def", "use2"); verify.rangesAreDocumentHighlights(ranges); verify.rangesAreRenameLocations(ranges); diff --git a/tests/cases/fourslash/jsdocTypedefTagServices.ts b/tests/cases/fourslash/jsdocTypedefTagServices.ts index e59713c3b23..b89958fc5d2 100644 --- a/tests/cases/fourslash/jsdocTypedefTagServices.ts +++ b/tests/cases/fourslash/jsdocTypedefTagServices.ts @@ -5,7 +5,7 @@ /////** //// * Doc comment -//// * [|@typedef /*def*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Product|] +//// * [|@typedef /*def*/[|{| "contextRangeIndex": 0 |}Product|] //// * @property {string} title //// |]*/ @@ -25,5 +25,5 @@ verify.goToDefinition("use", "def"); verify.rangesAreOccurrences(/*isWriteAccesss*/ undefined, ranges); verify.rangesAreDocumentHighlights(ranges); -verify.singleReferenceGroup(desc, ranges); +verify.baselineFindAllReferences("use", "def"); verify.rangesAreRenameLocations(ranges); diff --git a/tests/cases/fourslash/localGetReferences.ts b/tests/cases/fourslash/localGetReferences.ts index 752835b51e2..b7d07f13fc0 100644 --- a/tests/cases/fourslash/localGetReferences.ts +++ b/tests/cases/fourslash/localGetReferences.ts @@ -1,66 +1,66 @@ /// // @Filename: localGetReferences_1.ts -////// Comment Refence Test: g/*1*/lobalVar +////// Comment Refence Test: g/*43*/lobalVar ////// References to a variable declared in global. -////[|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}globalVar|]: number = 2;|] +/////*1*/var /*2*/globalVar: number = 2; //// ////class fooCls { //// // References to static variable declared in a class. -//// [|static [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}clsSVar|] = 1;|] +//// /*3*/static /*4*/clsSVar = 1; //// // References to a variable declared in a class. -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}clsVar|] = 1;|] +//// /*5*/clsVar = 1; //// -//// constructor ([|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}clsParam|]: number|]) { +//// constructor (/*6*/public /*7*/clsParam: number) { //// //Increments -//// [|{| "isWriteAccess": true |}globalVar|]++; -//// this.[|{| "isWriteAccess": true |}clsVar|]++; -//// fooCls.[|{| "isWriteAccess": true |}clsSVar|]++; +//// /*8*/globalVar++; +//// this./*9*/clsVar++; +//// fooCls./*10*/clsSVar++; //// // References to a class parameter. -//// this.[|{| "isWriteAccess": true |}clsParam|]++; +//// this./*11*/clsParam++; //// modTest.modVar++; //// } ////} //// ////// References to a function parameter. -////[|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 12 |}foo|]([|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 14 |}x|]: number|]) { +/////*12*/function /*13*/foo(/*14*/x: number) { //// // References to a variable declared in a function. -//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 16 |}fnVar|] = 1;|] +//// /*15*/var /*16*/fnVar = 1; //// //// //Increments -//// fooCls.[|{| "isWriteAccess": true |}clsSVar|]++; -//// [|{| "isWriteAccess": true |}globalVar|]++; +//// fooCls./*17*/clsSVar++; +//// /*18*/globalVar++; //// modTest.modVar++; -//// [|{| "isWriteAccess": true |}fnVar|]++; +//// /*19*/fnVar++; //// //// //Return -//// return [|{| "isWriteAccess": true |}x|]++; -////}|] +//// return /*20*/x++; +////} //// ////module modTest { //// //Declare //// export var modVar:number; //// //// //Increments -//// [|{| "isWriteAccess": true |}globalVar|]++; -//// fooCls.[|{| "isWriteAccess": true |}clsSVar|]++; +//// /*21*/globalVar++; +//// fooCls./*22*/clsSVar++; //// modVar++; //// //// class testCls { -//// static boo = [|foo|]; +//// static boo = /*23*/foo; //// } //// //// function testFn(){ -//// static boo = [|foo|]; +//// static boo = /*24*/foo; //// //// //Increments -//// [|{| "isWriteAccess": true |}globalVar|]++; -//// fooCls.[|{| "isWriteAccess": true |}clsSVar|]++; +//// /*25*/globalVar++; +//// fooCls./*26*/clsSVar++; //// modVar++; //// } //// //// module testMod { -//// var boo = [|foo|]; +//// var boo = /*27*/foo; //// } ////} //// @@ -69,26 +69,26 @@ //// //////Arguments ////// References to a class argument. -////clsTest = new fooCls([|globalVar|]); +////clsTest = new fooCls(/*28*/globalVar); ////// References to a function argument. -////[|foo|]([|globalVar|]); +/////*29*/foo(/*30*/globalVar); //// //////Increments -////fooCls.[|{| "isWriteAccess": true |}clsSVar|]++; +////fooCls./*31*/clsSVar++; ////modTest.modVar++; -////[|{| "isWriteAccess": true |}globalVar|] = [|globalVar|] + [|globalVar|]; +/////*32*/globalVar = /*33*/globalVar + /*34*/globalVar; //// //////ETC - Other cases -////[|{| "isWriteAccess": true |}globalVar|] = 3; +/////*35*/globalVar = 3; ////// References to illegal assignment. -////[|{| "isWriteAccess": true |}foo|] = [|foo|] + 1; -/////*3*/err = err++; -/////*4*/ +/////*36*/foo = /*37*/foo + 1; +/////*44*/err = err++; +/////*45*/ //////Shadowed fn Parameter -////function shdw([|[|{| "isWriteAccess": true, "isDefinition": true, "shadow": true, "contextRangeIndex": 39 |}globalVar|]: number|]) { +////function shdw(/*38*/globalVar: number) { //// //Increments -//// [|{| "isWriteAccess": true, "shadow": true |}globalVar|]++; -//// return [|{| "shadow": true |}globalVar|]; +//// /*39*/globalVar++; +//// return /*40*/globalVar; ////} //// //////Remotes @@ -117,12 +117,12 @@ ////array.forEach( //// //// -////function([|{| "isWriteAccess": true, "isDefinition": true |}str|]) { +////function(/*41*/str) { //// //// //// //// // Reference misses function parameter. -//// return [|str|] + " "; +//// return /*42*/str + " "; //// ////}); @@ -185,55 +185,9 @@ //// } ////} -// References to comment / unresolved symbol / no context -verify.baselineFindAllReferences('1', '3', '4') - -test.rangesByText().forEach((ranges, text) => { - switch (text) { - case "var globalVar: number = 2;": - case "static clsSVar = 1;": - case "clsVar = 1;": - case "public clsParam: number": - case `function foo(x: number) { - // References to a variable declared in a function. - var fnVar = 1; - - //Increments - fooCls.clsSVar++; - globalVar++; - modTest.modVar++; - fnVar++; - - //Return - return x++; -}`: - case "x: number": - case "var fnVar = 1;": - case "globalVar: number": - return; - } - - if (text === "globalVar") { - verify.singleReferenceGroup("(parameter) globalVar: number", ranges.filter(isShadow)); - verify.singleReferenceGroup("var globalVar: number", ranges.filter(r => !isShadow(r))); - return; - } - - const definition = (() => { - switch (text) { - case "fnVar": return "(local var) fnVar: number"; - case "clsSVar": return "(property) fooCls.clsSVar: number"; - case "clsVar": return "(property) fooCls.clsVar: number"; - case "clsParam": return "(property) fooCls.clsParam: number"; - case "foo": return "function foo(x: number): number"; - case "x": return "(parameter) x: number"; - case "str": return "(parameter) str: string"; - default: throw new Error(text); - } - })(); - verify.singleReferenceGroup(definition, ranges); -}); - -function isShadow(r) { - return r.marker && r.marker.data && r.marker.data.shadow; -} +verify.baselineFindAllReferences( + '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', + '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', + '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', + '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', + '41', '42', '43', '44', '45'); diff --git a/tests/cases/fourslash/remoteGetReferences.ts b/tests/cases/fourslash/remoteGetReferences.ts index 5636be5d242..060b16ebe65 100644 --- a/tests/cases/fourslash/remoteGetReferences.ts +++ b/tests/cases/fourslash/remoteGetReferences.ts @@ -86,19 +86,19 @@ //// //////Remotes //////Type test -////var remoteclsTest: [|remotefooCls|]; +////var remoteclsTest: /*1*/remotefooCls; //// //////Arguments -////remoteclsTest = new [|remotefooCls|]([|remoteglobalVar|]); -////remotefoo([|remoteglobalVar|]); +////remoteclsTest = new /*2*/remotefooCls(/*3*/remoteglobalVar); +////remotefoo(/*4*/remoteglobalVar); //// //////Increments -////[|remotefooCls|].[|{| "isWriteAccess": true |}remoteclsSVar|]++; +/////*5*/remotefooCls./*6*/remoteclsSVar++; ////remotemodTest.remotemodVar++; -////[|{| "isWriteAccess": true |}remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|]; +/////*7*/remoteglobalVar = /*8*/remoteglobalVar + /*9*/remoteglobalVar; //// //////ETC - Other cases -////[|{| "isWriteAccess": true |}remoteglobalVar|] = 3; +/////*10*/remoteglobalVar = 3; //// //////Find References misses method param ////var @@ -119,30 +119,30 @@ ////}); // @Filename: remoteGetReferences_2.ts -////[|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 10 |}remoteglobalVar|]: number = 2;|] +/////*11*/var /*12*/remoteglobalVar: number = 2; //// -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 12 |}remotefooCls|] { +/////*13*/class /*14*/remotefooCls { //// //Declare -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 14 |}remoteclsVar|] = 1;|] -//// [|static [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 16 |}remoteclsSVar|] = 1;|] +//// /*15*/remoteclsVar = 1; +//// /*16*/static /*17*/remoteclsSVar = 1; //// //// constructor(public remoteclsParam: number) { //// //Increments -//// [|{| "isWriteAccess": true |}remoteglobalVar|]++; -//// this.[|{| "isWriteAccess": true |}remoteclsVar|]++; -//// [|remotefooCls|].[|{| "isWriteAccess": true |}remoteclsSVar|]++; +//// /*18*/remoteglobalVar++; +//// this./*19*/remoteclsVar++; +//// /*20*/remotefooCls./*21*/remoteclsSVar++; //// this.remoteclsParam++; //// remotemodTest.remotemodVar++; //// } -////}|] +////} //// ////function remotefoo(remotex: number) { //// //Declare //// var remotefnVar = 1; //// //// //Increments -//// [|remotefooCls|].[|{| "isWriteAccess": true |}remoteclsSVar|]++; -//// [|{| "isWriteAccess": true |}remoteglobalVar|]++; +//// /*22*/remotefooCls./*23*/remoteclsSVar++; +//// /*24*/remoteglobalVar++; //// remotemodTest.remotemodVar++; //// remotefnVar++; //// @@ -155,8 +155,8 @@ //// export var remotemodVar: number; //// //// //Increments -//// [|{| "isWriteAccess": true |}remoteglobalVar|]++; -//// [|remotefooCls|].[|{| "isWriteAccess": true |}remoteclsSVar|]++; +//// /*25*/remoteglobalVar++; +//// /*26*/remotefooCls./*27*/remoteclsSVar++; //// remotemodVar++; //// //// class remotetestCls { @@ -167,8 +167,8 @@ //// static remoteboo = remotefoo; //// //// //Increments -//// [|{| "isWriteAccess": true |}remoteglobalVar|]++; -//// [|remotefooCls|].[|{| "isWriteAccess": true |}remoteclsSVar|]++; +//// /*28*/remoteglobalVar++; +//// /*29*/remotefooCls./*30*/remoteclsSVar++; //// remotemodVar++; //// } //// @@ -177,36 +177,7 @@ //// } ////} -test.rangesByText().forEach((ranges, text) => { - // Definitions - if (text === "var remoteglobalVar: number = 2;" || - text === `class remotefooCls { - //Declare - remoteclsVar = 1; - static remoteclsSVar = 1; - - constructor(public remoteclsParam: number) { - //Increments - remoteglobalVar++; - this.remoteclsVar++; - remotefooCls.remoteclsSVar++; - this.remoteclsParam++; - remotemodTest.remotemodVar++; - } -}` || - text == "remoteclsVar = 1;" || - text === "static remoteclsSVar = 1;" - ) return; - - const definition = (() => { - switch (text) { - case "remotefooCls": return "class remotefooCls"; - case "remoteglobalVar": return "var remoteglobalVar: number"; - case "remoteclsSVar": return "(property) remotefooCls.remoteclsSVar: number"; - case "remoteclsVar": return "(property) remotefooCls.remoteclsVar: number"; - default: throw new Error(text); - } - })(); - - verify.singleReferenceGroup(definition, ranges); -}); +verify.baselineFindAllReferences( + '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', + '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', + '21', '22', '23', '24', '25', '26', '27', '28', '29', '30'); \ No newline at end of file