Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
254 changes: 174 additions & 80 deletions glean/lang/haskell/HieIndexer/Index.hs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions glean/lang/haskell/tests/code/A.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ data R a = R { f1 :: Char, f2 :: [a] }

class Eq a => C a where
m :: a -> Bool
m _ = True

instance C Int where
m x = x == x
Expand Down
19 changes: 19 additions & 0 deletions glean/lang/haskell/tests/code/hsClassDecl.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
"@generated",
{
"key": {
"defaults": [
{
"key": {
"loc": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"span": { "length": 10, "start": 535 }
},
"name": {
"key": {
"mod": {
"key": { "name": { "key": "A" }, "unit": { "key": "main" } }
},
"occ": { "key": { "name": "m", "namespace_": 0 } },
"sort": { "external": { } }
}
}
}
}
],
"methods": [
{
"key": {
Expand Down
41 changes: 28 additions & 13 deletions glean/lang/haskell/tests/code/hsDeclarationLocation.out
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"sort": { "external": { } }
}
},
"span": { "length": 40, "start": 492 }
"span": { "length": 53, "start": 492 }
}
},
{
Expand Down Expand Up @@ -189,10 +189,10 @@
"key": { "name": { "key": "A" }, "unit": { "key": "main" } }
},
"occ": { "key": { "name": "a", "namespace_": 2 } },
"sort": { "internal": { "length": 15, "start": 591 } }
"sort": { "internal": { "length": 15, "start": 604 } }
}
},
"span": { "length": 15, "start": 591 }
"span": { "length": 15, "start": 604 }
}
},
{
Expand All @@ -207,7 +207,7 @@
"sort": { "external": { } }
}
},
"span": { "length": 68, "start": 607 }
"span": { "length": 68, "start": 620 }
}
},
{
Expand Down Expand Up @@ -264,10 +264,25 @@
"key": { "name": { "key": "A" }, "unit": { "key": "main" } }
},
"occ": { "key": { "name": "m", "namespace_": 0 } },
"sort": { "internal": { "length": 12, "start": 557 } }
"sort": { "internal": { "length": 10, "start": 535 } }
}
},
"span": { "length": 12, "start": 557 }
"span": { "length": 10, "start": 535 }
}
},
{
"key": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"name": {
"key": {
"mod": {
"key": { "name": { "key": "A" }, "unit": { "key": "main" } }
},
"occ": { "key": { "name": "m", "namespace_": 0 } },
"sort": { "internal": { "length": 12, "start": 570 } }
}
},
"span": { "length": 12, "start": 570 }
}
},
{
Expand All @@ -279,10 +294,10 @@
"key": { "name": { "key": "A" }, "unit": { "key": "main" } }
},
"occ": { "key": { "name": "r", "namespace_": 0 } },
"sort": { "internal": { "length": 1, "start": 630 } }
"sort": { "internal": { "length": 1, "start": 643 } }
}
},
"span": { "length": 1, "start": 630 }
"span": { "length": 1, "start": 643 }
}
},
{
Expand All @@ -294,10 +309,10 @@
"key": { "name": { "key": "A" }, "unit": { "key": "main" } }
},
"occ": { "key": { "name": "x", "namespace_": 0 } },
"sort": { "internal": { "length": 1, "start": 559 } }
"sort": { "internal": { "length": 1, "start": 572 } }
}
},
"span": { "length": 1, "start": 559 }
"span": { "length": 1, "start": 572 }
}
},
{
Expand All @@ -309,10 +324,10 @@
"key": { "name": { "key": "A" }, "unit": { "key": "main" } }
},
"occ": { "key": { "name": "x", "namespace_": 0 } },
"sort": { "internal": { "length": 1, "start": 617 } }
"sort": { "internal": { "length": 1, "start": 630 } }
}
},
"span": { "length": 1, "start": 617 }
"span": { "length": 1, "start": 630 }
}
},
{
Expand All @@ -327,7 +342,7 @@
"sort": { "external": { } }
}
},
"span": { "length": 8, "start": 581 }
"span": { "length": 8, "start": 594 }
}
},
{
Expand Down
77 changes: 49 additions & 28 deletions glean/lang/haskell/tests/code/hsFileXRefs.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 0, "span": { "length": 3, "start": 364 } },
{ "kind": 2, "span": { "length": 3, "start": 651 } }
{ "kind": 2, "span": { "length": 3, "start": 664 } }
],
"target": {
"name": {
Expand Down Expand Up @@ -83,7 +83,7 @@
"refs": [
{ "kind": 1, "span": { "length": 1, "start": 279 } },
{ "kind": 2, "span": { "length": 1, "start": 442 } },
{ "kind": 2, "span": { "length": 1, "start": 579 } }
{ "kind": 2, "span": { "length": 1, "start": 592 } }
],
"target": {
"name": {
Expand All @@ -103,7 +103,7 @@
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 1, "span": { "length": 1, "start": 285 } },
{ "kind": 2, "span": { "length": 1, "start": 603 } }
{ "kind": 2, "span": { "length": 1, "start": 616 } }
],
"target": {
"name": {
Expand All @@ -123,7 +123,7 @@
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 1, "span": { "length": 1, "start": 295 } },
{ "kind": 2, "span": { "length": 1, "start": 596 } }
{ "kind": 2, "span": { "length": 1, "start": 609 } }
],
"target": {
"name": {
Expand All @@ -143,7 +143,7 @@
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 1, "span": { "length": 1, "start": 305 } },
{ "kind": 2, "span": { "length": 1, "start": 543 } }
{ "kind": 2, "span": { "length": 1, "start": 556 } }
],
"target": {
"name": {
Expand All @@ -163,7 +163,7 @@
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 1, "span": { "length": 1, "start": 324 } },
{ "kind": 3, "span": { "length": 1, "start": 591 } }
{ "kind": 3, "span": { "length": 1, "start": 604 } }
],
"target": {
"name": {
Expand All @@ -183,7 +183,7 @@
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 1, "span": { "length": 4, "start": 315 } },
{ "kind": 3, "span": { "length": 4, "start": 571 } }
{ "kind": 3, "span": { "length": 4, "start": 584 } }
],
"target": {
"name": {
Expand Down Expand Up @@ -256,8 +256,9 @@
"key": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 2, "span": { "length": 1, "start": 557 } },
{ "kind": 2, "span": { "length": 1, "start": 634 } }
{ "kind": 2, "span": { "length": 1, "start": 535 } },
{ "kind": 2, "span": { "length": 1, "start": 570 } },
{ "kind": 2, "span": { "length": 1, "start": 647 } }
],
"target": {
"name": {
Expand All @@ -276,8 +277,8 @@
"key": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 2, "span": { "length": 1, "start": 563 } },
{ "kind": 2, "span": { "length": 1, "start": 568 } }
{ "kind": 2, "span": { "length": 1, "start": 576 } },
{ "kind": 2, "span": { "length": 1, "start": 581 } }
],
"target": {
"name": {
Expand All @@ -286,7 +287,7 @@
"key": { "name": { "key": "A" }, "unit": { "key": "main" } }
},
"occ": { "key": { "name": "x", "namespace_": 0 } },
"sort": { "internal": { "length": 1, "start": 559 } }
"sort": { "internal": { "length": 1, "start": 572 } }
}
}
}
Expand All @@ -296,8 +297,8 @@
"key": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 2, "span": { "length": 1, "start": 598 } },
{ "kind": 2, "span": { "length": 1, "start": 605 } }
{ "kind": 2, "span": { "length": 1, "start": 611 } },
{ "kind": 2, "span": { "length": 1, "start": 618 } }
],
"target": {
"name": {
Expand All @@ -306,7 +307,7 @@
"key": { "name": { "key": "A" }, "unit": { "key": "main" } }
},
"occ": { "key": { "name": "a", "namespace_": 2 } },
"sort": { "internal": { "length": 15, "start": 591 } }
"sort": { "internal": { "length": 15, "start": 604 } }
}
}
}
Expand All @@ -316,7 +317,7 @@
"key": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 2, "span": { "length": 1, "start": 609 } },
{ "kind": 2, "span": { "length": 1, "start": 622 } },
{ "kind": 2, "span": { "length": 2, "start": 467 } },
{ "kind": 2, "span": { "length": 2, "start": 479 } }
],
Expand All @@ -336,15 +337,15 @@
{
"key": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [ { "kind": 2, "span": { "length": 1, "start": 626 } } ],
"refs": [ { "kind": 2, "span": { "length": 1, "start": 639 } } ],
"target": {
"name": {
"key": {
"mod": {
"key": { "name": { "key": "A" }, "unit": { "key": "main" } }
},
"occ": { "key": { "name": "x", "namespace_": 0 } },
"sort": { "internal": { "length": 1, "start": 617 } }
"sort": { "internal": { "length": 1, "start": 630 } }
}
}
}
Expand All @@ -353,15 +354,15 @@
{
"key": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [ { "kind": 2, "span": { "length": 1, "start": 659 } } ],
"refs": [ { "kind": 2, "span": { "length": 1, "start": 672 } } ],
"target": {
"name": {
"key": {
"mod": {
"key": { "name": { "key": "A" }, "unit": { "key": "main" } }
},
"occ": { "key": { "name": "r", "namespace_": 0 } },
"sort": { "internal": { "length": 1, "start": 630 } }
"sort": { "internal": { "length": 1, "start": 643 } }
}
}
}
Expand All @@ -372,8 +373,8 @@
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 2, "span": { "length": 2, "start": 467 } },
{ "kind": 2, "span": { "length": 2, "start": 656 } },
{ "kind": 2, "span": { "length": 2, "start": 663 } }
{ "kind": 2, "span": { "length": 2, "start": 669 } },
{ "kind": 2, "span": { "length": 2, "start": 676 } }
],
"target": {
"name": {
Expand All @@ -393,7 +394,7 @@
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 2, "span": { "length": 2, "start": 479 } },
{ "kind": 2, "span": { "length": 2, "start": 611 } }
{ "kind": 2, "span": { "length": 2, "start": 624 } }
],
"target": {
"name": {
Expand Down Expand Up @@ -431,7 +432,7 @@
{
"key": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [ { "kind": 2, "span": { "length": 2, "start": 565 } } ],
"refs": [ { "kind": 2, "span": { "length": 2, "start": 578 } } ],
"target": {
"name": {
"key": {
Expand All @@ -451,7 +452,7 @@
{
"key": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [ { "kind": 2, "span": { "length": 2, "start": 623 } } ],
"refs": [ { "kind": 2, "span": { "length": 2, "start": 636 } } ],
"target": {
"name": {
"key": {
Expand All @@ -468,7 +469,7 @@
{
"key": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [ { "kind": 2, "span": { "length": 2, "start": 647 } } ],
"refs": [ { "kind": 2, "span": { "length": 2, "start": 660 } } ],
"target": {
"name": {
"key": {
Expand Down Expand Up @@ -507,8 +508,8 @@
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [
{ "kind": 2, "span": { "length": 3, "start": 412 } },
{ "kind": 2, "span": { "length": 3, "start": 545 } },
{ "kind": 2, "span": { "length": 3, "start": 640 } }
{ "kind": 2, "span": { "length": 3, "start": 558 } },
{ "kind": 2, "span": { "length": 3, "start": 653 } }
],
"target": {
"name": {
Expand Down Expand Up @@ -566,6 +567,26 @@
}
}
},
{
"key": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
"refs": [ { "kind": 2, "span": { "length": 4, "start": 541 } } ],
"target": {
"name": {
"key": {
"mod": {
"key": {
"name": { "key": "GHC.Types" },
"unit": { "key": "ghc-prim" }
}
},
"occ": { "key": { "name": "True", "namespace_": 1 } },
"sort": { "external": { } }
}
}
}
}
},
{
"key": {
"file": { "key": "glean/lang/haskell/tests/code/A.hs" },
Expand Down
Loading
Loading