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
1256 lines
27 KiB
Plaintext
1256 lines
27 KiB
Plaintext
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface Implemented1 {}
|
|
// /*FIND ALL REFS*/class [|C1|] extends Base implements Implemented1 {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// interface I1 extends Base { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// var x;
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "class",
|
|
"name": "class C1",
|
|
"textSpan": {
|
|
"start": 46,
|
|
"length": 2
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "class",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "C1",
|
|
"kind": "className"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 40,
|
|
"length": 91
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 46,
|
|
"length": 2
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 40,
|
|
"length": 91
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": true
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class [|Base|] {}
|
|
// interface Implemented1 {}
|
|
// class C1 /*FIND ALL REFS*/extends [|Base|] implements Implemented1 {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// interface I1 extends [|Base|] { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// var x;
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "class",
|
|
"name": "class Base",
|
|
"textSpan": {
|
|
"start": 6,
|
|
"length": 4
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "class",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "Base",
|
|
"kind": "className"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 0,
|
|
"length": 13
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 6,
|
|
"length": 4
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 0,
|
|
"length": 13
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
},
|
|
{
|
|
"textSpan": {
|
|
"start": 57,
|
|
"length": 4
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
},
|
|
{
|
|
"textSpan": {
|
|
"start": 153,
|
|
"length": 4
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface [|Implemented1|] {}
|
|
// class C1 extends Base /*FIND ALL REFS*/implements [|Implemented1|] {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// interface I1 extends Base { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// var x;
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "interface",
|
|
"name": "interface Implemented1",
|
|
"textSpan": {
|
|
"start": 24,
|
|
"length": 12
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "interface",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "Implemented1",
|
|
"kind": "interfaceName"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 14,
|
|
"length": 25
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 24,
|
|
"length": 12
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 14,
|
|
"length": 25
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
},
|
|
{
|
|
"textSpan": {
|
|
"start": 73,
|
|
"length": 12
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
undefined
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface Implemented1 {}
|
|
// class C1 extends Base implements Implemented1 {
|
|
// /*FIND ALL REFS*/get [|e|]() { return 1; }
|
|
// set [|e|](v) {}
|
|
// }
|
|
// interface I1 extends Base { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// var x;
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "property",
|
|
"name": "(property) C1.e: number",
|
|
"textSpan": {
|
|
"start": 96,
|
|
"length": 1
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "property",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "C1",
|
|
"kind": "className"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "e",
|
|
"kind": "propertyName"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "number",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 92,
|
|
"length": 21
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 96,
|
|
"length": 1
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 92,
|
|
"length": 21
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
},
|
|
{
|
|
"textSpan": {
|
|
"start": 122,
|
|
"length": 1
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 118,
|
|
"length": 11
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface Implemented1 {}
|
|
// class C1 extends Base implements Implemented1 {
|
|
// get [|e|]() { return 1; }
|
|
// /*FIND ALL REFS*/set [|e|](v) {}
|
|
// }
|
|
// interface I1 extends Base { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// var x;
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "property",
|
|
"name": "(property) C1.e: number",
|
|
"textSpan": {
|
|
"start": 96,
|
|
"length": 1
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "property",
|
|
"kind": "text"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "C1",
|
|
"kind": "className"
|
|
},
|
|
{
|
|
"text": ".",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "e",
|
|
"kind": "propertyName"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "number",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 92,
|
|
"length": 21
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 96,
|
|
"length": 1
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 92,
|
|
"length": 21
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
},
|
|
{
|
|
"textSpan": {
|
|
"start": 122,
|
|
"length": 1
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 118,
|
|
"length": 11
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface Implemented1 {}
|
|
// class C1 extends Base implements Implemented1 {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// /*FIND ALL REFS*/interface [|I1|] extends Base { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// var x;
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "interface",
|
|
"name": "interface I1",
|
|
"textSpan": {
|
|
"start": 142,
|
|
"length": 2
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "interface",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "I1",
|
|
"kind": "interfaceName"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 132,
|
|
"length": 29
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 142,
|
|
"length": 2
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 132,
|
|
"length": 29
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class [|Base|] {}
|
|
// interface Implemented1 {}
|
|
// class C1 extends [|Base|] implements Implemented1 {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// interface I1 /*FIND ALL REFS*/extends [|Base|] { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// var x;
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "class",
|
|
"name": "class Base",
|
|
"textSpan": {
|
|
"start": 6,
|
|
"length": 4
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "class",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "Base",
|
|
"kind": "className"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 0,
|
|
"length": 13
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 6,
|
|
"length": 4
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 0,
|
|
"length": 13
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
},
|
|
{
|
|
"textSpan": {
|
|
"start": 57,
|
|
"length": 4
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
},
|
|
{
|
|
"textSpan": {
|
|
"start": 153,
|
|
"length": 4
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
undefined
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface Implemented1 {}
|
|
// class C1 extends Base implements Implemented1 {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// interface I1 extends Base { }
|
|
// /*FIND ALL REFS*/type [|T|] = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// var x;
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "type",
|
|
"name": "type T = {}",
|
|
"textSpan": {
|
|
"start": 167,
|
|
"length": 1
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "type",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "T",
|
|
"kind": "aliasName"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "=",
|
|
"kind": "operator"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "{",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": "}",
|
|
"kind": "punctuation"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 162,
|
|
"length": 12
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 167,
|
|
"length": 1
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 162,
|
|
"length": 12
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface Implemented1 {}
|
|
// class C1 extends Base implements Implemented1 {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// interface I1 extends Base { }
|
|
// type T = { }
|
|
// /*FIND ALL REFS*/enum [|E|] { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// var x;
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "enum",
|
|
"name": "enum E",
|
|
"textSpan": {
|
|
"start": 180,
|
|
"length": 1
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "enum",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "E",
|
|
"kind": "enumName"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 175,
|
|
"length": 10
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 180,
|
|
"length": 1
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 175,
|
|
"length": 10
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface Implemented1 {}
|
|
// class C1 extends Base implements Implemented1 {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// interface I1 extends Base { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// /*FIND ALL REFS*/namespace [|N|] { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// var x;
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "module",
|
|
"name": "namespace N",
|
|
"textSpan": {
|
|
"start": 196,
|
|
"length": 1
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "namespace",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "N",
|
|
"kind": "moduleName"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 186,
|
|
"length": 15
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 196,
|
|
"length": 1
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 186,
|
|
"length": 15
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface Implemented1 {}
|
|
// class C1 extends Base implements Implemented1 {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// interface I1 extends Base { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// /*FIND ALL REFS*/module [|M|] { }
|
|
// function fn() {}
|
|
// var x;
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "module",
|
|
"name": "namespace M",
|
|
"textSpan": {
|
|
"start": 209,
|
|
"length": 1
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "namespace",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "M",
|
|
"kind": "moduleName"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 202,
|
|
"length": 12
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 209,
|
|
"length": 1
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 202,
|
|
"length": 12
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface Implemented1 {}
|
|
// class C1 extends Base implements Implemented1 {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// interface I1 extends Base { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// /*FIND ALL REFS*/function [|fn|]() {}
|
|
// var x;
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "function",
|
|
"name": "function fn(): void",
|
|
"textSpan": {
|
|
"start": 224,
|
|
"length": 2
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "function",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "fn",
|
|
"kind": "functionName"
|
|
},
|
|
{
|
|
"text": "(",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ")",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "void",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 215,
|
|
"length": 16
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 224,
|
|
"length": 2
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 215,
|
|
"length": 16
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": true
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface Implemented1 {}
|
|
// class C1 extends Base implements Implemented1 {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// interface I1 extends Base { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// /*FIND ALL REFS*/var [|x|];
|
|
// let y;
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "var",
|
|
"name": "var x: any",
|
|
"textSpan": {
|
|
"start": 236,
|
|
"length": 1
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "var",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "x",
|
|
"kind": "localName"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "any",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 232,
|
|
"length": 6
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 236,
|
|
"length": 1
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 232,
|
|
"length": 6
|
|
},
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface Implemented1 {}
|
|
// class C1 extends Base implements Implemented1 {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// interface I1 extends Base { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// var x;
|
|
// /*FIND ALL REFS*/let [|y|];
|
|
// const z = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "let",
|
|
"name": "let y: any",
|
|
"textSpan": {
|
|
"start": 243,
|
|
"length": 1
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "let",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "y",
|
|
"kind": "localName"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "any",
|
|
"kind": "keyword"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 239,
|
|
"length": 6
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 243,
|
|
"length": 1
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 239,
|
|
"length": 6
|
|
},
|
|
"isWriteAccess": false,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
// === /tests/cases/fourslash/referencesForDeclarationKeywords.ts ===
|
|
// class Base {}
|
|
// interface Implemented1 {}
|
|
// class C1 extends Base implements Implemented1 {
|
|
// get e() { return 1; }
|
|
// set e(v) {}
|
|
// }
|
|
// interface I1 extends Base { }
|
|
// type T = { }
|
|
// enum E { }
|
|
// namespace N { }
|
|
// module M { }
|
|
// function fn() {}
|
|
// var x;
|
|
// let y;
|
|
// /*FIND ALL REFS*/const [|z|] = 1;
|
|
// interface Implemented2 {}
|
|
// interface Implemented3 {}
|
|
// class C2 implements Implemented2, Implemented3 {}
|
|
// interface I2 extends Implemented2, Implemented3 {}
|
|
|
|
[
|
|
{
|
|
"definition": {
|
|
"containerKind": "",
|
|
"containerName": "",
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"kind": "const",
|
|
"name": "const z: 1",
|
|
"textSpan": {
|
|
"start": 252,
|
|
"length": 1
|
|
},
|
|
"displayParts": [
|
|
{
|
|
"text": "const",
|
|
"kind": "keyword"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "z",
|
|
"kind": "localName"
|
|
},
|
|
{
|
|
"text": ":",
|
|
"kind": "punctuation"
|
|
},
|
|
{
|
|
"text": " ",
|
|
"kind": "space"
|
|
},
|
|
{
|
|
"text": "1",
|
|
"kind": "stringLiteral"
|
|
}
|
|
],
|
|
"contextSpan": {
|
|
"start": 246,
|
|
"length": 12
|
|
}
|
|
},
|
|
"references": [
|
|
{
|
|
"textSpan": {
|
|
"start": 252,
|
|
"length": 1
|
|
},
|
|
"fileName": "/tests/cases/fourslash/referencesForDeclarationKeywords.ts",
|
|
"contextSpan": {
|
|
"start": 246,
|
|
"length": 12
|
|
},
|
|
"isWriteAccess": true,
|
|
"isDefinition": false
|
|
}
|
|
]
|
|
}
|
|
] |