haskell-tools-ast-trf-0.2.0.0: Conversions on Haskell-Tools AST to prepare for refactorings

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.AnnTrf.RangeTemplateToSourceTemplate

Description

This module converts range templates into source templates. Basically it reads the source file and attaches parts of the source file to the AST elements that have the range of the given source code fragment.

Synopsis

Documentation

getLocIndices :: SourceInfoTraversal e => Ann e dom RngTemplateStage -> Map OrdSrcSpan Int Source #

Assigns an index (in the order they are used) for each range

mapLocIndices :: Ord k => StringBuffer -> Map OrdSrcSpan k -> Map k String Source #

Partitions the source file in the order where the parts are used in the AST

applyFragments :: SourceInfoTraversal node => [String] -> Ann node dom RngTemplateStage -> Ann node dom SrcTemplateStage Source #

Replaces the ranges in the AST with the source file parts