You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Packages not loaded prior to linting with coc-r-lsp #238
Not sure if this is an issue of this package, or a problem of coc-r-lsp, but I'm encountering some difficulties setting them up to work together.
Although linting basically works out of the box, it looks like the current buffer is getting processed by lintr without loading the package (or any dependencies, imports, ...) first. This results in many warnings generated by the object_usage_linter. If I run languageserver::diagnose_file("<file>", readLines("<file>") everything looks good OTOH.
This is quite similar with the cause of #235 since languageserver::diagnose_file actually pass the content being edited (often not saved to disk) to lintr::lint() so its original path is lost so that linters that rely on it no longer works as expected.
Activity
renkun-ken commentedon Mar 31, 2020
This is quite similar with the cause of #235 since
languageserver::diagnose_fileactually pass the content being edited (often not saved to disk) tolintr::lint()so its original path is lost so that linters that rely on it no longer works as expected.object_usage_lintris such a linter that relies on the file path to detect if it lives in a package (See https://github.com/jimhester/lintr/blob/master/R/object_usage_linter.R#L18) to determine its globals.#236 resolves #235 but the root cause is still there. We'll probably have to find another way to fix this.