File tree Expand file tree Collapse file tree 3 files changed +94
-2
lines changed Expand file tree Collapse file tree 3 files changed +94
-2
lines changed Original file line number Diff line number Diff line change @@ -1838,13 +1838,13 @@ export namespace Core {
1838
1838
case SyntaxKind . NoSubstitutionTemplateLiteral :
1839
1839
case SyntaxKind . StringLiteral : {
1840
1840
const str = node as StringLiteralLike ;
1841
- return str . text . length === searchSymbolName . length && (
1841
+ return (
1842
1842
isLiteralNameOfPropertyDeclarationOrIndexAccess ( str ) ||
1843
1843
isNameOfModuleDeclaration ( node ) ||
1844
1844
isExpressionOfExternalModuleImportEqualsDeclaration ( node ) ||
1845
1845
( isCallExpression ( node . parent ) && isBindableObjectDefinePropertyCall ( node . parent ) && node . parent . arguments [ 1 ] === node ) ||
1846
1846
isImportOrExportSpecifier ( node . parent )
1847
- ) ;
1847
+ ) && str . text . length === searchSymbolName . length ;
1848
1848
}
1849
1849
1850
1850
case SyntaxKind . NumericLiteral :
Original file line number Diff line number Diff line change
1
+ // === findAllReferences ===
2
+ // === lib.d.ts ===
3
+ // --- (line: --) skipped ---
4
+ //
5
+ // interface Object {
6
+ // /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */
7
+ // <|[|{| isWriteAccess: true |}constructor|]: Function;|>
8
+ //
9
+ // /** Returns a string representation of an object. */
10
+ // toString(): string;
11
+ // --- (line: --) skipped ---
12
+
13
+ // === /tests/cases/fourslash/findAllRefsConstructor.ts ===
14
+ // class A {
15
+ // 'constructor'() { }
16
+ // }
17
+ // const a = new A()
18
+ // console.log(a.[|constructor|]/*FIND ALL REFS*/)
19
+
20
+ // === Definitions ===
21
+ // === lib.d.ts ===
22
+ // --- (line: --) skipped ---
23
+ //
24
+ // interface Object {
25
+ // /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */
26
+ // <|[|constructor|]: Function;|>
27
+ //
28
+ // /** Returns a string representation of an object. */
29
+ // toString(): string;
30
+ // --- (line: --) skipped ---
31
+
32
+ // === Details ===
33
+ [
34
+ {
35
+ "containerKind" : " " ,
36
+ "containerName" : " " ,
37
+ "kind" : " property" ,
38
+ "name" : " (property) Object.constructor: Function" ,
39
+ "displayParts" : [
40
+ {
41
+ "text" : " (" ,
42
+ "kind" : " punctuation"
43
+ },
44
+ {
45
+ "text" : " property" ,
46
+ "kind" : " text"
47
+ },
48
+ {
49
+ "text" : " )" ,
50
+ "kind" : " punctuation"
51
+ },
52
+ {
53
+ "text" : " " ,
54
+ "kind" : " space"
55
+ },
56
+ {
57
+ "text" : " Object" ,
58
+ "kind" : " localName"
59
+ },
60
+ {
61
+ "text" : " ." ,
62
+ "kind" : " punctuation"
63
+ },
64
+ {
65
+ "text" : " constructor" ,
66
+ "kind" : " propertyName"
67
+ },
68
+ {
69
+ "text" : " :" ,
70
+ "kind" : " punctuation"
71
+ },
72
+ {
73
+ "text" : " " ,
74
+ "kind" : " space"
75
+ },
76
+ {
77
+ "text" : " Function" ,
78
+ "kind" : " localName"
79
+ }
80
+ ]
81
+ }
82
+ ]
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts" />
2
+ // @target : esnext
3
+
4
+ ////class A {
5
+ //// 'constructor'() { }
6
+ //// }
7
+ ////const a = new A()
8
+ ////console.log(a.constructor/**/)
9
+
10
+ verify . baselineFindAllReferences ( '' ) ;
You can’t perform that action at this time.
0 commit comments