-
Notifications
You must be signed in to change notification settings - Fork 93
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
Extend completion with source by recursive parsing #20
Comments
Right now, we search for We also have to be cautious about infinitely loop while the files are loaded recursively. |
Agreed. A set of files associated with the document can be cached to avoid the infinite loop of |
A related but not entirely the same issue
One solution is to open a new R session via
|
Seems like a smart approach that avoids most of the complexities. |
I'm using the |
It’s has already been done. However, the package dependencies are only resolved when the file is open and saved. |
Hi, |
Thank you. I have filed an issue at the jupyterlab-lsp repo and linked your suggestions: https://github.com/krassowski/jupyterlab-lsp/issues/95 |
This would not work that well if the thing being sourced is lot a literal string. In my own workflow I frequently have something that does a thing like |
Hi, I got a |
It is tricky to provide completion without attaching to the R session being used by user. One simplified approach that I believe can serve most of the purposes is parse the currently editing document and find top-level
source
functions, and parse those files recursively.For example, the following code is from several R scripts:
main.R
:my_plot.R
:library(ggplot2)
data/utils.R
:When
main.R
is being edited, thoselibrary
expressions are captured. If thosesource
expressions are captured andmy_plot.R
anddata/utils.R
are analyzed, wherelibrary
andsource
expressions in these files are also captured, the completion will be much better and no less accurate, especially when #19 is implemented.Also those top-level
library()
,require()
,loadNamespace()
,requireNamespace()
calls can be used to provide diagnostics when required package is not installed.The text was updated successfully, but these errors were encountered: