Skip to content

[purs ide] Tracks the cache-db.json timestamp#3799

Merged
kritzcreek merged 4 commits intopurescript:masterfrom
kritzcreek:ide-cache-db-timestamp
Mar 8, 2020
Merged

[purs ide] Tracks the cache-db.json timestamp#3799
kritzcreek merged 4 commits intopurescript:masterfrom
kritzcreek:ide-cache-db-timestamp

Conversation

@kritzcreek
Copy link
Copy Markdown
Member

This allows us to trigger a full reload when someone other than the IDE invoked the compiler. Together with --editor-mode this should be a good enough default to not file watching anymore (if we agree that's the case I'll merge #3776 into this PR).

The one thing that is a bit off is that this triggers a full load when it detects a change, which kind of defeats the Load command allowing the clients to selectively load modules, but none of the editor plugins are doing that as far as I know.

This allows us to trigger a full reload when someone other than the
IDE invoked the compiler
@gabejohnson
Copy link
Copy Markdown

The one thing that is a bit off is that this triggers a full load when it detects a change, which kind of defeats the Load command allowing the clients to selectively load modules, but none of the editor plugins are doing that as far as I know.

Are you talking about something other than psc-ide-load-module?

@kritzcreek
Copy link
Copy Markdown
Member Author

Are you talking about something other than psc-ide-load-module?

That's what I'm talking about, yeah. Though if you're starting the ide-server from within emacs it'll immediately issue a psc-ide-load-all, so you can only selectively load modules if you start the server from outside of Emacs (or with a custom function).

@gabejohnson
Copy link
Copy Markdown

That's what I'm talking about, yeah. Though if you're starting the ide-server from within emacs it'll immediately issue a psc-ide-load-all

So this change will only trigger a full reload if there's a change from outside the IDE? I thought you meant it would do a full reload when it detects any change, even inside the IDE.

@kritzcreek
Copy link
Copy Markdown
Member Author

Oh no, for reloads after ide rebuilds it only reloads the module that was just changed.

@gabejohnson
Copy link
Copy Markdown

Cool. Sorry for the noise 😅

@kritzcreek
Copy link
Copy Markdown
Member Author

No worries, I appreciate people making me explain what I did. Usually uncovers some stupid stuff 😆

@kritzcreek
Copy link
Copy Markdown
Member Author

I've been using this for a bit on my own and so far it seems to be working well, didn't have to reload once, even after adding new packages to the project. I'll remove all the flags apart from the --no-watch one (that's the only one that still makes sense in this PR's setting) to make this into an actually mergeable PR.

The editor mode functionality is the default now, and we're checking
the cache-db.json timestamp to invalidate our externs store instead.
This means we can get rid of the flaky file watcher
@kritzcreek
Copy link
Copy Markdown
Member Author

The --no-watch flag also didn't really make sense so I got rid of that one as well. If people have use-cases where the timestamp tracking is an issue I can add a flag to disable it later on, but I don't see one right now.

makes the formatting consistent within this file at least
@kritzcreek
Copy link
Copy Markdown
Member Author

I've added a formatting commit that you might want to ignore during the review, but the various inconsistencies were growing on me, sorry :D

Copy link
Copy Markdown
Contributor

@hdgarrood hdgarrood left a comment

Choose a reason for hiding this comment

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

Thanks - this looks good to me!

@kritzcreek
Copy link
Copy Markdown
Member Author

@nwolverson I'll merge this, if you'd like me to summarize the changes just let me know, I think looking at the changes in README.md should show you all the flags that have been removed.

@kritzcreek kritzcreek merged commit 281eb3c into purescript:master Mar 8, 2020
@kritzcreek kritzcreek deleted the ide-cache-db-timestamp branch March 8, 2020 09:44
justinwoo pushed a commit to justinwoo/purescript that referenced this pull request May 15, 2020
* [purs ide] Tracks the cache-db.json timestamp

This allows us to trigger a full reload when someone other than the
IDE invoked the compiler

* fixes tests

* [purs ide] removes editor mode flag and the file watcher

The editor mode functionality is the default now, and we're checking
the cache-db.json timestamp to invalidate our externs store instead.
This means we can get rid of the flaky file watcher

* Formats the Ide.Types module into how I'd write Haskell today

makes the formatting consistent within this file at least
@hdgarrood hdgarrood mentioned this pull request May 23, 2020
hdgarrood pushed a commit that referenced this pull request May 23, 2020
* [purs ide] Tracks the cache-db.json timestamp

This allows us to trigger a full reload when someone other than the
IDE invoked the compiler

* fixes tests

* [purs ide] removes editor mode flag and the file watcher

The editor mode functionality is the default now, and we're checking
the cache-db.json timestamp to invalidate our externs store instead.
This means we can get rid of the flaky file watcher

* Formats the Ide.Types module into how I'd write Haskell today

makes the formatting consistent within this file at least
@hdgarrood hdgarrood mentioned this pull request May 23, 2020
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.

3 participants