Conversation
|
This means that we also get documentation for the modules the user is editing, not only for its dependencies. |
| -> Maybe SB.StringBuffer | ||
| -> IO ([FileDiagnostic], Maybe ParsedModule) | ||
| parseModule IdeOptions{..} env file = | ||
| let env' = env { hsc_dflags = hsc_dflags env `gopt_set` Opt_Haddock } in |
There was a problem hiding this comment.
GHC has both Opt_KeepRawTokenStream and Opt_Haddock which are mutually incompatible. We need Opt_KeepRawTokenStream in DAML since HLint will otherwise miss some hints and we’ll need the same in ghcide if we start integrating HLint.
So hardcoding this to Opt_Haddock isn’t really an option. Sadly, I don’t have a great answer for what the right option would be. I guess for now, we could add a ForceHadock field to IdeOptions and then set this to True for ghcide and if we do integrate HLint we accept that we miss some hints since docs are probably more useful. Long-term this should really get fixed in GHC so that the two are not exclusive (iirc the long-term plan is to build haddock on top of Opt_KeepRawTokenStream).
There was a problem hiding this comment.
Yeah, that seemed too easy to not have been tried earlier.
|
Parse twice, once for docs and another for hlint? Want Haddocks please. |
|
The problem is that you would essentially double the memory consumption :( One simple solution is to add |
|
No, you would double the amount of memory used to store the parsed AST. Even if it is inefficient, the cost would only be paid once/if hlint is integrated. |
|
As far as I know, if you run hlint independently of ghcide, there should be
no downsides. But maybe @cocreature knows better about this.
El sáb., 25 ene. 2020 12:11, Pepe Iborra <[email protected]>
escribió:
… No, you would double the amount of memory used to store the parsed AST.
Even if it is inefficient, the cost would only be paid once/if hlint is
integrated.
Are there any downsides to enabling -haddock in my project file? Will
that break Hlint?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#350>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACLQVUYIDUYRHYRRWXXIOLQ7QM7LANCNFSM4KLLZRVQ>
.
|
|
Running HLint independently is fine, this is about integrating HLint via Shake rules that rely on |
Fixes #7