Skip to content

Commit 5aef7c5

Browse files
Philippe Bidingermeta-codesync[bot]
authored andcommitted
correctly index if/elif/else statements
Summary: the else branch isn't indexed in "if / elif / else" constructs. This fixes it. Note: due the dynamic nature of python and absence of exhaustiveness check, it's difficult to cover all cases. Could be worth trying to being more defensive in the traversal Differential Revision: D87634991 fbshipit-source-id: 7bf42c06a3dfb8c3ca9aed31c14d28b8f4285a16
1 parent a04ce0c commit 5aef7c5

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

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

Lines changed: 36 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": 22,
6+
"size": 23,
77
"symbols": {
88
"1": [
99
{
@@ -593,6 +593,41 @@
593593
}
594594
}
595595
],
596+
"38": [
597+
{
598+
"attributes": {
599+
"symbolKind": {
600+
"aInteger": 3
601+
},
602+
"symbolLanguage": {
603+
"aInteger": 11
604+
},
605+
"symbolName": {
606+
"aString": "g"
607+
},
608+
"symbolParent": {
609+
"aString": "buck_project/my_defs.bzl"
610+
}
611+
},
612+
"range": {
613+
"columnBegin": 16,
614+
"columnEnd": 17,
615+
"lineBegin": 38,
616+
"lineEnd": 38
617+
},
618+
"sym": "test/buck/d/buck_project/my_defs.bzl/g",
619+
"target": {
620+
"filepath": "buck_project/my_defs.bzl",
621+
"range": {
622+
"columnBegin": 1,
623+
"columnEnd": 16,
624+
"lineBegin": 7,
625+
"lineEnd": 8
626+
},
627+
"repository": "test"
628+
}
629+
}
630+
],
596631
"4": [
597632
{
598633
"attributes": {

0 commit comments

Comments
 (0)