haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Should we ignore `-Werror` in HLS?

Open pepeiborra opened this issue 5 years ago • 7 comments

Currently -Werror breaks type checking in the presence of warnings. That is, hover and other LSP features stop working or use stale data.

pepeiborra avatar Aug 21 '20 09:08 pepeiborra

I think simply discarding -Werror is probably the best approach. People use Werror to really say "fail if there are any warnings", and that's something we definitely don't want to do in an IDE, so best ignore it and keep going.

The other option would be to remove it then retroactively upgrade the warnings to errors, which means people see the same thing on the command line as in the IDE. I'd be OK with that too.

ndmitchell avatar Aug 21 '20 11:08 ndmitchell

I'm still experiencing this issue in the repo https://github.com/input-output-hk/cardano-node, for example when working with the cardano-api package.

NB: In this repo, -Werror is specified in the cabal.project file for cardano-api: https://github.com/input-output-hk/cardano-node/blob/master/cabal.project#L17.

runeksvendsen avatar Jul 07 '21 07:07 runeksvendsen

Ok, thanks for noting it, reopening issue

jneira avatar Jul 07 '21 08:07 jneira

@runeksvendsen i had a report today in discord asking to display warnings as errors in the ide, so it seems it works, have you the chance to try again with a recent hls version?

jneira avatar Oct 13 '21 09:10 jneira

I just noticed that Werror is currently ignored (I thought it was a bug at first), including only turning specific warnings into errors. Especially in these cases, this is annoying imo.

The other option would be to remove it then retroactively upgrade the warnings to errors, which means people see the same thing on the command line as in the IDE. I'd be OK with that too.

I think this would be the better option, since it reflects what the compiler outputs and actually shows errors as errors.

konsumlamm avatar Oct 13 '21 09:10 konsumlamm

We are ignoring -WError but it seems is not the ideal behaviour, changing title to relfect it

jneira avatar Jan 31 '22 10:01 jneira

Is there any update on this? I have -Werror=incomplete-patterns -Werror=incomplete-uni-patterns set in my cabal file and I would want that to be reflected in my IDE. I don't see why we wouldn't pass it to HLS. The IDE should show me when there will be a compilation error.

mcdearman avatar Jul 30 '24 03:07 mcdearman