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

Delete some dead or deprecated settings #2481

Merged
merged 5 commits into from Dec 14, 2021

Conversation

michaelpj
Copy link
Collaborator

@michaelpj michaelpj commented Dec 13, 2021

Perhaps controversially, I also removed the disabled tests for diagnostics-on-save and Liquid Haskell. They're in the history if someone wants to resurrect those features.

I'm not very happy with the section in the docs about this: ideally it would display some sensible auto-generated table of settings or something...

, plugins :: !(Map.Map T.Text PluginConfig)
{ checkParents :: CheckParents
, checkProject :: !Bool
, hlintOn :: !Bool
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is hlintOn used? Suspicious

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hlint plugin does use it in its GetHlintDiagnostics rule

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this one I foolishly assumed that the comment in the doc was all there was - more purging to do.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I understand now nevermind...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hlintOn is in the plugin for backwards compat in the deprecation process but that was time ago so it can be deleted
@michaelpj feel free to remove it here or we can do later

@jneira
Copy link
Member

jneira commented Dec 13, 2021

The build in circleci and stack is failing due to -Werror=unused-imports:

haskell-language-server           > /root/build/test/functional/Diagnostic.hs:6:1: error: [-Wunused-imports, -Werror=unused-imports]
haskell-language-server           >     The import of ‘Data.Aeson’ is redundant
haskell-language-server           >       except perhaps to import instances from ‘Data.Aeson’
haskell-language-server           >     To import instances alone, use: import Data.Aeson()
haskell-language-server           >   |
haskell-language-server           > 6 | import           Data.Aeson              (toJSON)
haskell-language-server           >   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
haskell-language-server           > 
haskell-language-server           > /root/build/test/functional/Diagnostic.hs:7:1: error: [-Wunused-imports, -Werror=unused-imports]
haskell-language-server           >     The qualified import of ‘Data.Default’ is redundant
haskell-language-server           >       except perhaps to import instances from ‘Data.Default’
haskell-language-server           >     To import instances alone, use: import Data.Default()
haskell-language-server           >   |
haskell-language-server           > 7 | import qualified Data.Default
haskell-language-server           >   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
haskell-language-server           > 
haskell-language-server           > /root/build/test/functional/Diagnostic.hs:8:1: error: [-Wunused-imports, -Werror=unused-imports]
haskell-language-server           >     The import of ‘Ide.Plugin.Config’ is redundant
haskell-language-server           >       except perhaps to import instances from ‘Ide.Plugin.Config’
haskell-language-server           >     To import instances alone, use: import Ide.Plugin.Config()
haskell-language-server           >   |
haskell-language-server           > 8 | import           Ide.Plugin.Config
haskell-language-server           >   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
haskell-language-server           > 

Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice to see a +6-87 in a pr, thanks for the xmas clean up! 🎅

let hlintOn' = hlintOn config && plcGlobalOn pluginConfig && plcDiagnosticsOn pluginConfig
ideas <- if hlintOn' then getIdeas file else return (Right [])
let hlintOn = pluginEnabledConfig plcDiagnosticsOn plugin config
ideas <- if hlintOn then getIdeas file else return (Right [])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is not the deactivation handled automatically and generically by hls-plugin-api?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea how this works 😅 If I do that then the test that changing the config works starts timing out 🤷

Copy link
Member

@jneira jneira Dec 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm ok i think we should change noHlintDiagnostics for

noHlintDiagnostics :: Assertion
noHlintDiagnostics  = expectNoMoreDiagnostics 3 doc "hlint"

to avoid the parser hang on some diagnostic which never is emitted (not sure why it works keeping the if but 🤷 )

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind if I leave that as a future improvement, and leave this PR as just getting rid of the old settings?

@michaelpj
Copy link
Collaborator Author

I think I've purged hlintOn properly now.

@jneira jneira merged commit 47f29da into haskell:master Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants