-
Notifications
You must be signed in to change notification settings - Fork 186
object_usage_linter ignores library functions #482
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
Comments
I was about to open an identical issue, so instead I am commenting here. In addition, maybe one should reconsider enabling |
Adding my +1 to this. It looks like the environment in which the code from outside the function definition is evaluated is not preserved when evaluating code that makes up the function definition. If the file could be parsed and the package variables added to the environment used for testing here: that might be one way to resolve this? I tried fiddling with it, but I'm not comfortable enough with the structure of the package to know precisely where the leverage point would be. |
Note that a somewhat hacky work-around is to source the file before linting / manually attach all needed packages. It works because the default environment in non-packages is |
This has been fixed. |
From https://github.com/REditorSupport/vscode-r-lsp/issues/36.
Suppose the following code is stored in
test.R
:Then
object_usage_linter
seems to ignorelibrary(jsonlite)
and markread_json
as unknown which is annoying.The text was updated successfully, but these errors were encountered: