-
-
Notifications
You must be signed in to change notification settings - Fork 389
Read hlint config + show stan errors #3127
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
Comments
Thank you for the bug report! Moved the issue to the main repo, since, afaict, this is a question for the lsp-server! |
Thanks, let me know if you need more info (GHC version, etc.) |
Yes, we do need all that information. HLS-Stan-plugin is only supported in some GHC versions. Please fill in the issue template. Thank you. |
I looked at your As I said earlier, I'm not sure I understand what features are actually implemented... Here are a few data points though.
vscode only display limited hlint suggestions here (my config file is not read) Running hlint via the command line gives me more suggestions: Here's a link to my configured repo if it can help: https://github.com/benjamin-thomas/haskell-playground Thanks :) |
Why are you using the Enhancement request issue template? This is a bug report, please follow the bug report issue template.
I loaded your configured repo and |
As I told you, I wasn't sure this was a bug since I don't know what to expect, what's supposed to work out of the box or not. Here's the remaining data you require: Which LSP client (editor/plugin) do you use?The one provided by the vscode extension How is your project built (alternative: link to the project)?With cabal Have you configured HLS in any way (especially: a hie.yaml file)?No
This Here's my log. I stopped vscode, restarted it, waited for hlint to give me (minimal) hints, then copied the log from vscode's output pane:
Nothing jumps at me :s |
The list of plugins shows that No idea with the |
Ok. I've cleared the cache at Here's a debug log as documented per: https://github.com/haskell/vscode-haskell#investigating-and-reporting-problems I don't see anything obvious here either.
|
Stan plugin only works with the latest HLS release (1.8) and specific GHC versions (e.g. 8.10.x). Hlint on the other hand should work and pick up the configuration. Have been using this in multiple projects for a long time. If you want to, you can setup an small example repository (or fork one) to demonstrate an hlint configuration file that is not working the way you'd expect it to work, and I can try to reproduce on my end. |
Thanks @andys8 that's very kind. And sorry for the late feedback. Do you think this repo is too complicated as an example ? https://github.com/benjamin-thomas/haskell-playground. If so, I can provide a super simple repo instead if you think that'd be useful. @pepeiborra already confirmed that he does see the hlint suggestions popping into his vscode with my project so it must be something wrong with my setup, but I have no clue as to what could be broken. Maybe logging and being able to confirm, as a user, the success or failure to read the hlint config could be useful? My vscode auto-upgraded hls and I can now see a stan suggestion if I move my cursor where the arrow is pointing here. It's very subtle though, I would think showing a warning by default would be better. Still no hlint suggestions though :( |
The current state ( app/Main.hs:3:34: error:
Module ‘ExplorePrelude’ does not export ‘someFunc’
|
3 | import qualified ExplorePrelude (someFunc)
|
Files that failed:
* /home/andreas/dev/repository/haskell-playground/app/Main.hs
Completed (9 files worked, 1 file failed) Reason is the function doesn't exist (anymore). HlintRunning But does not show up in HLS At the same time redundant brackets do show up But if I create the default configuration and use it (with Let's say I'd use a dupliate import, it'll show up on command line and with HLS: QuasiQuotesThe parse error of hlint seems to be related to the use of QuasiQuotes. On command line one seems to need to pass an argument (probably can also be configured):
There was a (potentially unsolved) issue years ago where haskell/haskell-ide-engine#1790 Summary
If you still see the issue, could you bring the project into a state (maybe on a different branch or send me the commit id) where there is an issue that you see on command line but not with haskell language server (hlint version, ghc version, hlint config, and line number would be good information)? Then I'll have a second look to double check if I can reproduce the issue. With the current state. |
No response for a while, so closing as stale. |
In case it helps anyone coming here due to experiencing that a
|
Hello!
I'm learning Haskell and so far the tooling really helps with its code insight features, great job ;)
I would like my tools to make me aware of the known footguns, such as partial functions, etc.
I've tried to use this hlint config file: https://github.com/NorfairKing/haskell-dangerous-functions/blob/master/hlint.yaml
And it's working fine at the command line. However vscode is not picking it up. I do get the normal hlint suggestions, however it looks like vscode does not read the config file at all.
Looking for a solution, I then understood the hlint support is baked into the lsp server. Reading this issue related to the lsp server project, I deduced that the hlint config should be read after an lsp restart. However I'm not seeing any changes in vscode so it seems that this is a vscode extension issue?
I would also like to be able to see stan hints in the editor. As for hlint, it seems that support is baked into the lsp server implementation: https://haskell-language-server.readthedocs.io/en/latest/features.html?highlight=stan#stan-hints
My stan setup works fine at the command line, but nothing bubbles up in the editor.
Could you comment whether those features are available? Or planned?
Thanks
The text was updated successfully, but these errors were encountered: