Skip to content

Separate resolve task from parse task - #205

Merged
renkun-ken merged 7 commits into
REditorSupport:masterfrom
renkun-ken:resolve-task
Feb 12, 2020
Merged

renkun-ken merged 7 commits into
REditorSupport:masterfrom
renkun-ken:resolve-task

Conversation

@renkun-ken

@renkun-ken renkun-ken commented Feb 12, 2020 •

Copy link
Copy Markdown
Member

PR #204 tries to improve the performance of parse_task by avoiding unnecessary loading packages.

However, parsing is always fast while resolving packages with child R session is expensive. We should separate package resolving from parsing so that parse_task could callback quickly to provide necessary parse data for all other providers that need it and resolve_task should be created only when parse_data$packages is changed.

So the task flow looks like:

didOpen, didChange, didSave
* diagnostics_task -> diagnostics_callback
* parse_task -> parse_callback
  ? resolve_task -> resolve_callback

Another problem #204 has is that incremental resolving package could not handle reorder of package attaching, so the masking could be incorrect. The safe way to do is that whenever the library calls in the document are changed (i.e. original parse_data$packages changed), the resolve_task should be run. Since resolve_task is separated from parse_task, then the performance of resolve_task would not affect providers that use parse_data.

Comment thread R/workspace.R Resolved
@randy3k

randy3k commented Feb 12, 2020

Copy link
Copy Markdown
Member

I didn't check it carefully, but it makes sense to me.

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.

2 participants