Skip to content

[Regression] 0.12.2.0 crashes on files 0.10.0.0 accepts without formatting #355

@stephen-smith

Description

@stephen-smith

Same configuration file for all scenarios: https://gitlab.com/krakrjak/restman/-/blob/ba4d3db0262098897690e13c9fe06f0ee1e97c3b/.stylish-haskell.yaml

All files are parsed and not reformated by 0.10.0.0:

% ~/.local/bin/stylish-haskell --version
stylish-haskell 0.10.0.0

All crashes are with 0.12.2.0:

% /usr/bin/stylish-haskell --version
stylish-haskell 0.12.2.0

These might be separable issues, but I'm going to start with one issue, and it can be split if necessary. (Or just close it if regressions aren't worth fixing)

File: https://gitlab.com/krakrjak/restman/-/blob/ba4d3db0262098897690e13c9fe06f0ee1e97c3b/app/Main.hs

Crash:

app/Main.hs
stylish-haskell: Language.Haskell.Stylish.Editor.applyChanges: refusing to make overlapping changes on lines 55-55, 67-67, 69-69, 73-73, 89-89, 92-92, 96-96, 110-110, 112-112, 117-117, 125-125, 126-126, 127-127, 128-128, 132-132, 139-139, 146-146, 151-151, 151-151, 155-155, 159-159, 160-160, 162-162, 164-164, 174-174
CallStack (from HasCallStack):
  error, called at lib/Language/Haskell/Stylish/Editor.hs:47:28 in stylish-haskell-0.12.2.0-KmeGuaX895SEQ72ycc5jR1:Language.Haskell.Stylish.Editor

Overlap is on line 151: optMethod embed opts = fmap (\m -> opts{ method = m}) . embed $ method opts

I'm guessing it wants to add spaces in two different locations on the same line?


File: https://gitlab.com/krakrjak/restman/-/blob/ba4d3db0262098897690e13c9fe06f0ee1e97c3b/src/Lib.hs

Crash:

src/Lib.hs
stylish-haskell: Language.Haskell.Stylish.Editor.applyChanges: refusing to make overlapping changes on lines 143-143, 168-168, 180-180, 189-189, 190-190, 191-191, 192-192, 206-206, 212-212, 213-213, 215-215, 216-216, 217-217, 227-227, 231-231, 241-241, 242-242, 243-243, 244-244, 245-245, 246-246, 247-247, 248-248, 255-255, 256-256, 261-261, 261-261, 265-265, 265-265, 269-269, 271-271, 271-271, 275-275, 275-275, 279-279, 279-279, 283-283, 283-283, 288-288, 288-288, 292-292, 299-299, 304-304, 308-308, 319-319, 333-333, 334-334, 335-335, 336-336, 337-337, 338-338, 340-340, 341-341, 342-342, 346-346, 349-349, 350-350, 353-353, 354-354, 358-358, 360-360, 361-361, 365-365, 369-369, 384-384, 385-385, 389-389, 390-390, 391-391, 392-392, 399-399, 401-401, 402-402, 413-413, 414-414, 418-418, 422-422, 427-427, 428-428, 430-430, 437-437, 438-438, 439-439, 440-440, 442-442, 443-443, 445-445, 445-445, 446-446, 452-452, 455-455, 456-456, 466-466, 469-469, 470-470, 471-471, 481-481, 487-487, 488-488, 489-489, 490-490, 492-492, 493-493, 493-493, 494-494, 500-500, 504-504, 510-510, 532-532, 536-536, 543-543, 553-553, 554-554
CallStack (from HasCallStack):
  error, called at lib/Language/Haskell/Stylish/Editor.hs:47:28 in stylish-haskell-0.12.2.0-KmeGuaX895SEQ72ycc5jR1:Language.Haskell.Stylish.Editor

Overlapping lines:

261: focusL embed s = (\newFocus -> s{focus = newFocus}) <$> embed (focus s)
265: methodEditorL embed s = (\newMethodEditor -> s{methodEditor = newMethodEditor}) <$> embed (methodEditor s)
271: methodInEditorContentsL embed tz = (\newMethod -> stringZipper [newMethod] (Just 1)) <$> embed (concat $ getText tz)
275: overlayStateL embed s = (\newOverlay -> s{overlayState = newOverlay}) <$> embed (overlayState s)
279: methodEditorExtentL embed os = (\newExtent -> os{methodEditorExtent = newExtent}) <$> embed (methodEditorExtent os)
283: methodListL embed os = (\newList -> os{methodList = newList}) <$> embed (methodList os)
288: urlEditorL embed s = (\newUrlEditor -> s{urlEditor = newUrlEditor}) <$> embed (urlEditor s)
445: editorLsByName = map (\l -> (getName (s ^# l), l)) [urlEditorL, methodEditorL]

Looks like it might be having a problem anytime a lambda is an argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions