Opened 8 months ago

Last modified 8 months ago

#16189 new feature request

ParsedSource (especially module name source span) not available from Source Plugin

Reported by: literon Owned by:
Priority: low Milestone: 8.10.1
Component: GHC API Version: 8.6.1
Keywords: Cc: alanz
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

As discovered in https://github.com/google/haskell-indexer/pull/89#discussion_r248081268, the TcGblEnv received by a Source Plugin doesn't seem to have a way of accessing the SrcSpan of the module name.

When having access to the ParsedModule, it contains ParsedSource, which is Located (HsModule GhcPs), whose inner datatype contains Maybe (Located ModuleName), with the location's span pointing to the module name span.

From TcGblEnv one can access the ModSummary, which has a Maybe HsParsedModule, but seems to be Nothing practically.

I know this is a minor nit, but all other declarations are accessible by the source plugin so far, just this bit seems missing. Without this, haskell-indexer has to resort to source-code heuristics to get the module name span.

Change History (1)

comment:1 Changed 8 months ago by bgamari

Cc: alanz added
Milestone: 8.10.1
Note: See TracTickets for help on using tickets.