Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Typemap reimplementation #1186

Merged
merged 16 commits into from
May 4, 2019
Merged

Conversation

fendor
Copy link
Collaborator

@fendor fendor commented Apr 21, 2019

Under the orchestration of @mpickering, reimplements the genTypeMap function in a new module.
A Typechecked module is only traveresed once.
This reimplementation should have a lower memory footprint but is likely to increase the first startup time of modules.
Some parts may no longer have a type on hover.

Implementation has already been merged into #1126. There it is said to be working!

  • More Documentation
  • Way more tests

Closes #1156

@fendor fendor requested a review from alanz April 21, 2019 20:33
@fendor
Copy link
Collaborator Author

fendor commented Apr 21, 2019

@mpickering Anything missing for this PR? Or do you think we should rather wait for your PR to be merged?

Copy link
Collaborator

@mpickering mpickering left a comment

Choose a reason for hiding this comment

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

You should quickly check the ghc-mod source to see if there are any other hover points it supports so this doesn't regress behaviour?

Also, are there any tests for hover? It would be good to add some if there aren't but it shouldn't block merging this MR.

@fendor
Copy link
Collaborator Author

fendor commented Apr 21, 2019

You should quickly check the ghc-mod source to see if there are any other hover points it supports so this doesn't regress behaviour?

Will do, thanks!

Also, are there any tests for hover? It would be good to add some if there aren't but it shouldn't block merging this MR.

I think there are some tests, but I will investigate

@fendor fendor force-pushed the typemap-reimplementation branch 2 times, most recently from be44bc9 to ffcbe45 Compare April 25, 2019 17:47
@fendor fendor force-pushed the typemap-reimplementation branch from ffcbe45 to 1805ebb Compare April 25, 2019 18:08
@fendor fendor force-pushed the typemap-reimplementation branch from ee3f3fa to 823d35e Compare April 26, 2019 14:27
@fendor fendor force-pushed the typemap-reimplementation branch from 4eec139 to a81a265 Compare April 26, 2019 15:24
Copy link
Collaborator

@mpickering mpickering left a comment

Choose a reason for hiding this comment

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

Thanks for this @fendor the patch looks really good now. The tests are a big improvement as well!

pattern HsOverLitType t <-
#if MIN_VERSION_ghc(8, 6, 0)
GHC.HsOverLit _ (GHC.overLitType -> t)
#elif MIN_VERSION_ghc(8, 4, 0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can just have the else clause here I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I wanted to ask that anyway, do we prefer easy to read, e.g. always three clauses although they often completely overlap, or conciseness when it comes to CPP?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I prefer not having the duplication and just having two clauses when possible.

@fendor
Copy link
Collaborator Author

fendor commented Apr 28, 2019

When the tests run through, this should be ready to merge, imo.

@alanz
Copy link
Collaborator

alanz commented Apr 28, 2019

Given what a big change this is, I suggest we merge it after the April release, which is due in a few days.

@mpickering
Copy link
Collaborator

CI looks to be failing still on 8.2.2 and 8.2.1.

@alanz Are you sure you don't want to merge this? It improves one of the big complaints about HIE which is high memory usage.

@fendor
Copy link
Collaborator Author

fendor commented Apr 28, 2019

@mpickering Tests fail for the type information for deriving clauses. Perhaps the code generation API has changed over one GHC version to the next?
Should the test case be solved via CPP?

However, failing tests are unrelated to the feature itself.

@fendor fendor force-pushed the typemap-reimplementation branch 3 times, most recently from 720d292 to 998350f Compare April 29, 2019 08:28
@fendor fendor force-pushed the typemap-reimplementation branch from 998350f to a5be92e Compare April 29, 2019 08:29
@fendor
Copy link
Collaborator Author

fendor commented Apr 30, 2019

CI fails are imo unrelated to this PR.

@mpickering
Copy link
Collaborator

This can be merged now I think?

@alanz
Copy link
Collaborator

alanz commented May 4, 2019

I think so, I presume the CI is transient.

@alanz
Copy link
Collaborator

alanz commented May 4, 2019

In other words, I guess I should actually take a look at it now.

@alanz alanz merged commit f22b2dd into haskell:master May 4, 2019
@alanz alanz added this to the 2019-05 milestone Jun 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hover causes far too much memory
3 participants