-
Notifications
You must be signed in to change notification settings - Fork 90
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
Handle workspace/didChangeWatchedFiles
#447
Conversation
@randy3k Any comments? |
LGTM. I think at some point we will need to look into supporting non-package projects, eg a shiny or plumber app. |
@@ -103,6 +106,9 @@ text_document_did_close <- function(self, params) { | |||
diagnostics_callback(self, uri, NULL, list()) | |||
self$workspace$documents$remove(uri) | |||
self$workspace$update_loaded_packages() | |||
} else if (self$workspace$documents$has(uri)) { | |||
doc <- self$workspace$documents$get(uri) | |||
doc$did_close() |
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.
To simplify the logic, could we move these line to line 103?
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.
You merged quick :) Never mind.
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.
Done via 354b8d8
Closes #446
This PR implements
workspace/didChangeWatchedFiles
so that in a package workspace whenever files inR
folders are changed, the created or modified files will be reloaded, and the removed files are dropped. As a result, the workspace is always up-to-date.Note that the changes in open documents will trigger
workspace/didChangeWatchedFiles
too, but the client will send requests to properly handle them in the first place. Therefore, we explicitly ignore these open documents here.workspace/didChangeWatchedFiles