-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Skip parsing without haddock for above GHC9.0 #2338
Skip parsing without haddock for above GHC9.0 #2338
Conversation
2e12e20
to
981635d
Compare
Thanks for the pr, i think we could use runtime checks instead cpp as both branches compile with all ghcs Runtime checks are here: haskell-language-server/ghcide/src/Development/IDE/GHC/Compat.hs Lines 277 to 299 in 7011d5e
Example here:
|
@jneira oh i see. i will fix to use runtime check |
Looks good to me but i would like to know @pepeiborra thoughts |
This looks reasonable to me, but does it actually work?
|
Sorry but I don't have enough knowledge to answer @pepeiborra' s questions. Could anyone give me any advice where to start to investigate about these questions? ( @jneira ) |
* sort completions * add an example * Include fuzzy scores in completions sort text * hlints * Extend completion documentation to inform whether an identifier is alreaady imported * Ditch alphabetical ordering - it's incompatible with qualified completions * Fix bugs in completion help text This fixes the ugly "Imported from 'Just B'" and other inconsistencies * added tests for qualified completions * Fix redundant import * Inline Fuzzy.match to apply [1] and to be case-sensitive on first match [1] - joom/fuzzy#4 * fixup! Fix bugs in completion help text * Sort qualified completions first * Filter out global suggestions that overlap with local For example, don't suggest GHC.Exts.fromList when Data.Map.fromList is in scope alraedy * Sort completions alphabetically * Show provenance in detail text * Sort local/in-scope completions first * Fix build with GHC 9 * Ignore func symbol tests Co-authored-by: Alex Naspo <[email protected]> Co-authored-by: Javier Neira <[email protected]>
2f74519
to
7ce5681
Compare
Hi, well there is a failing test which seems to be related with the pr: https://github.com/haskell/haskell-language-server/runs/4165727646?check_suite_focus=true
As mentioned by pepe maybe we were relying in the double parsing to effectively get docs so removing it seems to be not enough, i am afraid. The test fail has to be investigated and fixed. Related with that is the second question. Add temporary some traces (using
|
@jneira i see. thank you for your kind comment. i'll try. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pepeiborra @jneira
I've fixed code and confirmed ghcide test code passed in my local machine. (It seems to fail testing in Windows environment on GitHub Actions, but I don't know whether it's required to pass. Please notify me if I need to confirm the Windows environemnt.)
For question 2, I confirmed not to parse twice in GHC 9.0.1 with Debug.Trace by inserting trace to getParsedModuleDefinition
function.
Please point out if I misunderstood something or need to do something else.
res@(_,pmod) <- if Compat.ghcVersion >= Compat.GHC90 then | ||
liftIO $ (fmap.fmap.fmap) reset_ms $ getParsedModuleDefinition hsc opt file (withOptHaddock ms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed my code to collect haddock information even if Opt_Haddock returns False.
It seems to do so for display haddock information in the hover as the failed test suites indicated.
(for question 1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, with GHC >9.0 we want to parse with Opt_Haddock
on always
-- non-interest are always parsed with Haddocks | ||
-- If we can parse Haddocks, might as well use them | ||
-- | ||
-- HLINT INTEGRATION: might need to save the other parsed module too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is confusing , I think it can be deleted since GetParsedModuleWithComments
was introduced. What do you think @jneira ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it was even not hlint specific and can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this comment 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test failure looks unrelated, testsuite is flaky in Windows. I don't see any problems with the change, looks good. Thanks for testing @yoshitsugu !
…ub.com/yoshitsugu/haskell-language-server into feature/skip_parse_without_haddock_ghc90
circleci build is stuck, it says there is no circleci config, which is not true, let's see what is doing in the next branch update |
I've opened a ticket with circleci support but the issue is not resolved so i am gonna merging it manually, as gh workflow is green |
@jneira Sometimes it does, and you can reactivate it by close and reopen PR. |
@pepeiborra @jneira thanks for advising me! |
yeah, but this time create a manual workflow run in all pr's fails due to a false positive:
|
* Skip parsing without haddock for above GHC9.0 * Use runtime ghc version check * Need parse twice in getParsedModuleRule * Include sortText in completions and improve suggestions (#2332) * sort completions * add an example * Include fuzzy scores in completions sort text * hlints * Extend completion documentation to inform whether an identifier is alreaady imported * Ditch alphabetical ordering - it's incompatible with qualified completions * Fix bugs in completion help text This fixes the ugly "Imported from 'Just B'" and other inconsistencies * added tests for qualified completions * Fix redundant import * Inline Fuzzy.match to apply [1] and to be case-sensitive on first match [1] - joom/fuzzy#4 * fixup! Fix bugs in completion help text * Sort qualified completions first * Filter out global suggestions that overlap with local For example, don't suggest GHC.Exts.fromList when Data.Map.fromList is in scope alraedy * Sort completions alphabetically * Show provenance in detail text * Sort local/in-scope completions first * Fix build with GHC 9 * Ignore func symbol tests Co-authored-by: Alex Naspo <[email protected]> Co-authored-by: Javier Neira <[email protected]> * Give unique names to post-jobs (#2337) * Restore comment * Parse only with Haddock above GHC90 * Remove obsolete comment Co-authored-by: Pepe Iborra <[email protected]> Co-authored-by: Alex Naspo <[email protected]> Co-authored-by: Javier Neira <[email protected]>
For #1892
Just skip by
#if
, is it enough for this issue? 🤔