CrystalSplitter / ghcitui

A Terminal User Interface for the Glasgow Haskell Compiler Interactive Mode
BSD 3-Clause "New" or "Revised" License
55 stars 1 forks source link

Crashing with ParseError--possibly because of function with an apostraphe in the name? #38

Closed CrystalSplitter closed 7 months ago

CrystalSplitter commented 7 months ago

Description

ghcitui crashes for a given context with a ParseError:

[ERROR]: |updateContext| Failed to update context: ParseError " parsing context: Could not match info line: '[\"--> invoke\\n  Stopped in Ormolu.parseModule', src/Ormolu.hs:(257,51)-(261,35)\\n\"]'"

The context in question from the logs:

[DEBUG]: |updateContext| CMD: :show context
[DEBUG]: |updateContext| OUT:
[DEBUG]: ()
[DEBUG]: [src/Ormolu.hs:(257,51)-(261,35)] #~GHCID-START~#()
[DEBUG]: [src/Ormolu.hs:(257,51)-(261,35)] #~GHCID-START~#--> invoke
[DEBUG]:   Stopped in Ormolu.parseModule', src/Ormolu.hs:(257,51)-(261,35)
[DEBUG]: 
[ERROR]: |updateContext| Failed to update context: ParseError " parsing context: Could not match info line: '[\"--> invoke\\n  Stopped in Ormolu.parseModule', src/Ormolu.hs:(257,51)-(261,35)\\n\"]'"

To Reproduce

Very tricky (I was debugging fourmolu during this) to do a full repro, but it was mostly just stepping through functions as normal.

Expected behaviour

Don't crash. Parse the context correctly.

Screenshots

Not applicable.

Environment

Logs

daemon_log.txt

CrystalSplitter commented 7 months ago

Should be fixed with #39