-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Use file watches for all workspace files #1880
Conversation
6720435
to
9a782b7
Compare
-- support that: https://github.com/bubba/lsp-test/issues/77 | ||
watchers = [ watcher (Text.pack glob) | glob <- globs ] | ||
|
||
void $ LSP.sendRequest LSP.SClientRegisterCapability regParams (const $ pure ()) -- TODO handle response |
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.
Ideally we would block waiting for the response return and return a result depending on whether it was successful.
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 is an old TODO, it's not something added in this PR. I agree that we should wait for the response, but maybe not for this PR
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.
BTW I checked this and lsp-test doesn't seem to implement this part of the protocol, opened haskell/lsp#333
This PR hooks up the
GetModificationTime
rule to install new file watchers for workspace files that are not already covered by the initial glob that we install, consolidating the tracking of workspace changes. There are two main use cases for this:hie.yaml
file and the cabal/stack descriptorsaddDependentFile
.The implementation adds a new zero-dependency rule
AddWatchedFile
that creates the file watches, and makesGetModificationTime
depend on it. The rest of the changes are mostly refactorings needed to hook things up.The motivation for this change is not just consolidation or performance. This is required in #1862 to be able to track changes in the use cases listed above.