Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.

Fix browse parsing #45

Merged
merged 2 commits into from
Mar 2, 2015
Merged

Fix browse parsing #45

merged 2 commits into from
Mar 2, 2015

Conversation

LukaHorvat
Copy link
Contributor

I was getting the "got something strange.." warning on every line of output from ghc-mod browse when the output was perfectly fine. This fixes it.

@lierdakil lierdakil added the bug label Mar 2, 2015
@lierdakil lierdakil self-assigned this Mar 2, 2015
@lierdakil
Copy link
Contributor

First, thank you for your contribution, it's appreciated.
Second, could you tell what OS you're experiencing said behavior on?

Just by looking at the code, line should never contain a newline character (since it's split by newline at line 32), so m (multiline) flag should not be required. I'd prefer to solve underlying issue than to rely on this unintuitive fix, if possible. If I had to guess, this issue stems from trailing carriage return characters (which could be present on Windows), or some unexpected newline separator (e.g., on MacOS 9). Would you be kind enough to check that it is indeed the case?
If I'm right, you might try to replace line 32 with

  line.split(/\r?\n/|\r/).filter((l)->0 != l.length).map onMessage

and see if it helps, without adding multiline flag to regexp.

@lierdakil lierdakil added this to the 0.3.5 milestone Mar 2, 2015
@LukaHorvat
Copy link
Contributor Author

Yeah, the new lines at the end threw it off. Your fix solves the problem.
I'm not sure how to modify the pull request, but it would probably be simpler if you just applied the fix yourself.

Just watch out because you have an extra '/' before the '|' in the regex.

Oh, and yeah. I'm on Windows.

@lierdakil
Copy link
Contributor

You can just push to branch you requested to pull (master in this case). New commits will be added to pull request.

@LukaHorvat
Copy link
Contributor Author

Wow. Surprisingly simple.
Ok, this should work now.

lierdakil added a commit that referenced this pull request Mar 2, 2015
Fix handling of various newlines in util-ghc-mod
@lierdakil lierdakil merged commit 2285f02 into atom-haskell:master Mar 2, 2015
@lierdakil
Copy link
Contributor

Merged and published. Thanks!

@LukaHorvat
Copy link
Contributor Author

No problem. Happy to help.
I might be interested in contributing further. Is there anything in particular you'd like someone else to do?

@lierdakil
Copy link
Contributor

Ah. You see, I'm just here to fix bugs and accept pull requests while repo owner is MIA, so I'm not really one to ask this question. It might be a few months before @chaika2013 is back in business. Until then, not much is going on with this project, except occasional bug-squatting.

Of course, you are free to look through TODO and issue list and work on anything you feel like. If you do, I'd advise you to create separate branch for each issue and create pull requests early for non-trivial tasks, like here, for example: jgm/pandoc#1968.

There is also gitter chat room if you want to discuss something beforehand.

So, to answer your question directly, no, nothing in particular.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants