Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser error on the -- $ chain of characters #148

Closed
sir4ur0n opened this issue Jun 4, 2020 · 5 comments
Closed

Parser error on the -- $ chain of characters #148

sir4ur0n opened this issue Jun 4, 2020 · 5 comments
Labels
component: ghcide status: blocked Not actionable, because blocked by upstream/GHC etc.

Comments

@sir4ur0n
Copy link
Collaborator

sir4ur0n commented Jun 4, 2020

While trying to fix the hie.yaml for #121 I noticed 2 tests have a parsing error.

The guilty seems to be the -- $ chain of characters in an implementation of function

Minimal example:

foo :: ()
foo =
  let bar = ()
  -- some comment
  -- $ some other comment
   in bar

The line -- $ some other comment has an error:

/home/sir4ur0n/code/haskell-language-server/src/Ide/Plugin/Ormolu.hs:42:3: error:
    parse error on input ‘-- $ some other comment’parser

image

@googleson78
Copy link
Contributor

@sir4ur0n
Copy link
Collaborator Author

sir4ur0n commented Jun 5, 2020

Indeed, this is the same root cause. E.g. running stack haddock on such code results in an error:

Running Haddock on library for foobar-0.1.0.0..

src/Lib.hs:9:3: error: parse error on input ‘-- $’
  |
9 |   -- $
  |   ^^^^
Haddock coverage:

I am not familiar with how HLS is managed: should we keep this issue open? Or close it as it is "only" an underlying issue?

@fendor
Copy link
Collaborator

fendor commented Jun 6, 2020

Keep it open, so that others see that the issue is known and even being worked on.

@sir4ur0n
Copy link
Collaborator Author

sir4ur0n commented Jun 9, 2020

As explained in https://github.com/digital-asset/ghcide/issues/573#event-3423705019 the root cause is Haddock failing + Ghcide considering (in the past) Haddock parsing errors as errors (now downgraded to warnings + "Haddock" is now visible in the error message.

I guess this issue can be closed as soon as HLS refers to a version of GHCIDE with this commit

@jneira jneira added component: ghcide status: blocked Not actionable, because blocked by upstream/GHC etc. and removed upstream: ghcide labels Jun 12, 2020
@sir4ur0n
Copy link
Collaborator Author

I just tested with HLS 0.3 and the issue seems to be fixed, I propose we close this. Thank you everyone!

pepeiborra pushed a commit that referenced this issue Dec 27, 2020
* Use a separate finder cache for each typecheck call

On a large DAML project, we occasionally saw error about missing
modules during typechecking during concurrent compilations. This was
caused by the fact that we modified the IORef in the HscEnv which is
shared between concurrent compilations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide status: blocked Not actionable, because blocked by upstream/GHC etc.
Projects
None yet
Development

No branches or pull requests

4 participants