Skip to content

Cannot apply hlint hints when a trailing comment is on the same line. #2290

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

Closed
shapr opened this issue Oct 21, 2021 · 2 comments
Closed

Cannot apply hlint hints when a trailing comment is on the same line. #2290

shapr opened this issue Oct 21, 2021 · 2 comments
Labels
component: hls-hlint-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@shapr
Copy link
Contributor

shapr commented Oct 21, 2021

Your environment

haskell-language-server 1.4
Which OS do you use: NixOS
Which lsp-client do you use: haskell-lsp in emacs
Describe your project (alternative: link to the project): https://github.com/shapr/hlsexamples/blob/main/src/Examples.hs#L14

Steps to reproduce

Insert the line biggest items = foldr1 max items -- the line above will show two hlint hints, "eta reduce" and "use maximum" into a file, and attempt to apply any of the hlint hints.
If you move the comment to a different line, the hlint hints apply with no problems.

Expected behaviour

The hints should be applied.

Actual behaviour

The hints are not applied.

@jneira jneira added component: hls-hlint-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. status: regression test needed labels Oct 21, 2021
@jneira
Copy link
Member

jneira commented Nov 4, 2021

Hi, thanks for reporting the issue i've just tried to reproduce and i was not able to do it with several ghc versions (9.0.1, 8.10.7, 8.8.4). I am gonna add a test anyways to check it in ci

@jneira
Copy link
Member

jneira commented Nov 8, 2021

@shapr I ve added a repro test here: https://github.com/haskell/haskell-language-server/blob/9818ab2d5271c6b534d36b0a5968b2f85c4d611c/plugins/hls-hlint-plugin/test/testdata/TwoHintsAndComment.hs

and it was succesfull for all CI configurations, let me know how could be changed to reproduce it

mergify bot pushed a commit that referenced this issue Nov 10, 2021
…#2321)

* Rename test data files

* Add regression tests

* Add regression test for #1279

* Use timeout

* Correct waitForProgressDone in ghcide

* Remove unnecessary waitForDiagnostics

* Mark test broken for hlint on ghclib

* Add test over unused extensions

* Add test for #2042

* Add data for #2280

* Use waitForAllProgressDone

* Add test for #2280

* correct module name

* Add reproduction for #2290

* Correct test case

* Comment about knownBrokenForHlint*

* Correction
@jneira jneira closed this as completed Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: hls-hlint-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

2 participants