Repository navigation
Description
Describe the bug
The R linter fails with a normalizePath() error when trying to lint R files, showing "path[1]="": Impossibile trovare il percorso specificato" (Cannot find the specified path). The error occurs in a callr subprocess and prevents the linter from running, even though the R code itself has no linting issues when run directly.
To Reproduce
Steps to reproduce the behavior:
- Create an R file (e.g., setup_r_dependencies.R) with valid R code
- Open the file in VS Code with the R extension enabled
- The extension automatically attempts to run diagnostics
- See error in the Problems panel: Failed to run diagnostics: ! in callr subprocess. Caused by error in lintr::lint(path, cache = cache, text = content): ! Linter linter() failed in '': Caused by error in normalizePath(): ! path[1]="": Impossibile trovare il percorso specificato
Can you fix this issue by yourself? (We appreciate the help)
No - this appears to be an internal issue with how the extension handles file paths when calling the lintr subprocess.
(If applicable) Please attach setting.json
// Default R extension settings - no custom configuration
"r.rterm.windows": "",
"r.rterm.mac": "/usr/local/bin/R",
"r.rterm.linux": "/usr/bin/R",
"r.rterm.option": [],
"r.source.encoding": "UTF-8",
"r.source.focus": "editor",
"r.alwaysUseActiveTerminal": false,
"r.bracketedPaste": false,
"r.sessionWatcher": true,
"r.rtermSendDelay": 8,
Expected behavior
The linter should run without errors and provide appropriate linting feedback. When running lintr::lint('setup_r_dependencies.R') directly in R, it works correctly and reports "No lints found."
Environment (please complete the following information):
OS: Windows
VSCode Version: [your VS Code version]
R Version: 4.5.0 (2025-04-11 ucrt)
vscode-R version: [your extension version]
Additional context
The error message is in Italian, suggesting it may be related to locale handling: "Impossibile trovare il percorso specificato" = "Cannot find the specified path"
Direct testing shows the issue is isolated to the VS Code extension's linter integration:
- (ok) lintr::lint('setup_r_dependencies.R') works fine in R console
- (ok) callr::r(function() { lintr::lint('setup_r_dependencies.R') }) works fine in R console
- (bug) VS Code extension fails with empty path error
The error suggests the extension is passing an empty string (path[1]="") to normalizePath(), indicating a path resolution bug in the extension's linter integration
File has proper encoding headers and no unusual characters
No R configuration files (.Rprofile, .Renviron) that could interfere
The R code itself is syntactically correct and functional
The core issue appears to be that the extension is somehow passing an empty file path string to the lintr subprocess, causing normalizePath() to fail.

Activity
sebffischer commentedon Sep 4, 2025
I also observe this
WihanZA commentedon Sep 9, 2025
I have the same problem - even if the file has been deleted from the workspace.
toscm commentedon Feb 26, 2026
The issue seems to occur when opening a temporary file, such as a git diff preview. After closing the preview, the language server continues to lint the file. As a result, the reported problem occurs (
path[1]="": No such file or directory).Screen.Recording.2026-02-26.at.08.54.13.mov
Over time, this leads to an accumulation of problems in the Problems panel. The same file may appear multiple times, if it has been opened repeatedly in the diff editor after different edits.
toscm commentedon Feb 26, 2026
I opened PR #1681 for this issue. In case anyone wants to try the proposed fix before the maintainers have time to evaluate the PR, I published a pre-release VSIX here: https://github.com/toscm/vscode-R/releases/tag/v2.8.6-tempfix.1. To install the pre-release, just download the VSIX and then install using the VS Code command
Extensions: Install from VSIX....ThomasSoeiro commentedon Sep 23, 2026
@randy3k @eitsupi @Fred-Wu @grantmcdermott Closed by #1697