[GHC] #16189: ParsedSource (especially module name source span) not available from Source Plugin

#16189: ParsedSource (especially module name source span) not available from Source Plugin -------------------------------------+------------------------------------- Reporter: literon | Owner: (none) Type: feature | Status: new request | Priority: low | Milestone: Component: GHC API | Version: 8.6.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- 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. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16189 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16189: ParsedSource (especially module name source span) not available from Source Plugin -------------------------------------+------------------------------------- Reporter: literon | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: 8.10.1 Component: GHC API | Version: 8.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * cc: alanz (added) * milestone: => 8.10.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16189#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC