Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Newline character added after all comments when refactoring is applied. #306

Open
@Friede80

Description

Before:
image

After applying the Eta Reduce hint (the fact that the hint is not actually applied is a known issue with apply-refact, but the newline issue manifests when applying any hint)
image

Relevant log output:

2017年08月20日 22:45:42.5956108 [ThreadId 6] - applyHint:ideas=[C:\Users\Friede\AppData\Local\Temp\ghc-mod94877\Main2292916541.hs:6:1: Warning: Eta reduce
Found:
 foo x = head x
Why not:
 foo = head
]
2017年08月20日 22:45:42.5996146 [ThreadId 6] - applyHint:commands=[("C:\\Users\\Friede\\AppData\\Local\\Temp\\ghc-mod94877\\Main2292916541.hs:6:1: Warning: Eta reduce\nFound:\n foo x = head x\nWhy not:\n foo = head\n",[])]
2017年08月20日 22:45:42.7359376 [ThreadId 6] - applyHint:applied="-- My Comment 1\r\nmain :: IO ()\nmain = putStrLn \"Hello World\"\n\n-- My Comment 2\r\nfoo x = head x\n\n-- Another Comment\r\n\nbaz = undefined\n"
2017年08月20日 22:45:42.7399396 [ThreadId 6] - applyHint:diff=WorkspaceEdit {_changes = Just (fromList [(Uri {getUri = "file:///e%3A/Coding/TestProj/app/Main.hs"},List [TextEdit {_range = Range {_start = Position {_line = 0, _character = 0}, _end = Position {_line = 0, _character = 15}}, _newText = "-- My Comment 1\r"},TextEdit {_range = Range {_start = Position {_line = 4, _character = 0}, _end = Position {_line = 4, _character = 15}}, _newText = "-- My Comment 2\r"},TextEdit {_range = Range {_start = Position {_line = 7, _character = 0}, _end = Position {_line = 7, _character = 18}}, _newText = "-- Another Comment\r"}])]), _documentChanges = Nothing}

I am on Windows 10. I suspect some issue with Windows line endings, because of the appearance of \r in the diff. But the file is using Unix line endings.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /