Fixits don't render properly #2

Open
thoughtpolice opened this Issue Nov 1, 2011 · 1 comment

Projects

None yet

2 participants

@thoughtpolice
Collaborator

Consider the following snippet:

{-# LANGUAGE OverloadedStrings #-}
module Main where
import Text.Trifecta
import Data.ByteString.Char8()

main :: IO ()
main = parseTest p "hello"
  where p = do
          string "h"
          (_ :~ s) <- spanned $ string "ello"
          warnAt [] "Fix this" $ render $ Fixit s "should be OMFGLOLOL"

When run it gives this output:

$ runghc trifecta.hs
(interactive):1:2: warning: Fix this
hello<EOF> 
 ~~~~      
 should be>
()

You would normally expect the fixit string to be as long as necessary.

@ekmett
Owner

I'm still open to improving this. It just needs the rendering logic to be smart enough to take into account those longer lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment