-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support crossreference for imported modules and entities #6
Comments
Info: GHC AST stores these as ImportDecl available from the RenamedSource. Also, the implicit prelude import happens from a funny location. If the import is implicit, we shouldn't attach a Span to it in the translate layer rather (and then the reference will have an implicit anchor in Kythe). |
Module names are referenced now, thanks to Ivan. To be done: to keep it simple, |
Actually, both the module name and the import statements seem to ref the module entry, but noone is defines/binding it. So Kythe navigation to definition doesn't work. |
Actually now the module name just |
This fixes google#6.
* Support xrefs for imported entities. This fixes #6. * fix older GHC versions * delete unused imports * fix for ghc 8.0.x * address review comments * flag for generating xrefs for hidden imports * verification tests. Also fix existing errors.
* Support xrefs for type/data constructors and data fields. Fixes #6. * catMaybes . map --> mapMaybe
As final result, the named entries in the import list should be properly hyperlinked.
The module names, like
Foo
inimport Foo (bar, baz)
, shouldref/imports
the module node (see #8 ). Also,bar
andbaz
shouldref/imports
too.Dotted imports
import Foo (Bar(..))
- should we emit multiple ref/imports edges from the..
s? Or just do nothing there.Aliased imports
What about aliased imports (regardless of qualification)? For example:
Easiest is we do nothing. In any case,
T.append
will still refer to the same node. If we emitted a defines/binding onT
of the import line, then theT
ofT.append
might ref that. But there's no really suitable node in the kythe schema (unless we shoehorntalias
+aliases
), and the benefit is dubious. Also, the def/binding would need to come from an implicit anchor, since multiple modules can be aliased to the same name (so theT
in the import line would also be a reference).The text was updated successfully, but these errors were encountered: