Skip to content

Commit d44726a

Browse files
Philippe Bidingermeta-codesync[bot]
authored andcommitted
use _index_call everywhere
Summary: We have two different functions to index calls. 1. index_build_rule 2. index_call This diff makes 1 a specialized version of 2. Besides, instead of trying to resolve strings to buck targets or source file paths only in 1, we now do it consistently for any string literal (when indexing expressions). This should generate many more target xrefs. Reviewed By: malanka Differential Revision: D84815018 fbshipit-source-id: 17b698938b3bcc3b6adbcbf892610d268a884347
1 parent a2148c2 commit d44726a

3 files changed

Lines changed: 87 additions & 1 deletion

File tree

glean/glass/test/regression/tests/buck/documentSymbolIndex_my_defs.out

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"referenced_file_digests": {},
55
"revision": "testhash",
6-
"size": 8,
6+
"size": 10,
77
"symbols": {
88
"1": [
99
{
@@ -138,6 +138,72 @@
138138
"lineEnd": 20
139139
},
140140
"sym": "test/buck/d/buck_project/my_defs.bzl/MY_LIST"
141+
},
142+
{
143+
"attributes": {
144+
"symbolKind": {
145+
"aInteger": 4
146+
},
147+
"symbolLanguage": {
148+
"aInteger": 11
149+
},
150+
"symbolName": {
151+
"aString": "toto.c"
152+
},
153+
"symbolParent": {
154+
"aString": "buck_project"
155+
}
156+
},
157+
"range": {
158+
"columnBegin": 35,
159+
"columnEnd": 43,
160+
"lineBegin": 20,
161+
"lineEnd": 20
162+
},
163+
"sym": "test/buck/f/buck_project/toto.c",
164+
"target": {
165+
"filepath": "buck_project/toto.c",
166+
"range": {
167+
"columnBegin": 1,
168+
"columnEnd": 2,
169+
"lineBegin": 1,
170+
"lineEnd": 1
171+
},
172+
"repository": "test"
173+
}
174+
},
175+
{
176+
"attributes": {
177+
"symbolKind": {
178+
"aInteger": 30
179+
},
180+
"symbolLanguage": {
181+
"aInteger": 11
182+
},
183+
"symbolName": {
184+
"aString": "bar"
185+
},
186+
"symbolParent": {
187+
"aString": "b"
188+
}
189+
},
190+
"range": {
191+
"columnBegin": 12,
192+
"columnEnd": 33,
193+
"lineBegin": 20,
194+
"lineEnd": 20
195+
},
196+
"sym": "test/buck/t/buck_project/PATH/b/bar",
197+
"target": {
198+
"filepath": "buck_project/b/TEST_TARGETS",
199+
"range": {
200+
"columnBegin": 1,
201+
"columnEnd": 2,
202+
"lineBegin": 11,
203+
"lineEnd": 13
204+
},
205+
"repository": "test"
206+
}
141207
}
142208
],
143209
"3": [

glean/glass/test/regression/tests/buck/findReferenceRanges_file.out

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
"lineEnd": 31
2121
},
2222
"repository": "test"
23+
},
24+
{
25+
"filepath": "buck_project/my_defs.bzl",
26+
"range": {
27+
"columnBegin": 35,
28+
"columnEnd": 43,
29+
"lineBegin": 20,
30+
"lineEnd": 20
31+
},
32+
"repository": "test"
2333
}
2434
]
2535
]

glean/glass/test/regression/tests/buck/findReferenceRanges_target.out

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@
3030
"lineEnd": 7
3131
},
3232
"repository": "test"
33+
},
34+
{
35+
"filepath": "buck_project/my_defs.bzl",
36+
"range": {
37+
"columnBegin": 12,
38+
"columnEnd": 33,
39+
"lineBegin": 20,
40+
"lineEnd": 20
41+
},
42+
"repository": "test"
3343
}
3444
]
3545
]

0 commit comments

Comments
 (0)