Skip to content
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

Merged
merged 5 commits into from
Jul 6, 2021

Conversation

renkun-ken
Copy link
Member

@renkun-ken renkun-ken commented Jul 1, 2021

Closes #446

This PR implements workspace/didChangeWatchedFiles so that in a package workspace whenever files in R 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.

  • Implement workspace/didChangeWatchedFiles
  • Test cases

@renkun-ken renkun-ken requested a review from randy3k July 1, 2021 10:10
@renkun-ken
Copy link
Member Author

@randy3k Any comments?

@randy3k
Copy link
Member

randy3k commented Jul 6, 2021

LGTM. I think at some point we will need to look into supporting non-package projects, eg a shiny or plumber app.

@renkun-ken renkun-ken merged commit ce593de into REditorSupport:master Jul 6, 2021
@@ -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()
Copy link
Member

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?

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done via 354b8d8

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.

Handle workspace/didChangeWatchedFiles
2 participants