f0fe1b88ca
* Make isDefinition aware of target symbol Initial code, haven't fixed any tests yet. * Update baselines This commit includes a regression for commonjs aliases: ```js // @filename: a.js function f() { } module.exports.f = f // @filename: b.js const { f } = require('./a') f/**/ ``` Now says that `f` in b.js has 1 reference -- the alias `module.exports.f = f`. This is not correct (or not exactly correct), but correctly fixing will involve re-creating the ad-hoc commonjs alias resolution code from the checker. I don't think it's worth it for an edge case like this. * update more unit tests * Fix symbol lookup for constructors * More baselines + two fixes 1. Fix `default` support. 2. Add a secondary declaration location for commonjs assignment declarations. * Update rest of baselines * Switch a few more tests over to baselines
1659 lines
33 KiB
Plaintext
1659 lines
33 KiB
Plaintext
// === /tests/cases/fourslash/referencesForOverrides.ts ===
|
|
// module FindRef3 {
|
|
// module SimpleClassTest {
|
|
// export class Foo {
|
|
// public /*FIND ALL REFS*/[|foo|](): void {
|
|
// }
|
|
// }
|
|
// export class Bar extends Foo {
|
|
// public [|foo|](): void {
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// module SimpleInterfaceTest {
|
|
// export interface IFoo {
|
|
// ifoo(): void;
|
|
// }
|
|
// export interface IBar extends IFoo {
|
|
// ifoo(): void;
|
|
// }
|
|
// }
|
|
//
|
|
// module SimpleClassInterfaceTest {
|
|
// export interface IFoo {
|
|
// icfoo(): void;
|
|
// }
|
|
// export class Bar implements IFoo {
|
|
// public icfoo(): void {
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// module Test {
|
|
// export interface IBase {
|
|
// field: string;
|
|
// method(): void;
|
|
// }
|
|
//
|
|
// export interface IBlah extends IBase {
|
|
// field: string;
|
|
// }
|
|
//
|
|
// export interface IBlah2 extends IBlah {
|
|
// field: string;
|
|
// }
|
|
//
|
|
// export interface IDerived extends IBlah2 {
|
|
// method(): void;
|
|
// }
|
|
//
|
|
// export class Bar implements IDerived {
|
|
// public field: string;
|
|
// public method(): void { }
|
|
// }
|
|
//
|
|
// export class BarBlah extends Bar {
|
|
// public field: string;
|
|
// }
|
|
// }
|
|
//
|
|
// function test() {
|
|
// var x = new SimpleClassTest.Bar();
|
|
// x.[|foo|]();
|
|
//
|
|
// var y: SimpleInterfaceTest.IBar = null;
|
|
// y.ifoo();
|
|
//
|
|
// var w: SimpleClassInterfaceTest.Bar = null;
|
|
// w.icfoo();
|
|
//
|
|
// var z = new Test.BarBlah();
|
|
// z.field = "";
|
|
// z.method();
|
|
// }
|
|
// }
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "method",
|
|
"name": "(method) SimpleClassTest.Foo.foo(): void",
|
|
"textSpan": {
|
|
"start": 75,
|
|
"length": 3
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "method",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "SimpleClassTest",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "Foo",
|
|
"kind": "className"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "foo",
|
|
"kind": "methodName"
|
|
},
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "void",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 68,
|
|
"length": 25
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 75,
|
|
"length": 3
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 68,
|
|
"length": 25
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "method",
|
|
"name": "(method) SimpleClassTest.Bar.foo(): void",
|
|
"textSpan": {
|
|
"start": 141,
|
|
"length": 3
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "method",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "SimpleClassTest",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "Bar",
|
|
"kind": "className"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "foo",
|
|
"kind": "methodName"
|
|
},
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "void",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 134,
|
|
"length": 25
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 141,
|
|
"length": 3
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 134,
|
|
"length": 25
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
},
|
|
{
|
|
"textSpan": {
|
|
"start": 980,
|
|
"length": 3
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForOverrides.ts ===
|
|
// module FindRef3 {
|
|
// module SimpleClassTest {
|
|
// export class Foo {
|
|
// public foo(): void {
|
|
// }
|
|
// }
|
|
// export class Bar extends Foo {
|
|
// public foo(): void {
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// module SimpleInterfaceTest {
|
|
// export interface IFoo {
|
|
// /*FIND ALL REFS*/[|ifoo|](): void;
|
|
// }
|
|
// export interface IBar extends IFoo {
|
|
// [|ifoo|](): void;
|
|
// }
|
|
// }
|
|
//
|
|
// module SimpleClassInterfaceTest {
|
|
// export interface IFoo {
|
|
// icfoo(): void;
|
|
// }
|
|
// export class Bar implements IFoo {
|
|
// public icfoo(): void {
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// module Test {
|
|
// export interface IBase {
|
|
// field: string;
|
|
// method(): void;
|
|
// }
|
|
//
|
|
// export interface IBlah extends IBase {
|
|
// field: string;
|
|
// }
|
|
//
|
|
// export interface IBlah2 extends IBlah {
|
|
// field: string;
|
|
// }
|
|
//
|
|
// export interface IDerived extends IBlah2 {
|
|
// method(): void;
|
|
// }
|
|
//
|
|
// export class Bar implements IDerived {
|
|
// public field: string;
|
|
// public method(): void { }
|
|
// }
|
|
//
|
|
// export class BarBlah extends Bar {
|
|
// public field: string;
|
|
// }
|
|
// }
|
|
//
|
|
// function test() {
|
|
// var x = new SimpleClassTest.Bar();
|
|
// x.foo();
|
|
//
|
|
// var y: SimpleInterfaceTest.IBar = null;
|
|
// y.[|ifoo|]();
|
|
//
|
|
// var w: SimpleClassInterfaceTest.Bar = null;
|
|
// w.icfoo();
|
|
//
|
|
// var z = new Test.BarBlah();
|
|
// z.field = "";
|
|
// z.method();
|
|
// }
|
|
// }
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "method",
|
|
"name": "(method) SimpleInterfaceTest.IFoo.ifoo(): void",
|
|
"textSpan": {
|
|
"start": 227,
|
|
"length": 4
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "method",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "SimpleInterfaceTest",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "IFoo",
|
|
"kind": "interfaceName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "ifoo",
|
|
"kind": "methodName"
|
|
},
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "void",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 227,
|
|
"length": 13
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 227,
|
|
"length": 4
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 227,
|
|
"length": 13
|
|
},
|
|
"isWriteAccess": false,
|
|
"isDefinition": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "method",
|
|
"name": "(method) SimpleInterfaceTest.IBar.ifoo(): void",
|
|
"textSpan": {
|
|
"start": 287,
|
|
"length": 4
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "method",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "SimpleInterfaceTest",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "IBar",
|
|
"kind": "interfaceName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "ifoo",
|
|
"kind": "methodName"
|
|
},
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "void",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 287,
|
|
"length": 13
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 287,
|
|
"length": 4
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 287,
|
|
"length": 13
|
|
},
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
},
|
|
{
|
|
"textSpan": {
|
|
"start": 1034,
|
|
"length": 4
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForOverrides.ts ===
|
|
// module FindRef3 {
|
|
// module SimpleClassTest {
|
|
// export class Foo {
|
|
// public foo(): void {
|
|
// }
|
|
// }
|
|
// export class Bar extends Foo {
|
|
// public foo(): void {
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// module SimpleInterfaceTest {
|
|
// export interface IFoo {
|
|
// ifoo(): void;
|
|
// }
|
|
// export interface IBar extends IFoo {
|
|
// ifoo(): void;
|
|
// }
|
|
// }
|
|
//
|
|
// module SimpleClassInterfaceTest {
|
|
// export interface IFoo {
|
|
// /*FIND ALL REFS*/[|icfoo|](): void;
|
|
// }
|
|
// export class Bar implements IFoo {
|
|
// public [|icfoo|](): void {
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// module Test {
|
|
// export interface IBase {
|
|
// field: string;
|
|
// method(): void;
|
|
// }
|
|
//
|
|
// export interface IBlah extends IBase {
|
|
// field: string;
|
|
// }
|
|
//
|
|
// export interface IBlah2 extends IBlah {
|
|
// field: string;
|
|
// }
|
|
//
|
|
// export interface IDerived extends IBlah2 {
|
|
// method(): void;
|
|
// }
|
|
//
|
|
// export class Bar implements IDerived {
|
|
// public field: string;
|
|
// public method(): void { }
|
|
// }
|
|
//
|
|
// export class BarBlah extends Bar {
|
|
// public field: string;
|
|
// }
|
|
// }
|
|
//
|
|
// function test() {
|
|
// var x = new SimpleClassTest.Bar();
|
|
// x.foo();
|
|
//
|
|
// var y: SimpleInterfaceTest.IBar = null;
|
|
// y.ifoo();
|
|
//
|
|
// var w: SimpleClassInterfaceTest.Bar = null;
|
|
// w.[|icfoo|]();
|
|
//
|
|
// var z = new Test.BarBlah();
|
|
// z.field = "";
|
|
// z.method();
|
|
// }
|
|
// }
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "method",
|
|
"name": "(method) SimpleClassInterfaceTest.IFoo.icfoo(): void",
|
|
"textSpan": {
|
|
"start": 373,
|
|
"length": 5
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "method",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "SimpleClassInterfaceTest",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "IFoo",
|
|
"kind": "interfaceName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "icfoo",
|
|
"kind": "methodName"
|
|
},
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "void",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 373,
|
|
"length": 14
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 373,
|
|
"length": 5
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 373,
|
|
"length": 14
|
|
},
|
|
"isWriteAccess": false,
|
|
"isDefinition": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "method",
|
|
"name": "(method) SimpleClassInterfaceTest.Bar.icfoo(): void",
|
|
"textSpan": {
|
|
"start": 439,
|
|
"length": 5
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "method",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "SimpleClassInterfaceTest",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "Bar",
|
|
"kind": "className"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "icfoo",
|
|
"kind": "methodName"
|
|
},
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "void",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 432,
|
|
"length": 27
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 439,
|
|
"length": 5
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 432,
|
|
"length": 27
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
},
|
|
{
|
|
"textSpan": {
|
|
"start": 1105,
|
|
"length": 5
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForOverrides.ts ===
|
|
// module FindRef3 {
|
|
// module SimpleClassTest {
|
|
// export class Foo {
|
|
// public foo(): void {
|
|
// }
|
|
// }
|
|
// export class Bar extends Foo {
|
|
// public foo(): void {
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// module SimpleInterfaceTest {
|
|
// export interface IFoo {
|
|
// ifoo(): void;
|
|
// }
|
|
// export interface IBar extends IFoo {
|
|
// ifoo(): void;
|
|
// }
|
|
// }
|
|
//
|
|
// module SimpleClassInterfaceTest {
|
|
// export interface IFoo {
|
|
// icfoo(): void;
|
|
// }
|
|
// export class Bar implements IFoo {
|
|
// public icfoo(): void {
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// module Test {
|
|
// export interface IBase {
|
|
// /*FIND ALL REFS*/[|field|]: string;
|
|
// method(): void;
|
|
// }
|
|
//
|
|
// export interface IBlah extends IBase {
|
|
// [|field|]: string;
|
|
// }
|
|
//
|
|
// export interface IBlah2 extends IBlah {
|
|
// [|field|]: string;
|
|
// }
|
|
//
|
|
// export interface IDerived extends IBlah2 {
|
|
// method(): void;
|
|
// }
|
|
//
|
|
// export class Bar implements IDerived {
|
|
// public [|field|]: string;
|
|
// public method(): void { }
|
|
// }
|
|
//
|
|
// export class BarBlah extends Bar {
|
|
// public [|field|]: string;
|
|
// }
|
|
// }
|
|
//
|
|
// function test() {
|
|
// var x = new SimpleClassTest.Bar();
|
|
// x.foo();
|
|
//
|
|
// var y: SimpleInterfaceTest.IBar = null;
|
|
// y.ifoo();
|
|
//
|
|
// var w: SimpleClassInterfaceTest.Bar = null;
|
|
// w.icfoo();
|
|
//
|
|
// var z = new Test.BarBlah();
|
|
// z.[|field|] = "";
|
|
// z.method();
|
|
// }
|
|
// }
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "property",
|
|
"name": "(property) Test.IBase.field: string",
|
|
"textSpan": {
|
|
"start": 513,
|
|
"length": 5
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "property",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "Test",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "IBase",
|
|
"kind": "interfaceName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "field",
|
|
"kind": "propertyName"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "string",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 513,
|
|
"length": 14
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 513,
|
|
"length": 5
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 513,
|
|
"length": 14
|
|
},
|
|
"isWriteAccess": false,
|
|
"isDefinition": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "property",
|
|
"name": "(property) Test.IBlah.field: string",
|
|
"textSpan": {
|
|
"start": 596,
|
|
"length": 5
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "property",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "Test",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "IBlah",
|
|
"kind": "interfaceName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "field",
|
|
"kind": "propertyName"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "string",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 596,
|
|
"length": 14
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 596,
|
|
"length": 5
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 596,
|
|
"length": 14
|
|
},
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "property",
|
|
"name": "(property) Test.IBlah2.field: string",
|
|
"textSpan": {
|
|
"start": 661,
|
|
"length": 5
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "property",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "Test",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "IBlah2",
|
|
"kind": "interfaceName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "field",
|
|
"kind": "propertyName"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "string",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 661,
|
|
"length": 14
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 661,
|
|
"length": 5
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 661,
|
|
"length": 14
|
|
},
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "property",
|
|
"name": "(property) Test.Bar.field: string",
|
|
"textSpan": {
|
|
"start": 801,
|
|
"length": 5
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "property",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "Test",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "Bar",
|
|
"kind": "className"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "field",
|
|
"kind": "propertyName"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "string",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 794,
|
|
"length": 21
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 801,
|
|
"length": 5
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 794,
|
|
"length": 21
|
|
},
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "property",
|
|
"name": "(property) Test.BarBlah.field: string",
|
|
"textSpan": {
|
|
"start": 897,
|
|
"length": 5
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "property",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "Test",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "BarBlah",
|
|
"kind": "className"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "field",
|
|
"kind": "propertyName"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "string",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 890,
|
|
"length": 21
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 897,
|
|
"length": 5
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 890,
|
|
"length": 21
|
|
},
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
},
|
|
{
|
|
"textSpan": {
|
|
"start": 1149,
|
|
"length": 5
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForOverrides.ts ===
|
|
// module FindRef3 {
|
|
// module SimpleClassTest {
|
|
// export class Foo {
|
|
// public foo(): void {
|
|
// }
|
|
// }
|
|
// export class Bar extends Foo {
|
|
// public foo(): void {
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// module SimpleInterfaceTest {
|
|
// export interface IFoo {
|
|
// ifoo(): void;
|
|
// }
|
|
// export interface IBar extends IFoo {
|
|
// ifoo(): void;
|
|
// }
|
|
// }
|
|
//
|
|
// module SimpleClassInterfaceTest {
|
|
// export interface IFoo {
|
|
// icfoo(): void;
|
|
// }
|
|
// export class Bar implements IFoo {
|
|
// public icfoo(): void {
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// module Test {
|
|
// export interface IBase {
|
|
// field: string;
|
|
// /*FIND ALL REFS*/[|method|](): void;
|
|
// }
|
|
//
|
|
// export interface IBlah extends IBase {
|
|
// field: string;
|
|
// }
|
|
//
|
|
// export interface IBlah2 extends IBlah {
|
|
// field: string;
|
|
// }
|
|
//
|
|
// export interface IDerived extends IBlah2 {
|
|
// [|method|](): void;
|
|
// }
|
|
//
|
|
// export class Bar implements IDerived {
|
|
// public field: string;
|
|
// public [|method|](): void { }
|
|
// }
|
|
//
|
|
// export class BarBlah extends Bar {
|
|
// public field: string;
|
|
// }
|
|
// }
|
|
//
|
|
// function test() {
|
|
// var x = new SimpleClassTest.Bar();
|
|
// x.foo();
|
|
//
|
|
// var y: SimpleInterfaceTest.IBar = null;
|
|
// y.ifoo();
|
|
//
|
|
// var w: SimpleClassInterfaceTest.Bar = null;
|
|
// w.icfoo();
|
|
//
|
|
// var z = new Test.BarBlah();
|
|
// z.field = "";
|
|
// z.[|method|]();
|
|
// }
|
|
// }
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "method",
|
|
"name": "(method) Test.IBase.method(): void",
|
|
"textSpan": {
|
|
"start": 531,
|
|
"length": 6
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "method",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "Test",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "IBase",
|
|
"kind": "interfaceName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "method",
|
|
"kind": "methodName"
|
|
},
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "void",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 531,
|
|
"length": 15
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 531,
|
|
"length": 6
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 531,
|
|
"length": 15
|
|
},
|
|
"isWriteAccess": false,
|
|
"isDefinition": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "method",
|
|
"name": "(method) Test.IDerived.method(): void",
|
|
"textSpan": {
|
|
"start": 729,
|
|
"length": 6
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "method",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "Test",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "IDerived",
|
|
"kind": "interfaceName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "method",
|
|
"kind": "methodName"
|
|
},
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "void",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 729,
|
|
"length": 15
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 729,
|
|
"length": 6
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 729,
|
|
"length": 15
|
|
},
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"kind": "method",
|
|
"name": "(method) Test.Bar.method(): void",
|
|
"textSpan": {
|
|
"start": 826,
|
|
"length": 6
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "method",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "Test",
|
|
"kind": "moduleName"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "Bar",
|
|
"kind": "className"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "method",
|
|
"kind": "methodName"
|
|
},
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "void",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 819,
|
|
"length": 25
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 826,
|
|
"length": 6
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"contextSpan": {
|
|
"start": 819,
|
|
"length": 25
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
},
|
|
{
|
|
"textSpan": {
|
|
"start": 1171,
|
|
"length": 6
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForOverrides.ts",
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
] |