diff --git a/glean/lang/codemarkup/tests/hack/cases/xrefs/xrefs_to_methods_by_file.out b/glean/lang/codemarkup/tests/hack/cases/xrefs/xrefs_to_methods_by_file.out new file mode 100644 index 000000000..6629e8f1b --- /dev/null +++ b/glean/lang/codemarkup/tests/hack/cases/xrefs/xrefs_to_methods_by_file.out @@ -0,0 +1,119 @@ +[ + "@generated", + { + "key": { + "file": { "key": "www/RefClass.php" }, + "xref": { + "target": { + "name": "bazza", + "file": { "key": "www/RefClass.php" }, + "location": { "span": { "start": 475, "length": 5 } } + }, + "source": { "span": { "start": 888, "length": 5 } } + }, + "entity": { + "decl": { + "method": { + "key": { + "name": { "key": "bazza" }, + "container": { + "class_": { + "key": { + "name": { "key": { "name": { "key": "RefClass" } } } + } + } + } + } + } + } + } + } + }, + { + "key": { + "file": { "key": "www/RefClass.php" }, + "xref": { + "target": { + "name": "foo", + "file": { "key": "www/RefClass.php" }, + "location": { "span": { "start": 411, "length": 3 } } + }, + "source": { "span": { "start": 846, "length": 3 } } + }, + "entity": { + "decl": { + "method": { + "key": { + "name": { "key": "foo" }, + "container": { + "class_": { + "key": { + "name": { "key": { "name": { "key": "RefClass" } } } + } + } + } + } + } + } + } + } + }, + { + "key": { + "file": { "key": "www/RefClass.php" }, + "xref": { + "target": { + "name": "quux", + "file": { "key": "www/SourceTrait.php" }, + "location": { "span": { "start": 264, "length": 4 } } + }, + "source": { "span": { "start": 804, "length": 4 } } + }, + "entity": { + "decl": { + "method": { + "key": { + "name": { "key": "quux" }, + "container": { + "trait": { + "key": { + "name": { "key": { "name": { "key": "SourceTrait" } } } + } + } + } + } + } + } + } + } + }, + { + "key": { + "file": { "key": "www/RefClass.php" }, + "xref": { + "target": { + "name": "superAdd", + "file": { "key": "www/SuperClass.php" }, + "location": { "span": { "start": 288, "length": 8 } } + }, + "source": { "span": { "start": 911, "length": 8 } } + }, + "entity": { + "decl": { + "method": { + "key": { + "name": { "key": "superAdd" }, + "container": { + "class_": { + "key": { + "name": { "key": { "name": { "key": "SuperClass" } } } + } + } + } + } + } + } + } + } + } +] \ No newline at end of file diff --git a/glean/lang/codemarkup/tests/hack/cases/xrefs/xrefs_to_methods_by_file.perf b/glean/lang/codemarkup/tests/hack/cases/xrefs/xrefs_to_methods_by_file.perf new file mode 100644 index 000000000..480907f20 --- /dev/null +++ b/glean/lang/codemarkup/tests/hack/cases/xrefs/xrefs_to_methods_by_file.perf @@ -0,0 +1,6 @@ +{ + "@generated": null, + "hack.DeclarationLocation.6": 8, + "hack.FileXRefs.6": 5, + "src.File.1": 1 +} \ No newline at end of file diff --git a/glean/lang/codemarkup/tests/hack/cases/xrefs/xrefs_to_methods_by_file.query b/glean/lang/codemarkup/tests/hack/cases/xrefs/xrefs_to_methods_by_file.query new file mode 100644 index 000000000..455bacaad --- /dev/null +++ b/glean/lang/codemarkup/tests/hack/cases/xrefs/xrefs_to_methods_by_file.query @@ -0,0 +1,9 @@ +query: + X0 where + X1 = codemarkup.hack.HackFileEntityXRefLocations.2 + {file="www/RefClass.php"}; + codemarkup.hack.HackFileEntityXRefLocations.2 + {entity={decl={method=hack.MethodDeclaration.6 {}}}}=X1; + X0=X1 +perf: true +transform: [gensort, []]