Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Write ifaces on save #760

Merged
merged 6 commits into from
Sep 11, 2020
Merged

Write ifaces on save #760

merged 6 commits into from
Sep 11, 2020

Conversation

wz1000
Copy link
Collaborator

@wz1000 wz1000 commented Sep 4, 2020

To achieve this we augment the FileOfInterest store with a flag that indicates whether a file is saved on disk or not.

@wz1000
Copy link
Collaborator Author

wz1000 commented Sep 4, 2020

The mtime change in the last commit isn't very relevant right now, but it is important for checking the integrity of the database in my hiedb branch.

@wz1000 wz1000 force-pushed the save-iface branch 2 times, most recently from b130f7a to e31f089 Compare September 4, 2020 08:24
Copy link
Collaborator

@pepeiborra pepeiborra left a comment

Choose a reason for hiding this comment

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

Changes look good to me. Can we have a test too?

@wz1000
Copy link
Collaborator Author

wz1000 commented Sep 4, 2020

I'm not sure how to test this change.

@pepeiborra
Copy link
Collaborator

Hmmm I cannot think of a nice way either.

Why do we want to write interface files on save? Is that for hiedb?

@wz1000
Copy link
Collaborator Author

wz1000 commented Sep 4, 2020

Yes, it is useful for hiedb but also addresses some of your concerns here: #688 (comment)

Reading the comment again, it doesn't have much to do with the concerns you raised in that comment, but it will make cached interface files available in slightly more scenarios, for faster startups.

@wz1000
Copy link
Collaborator Author

wz1000 commented Sep 4, 2020

A way to test this might be to check if the interface file exists after saving. But I don't think we can get the path the the ghcide cache directory currently.

Maybe we should also introduce unit tests?

@pepeiborra
Copy link
Collaborator

I was thinking that maybe it would become easier to test this when the hiedb changes land

@pepeiborra
Copy link
Collaborator

@wz1000 are you planning to add tests to this? You can know find the location of the cache directory for a given module

@wz1000
Copy link
Collaborator Author

wz1000 commented Sep 11, 2020

I think this is ready

@pepeiborra pepeiborra merged commit 15ab2ff into haskell:master Sep 11, 2020
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Write ifaces on save

* Move isFileOfInterestRule to FileStore.hs and use real mtime for saved files

* hlint

* Add test

* fix flaky tests

* Only check for hie file in >= 8.6
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Write ifaces on save

* Move isFileOfInterestRule to FileStore.hs and use real mtime for saved files

* hlint

* Add test

* fix flaky tests

* Only check for hie file in >= 8.6
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Write ifaces on save

* Move isFileOfInterestRule to FileStore.hs and use real mtime for saved files

* hlint

* Add test

* fix flaky tests

* Only check for hie file in >= 8.6
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.

2 participants