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

Syntax error after hlint refactor #1844

Closed
augustss opened this issue May 19, 2021 · 5 comments · Fixed by #1858
Closed

Syntax error after hlint refactor #1844

augustss opened this issue May 19, 2021 · 5 comments · Fixed by #1858
Assignees
Labels
component: hls-hlint-plugin status: blocked Not actionable, because blocked by upstream/GHC etc. type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@augustss
Copy link

augustss commented May 19, 2021

Applying a refactoring from hlint produces a syntactically wrong result.

Your environment

myproject$ haskell-language-server --probe-tools
haskell-language-server version: 1.1.0.0 (GHC: 8.10.4) (PATH: C:\Users\lennart.augustsson\AppData\Roaming\cabal\bin\haskell-language-server.exe)
Tool versions found on the $PATH
cabal:          3.4.0.0
stack:          Not found
ghc:            8.10.4

Which OS do you use:
Windows

Which lsp-client do you use:
emacs

Steps to reproduce

Use this file:

module M where
import GHC.Stack
foo :: (HasCallStack) => Int
foo = undefined

Apply the suggest refactoring to remove redundant parens.

Expected behaviour

The result should be

foo :: HasCallStack => Int

Actual behaviour

The result is

foo :: (HasCallStack => Int
@berberman berberman added component: hls-hlint-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels May 19, 2021
@Ailrun
Copy link
Member

Ailrun commented May 19, 2021

Thank you for the great report! I can reproduce the behaviour with your example.
However, I can also reproduce the issue only with hlint command line, so it's probably an upstream issue.

@jneira
Copy link
Member

jneira commented May 19, 2021

Upstream issue mpickering/apply-refact#112

@jneira
Copy link
Member

jneira commented May 21, 2021

Hi, apply-refact maintainer has fixed the bug and made a new release (0.9.3.0). As we have >=0.9 in the .cabal file, updating the index-state in cabal.project, setting the new version in all stack.yaml's and building from master should fix the issue.

@jneira
Copy link
Member

jneira commented May 24, 2021

The issue should be resolved in master, we will have to wait to the next release to close this defintely

@jneira jneira reopened this May 24, 2021
@jneira
Copy link
Member

jneira commented Jun 22, 2021

The fix is included in hls-1.2.0

@jneira jneira closed this as completed Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: hls-hlint-plugin status: blocked Not actionable, because blocked by upstream/GHC etc. type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants