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
add positron.r.interpreters.exclude setting to exclude R installation paths (#6472)
### Summary
- addresses #6205
- adds a new setting `positron.r.interpreters.exclude` which allows the
user to specify R installation binary paths or directories containing R
installations that should be excluded from the UI in Positron
#### Settings UI
<img width="783" alt="image"
src="https://github.com/user-attachments/assets/af5a1fb3-6f2a-49a9-b2a8-24ba4023cef0"
/>
#### Settings JSON
```json
"positron.r.interpreters.exclude": [
"/opt/local"
]
```
#### R Language Pack Output
```js
...
2025-02-25 10:11:26.178 [info] User-specified R binaries:
[
"/opt/local/R/4.3-arm64/Resources/bin/R"
]
...
2025-02-25 10:11:26.178 [info] Candidate R binary at /opt/local/R/4.3-arm64/Resources/bin/R
2025-02-25 10:11:26.178 [info] User-specified R installation paths to exclude:
[
"/opt/local"
]
2025-02-25 10:11:26.178 [info] User has excluded R installation at /opt/local/R/4.3-arm64/Resources/bin/R
2025-02-25 10:11:26.178 [info] R installation discovered: {
"usable": false,
"supported": true,
"reasonDiscovered": [
"User-specified location",
"Found in a conventional location for R binaries installed on a server"
],
"reasonRejected": "Installation path was excluded via settings",
"binpath": "/opt/local/R/4.3-arm64/Resources/bin/R",
"homepath": "/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources",
"semVersion": {
"options": {},
"loose": false,
"includePrerelease": false,
"raw": "4.3.3",
"major": 4,
"minor": 3,
"patch": 3,
"prerelease": [],
"build": [],
"version": "4.3.3"
},
"version": "4.3.3",
"arch": "arm64",
"current": false,
"orthogonal": true
}
...
2025-02-25 10:11:26.178 [info] Filtering out /opt/local/R/4.3-arm64/Resources/bin/R, reason: Installation path was excluded via settings.
2025-02-25 10:11:26.178 [warning] Some discovered R installations are unusable by Positron.
2025-02-25 10:11:26.178 [warning] Learn more about R discovery at https://positron.posit.co/r-installations
```
### Release Notes
#### New Features
- New setting to exclude R installation paths from the UI (#6205)
#### Bug Fixes
- N/A
### QA Notes
- please test with and without the `positron.r.customBinaries` and
`positron.r.customRootFolders` settings which allow "includes" to be
specified
- see
https://positron.posit.co/r-installations.html#customizing-r-discovery
for more info on these options
- Positron will need to be restarted upon changing the settings so that
discovery can re-run with the settings applied
- excluding interpreters via `positron.r.interpreters.exclude` will take
precedence over includes with `positron.r.customBinaries` or
`positron.r.customRootFolders`
- Relative paths specified in the options are ignored
Copy file name to clipboardexpand all lines: extensions/positron-python/src/client/pythonEnvironments/base/locators/lowLevel/userSpecifiedEnvLocator.ts
Copy file name to clipboardexpand all lines: extensions/positron-r/package.nls.json
+1
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@
35
35
"r.configuration.title-dev": "Advanced",
36
36
"r.configuration.customRootFolders.markdownDescription": "List of additional folders to search for R installations. These folders are searched after and in the same way as the default folder for your operating system (e.g. `C:/Program Files/R` on Windows).",
37
37
"r.configuration.customBinaries.markdownDescription": "List of additional R binaries. If you want to use an R installation that is not automatically discovered, provide the path to its binary here. For example, on Windows this might look like `C:/some/unusual/location/R-4.4.1/bin/x64/R.exe`.",
38
+
"r.configuration.interpreters.exclude.markdownDescription": "List of absolute paths to R binaries or folders containing R binaries to exclude from the available R installations. These interpreters will not be displayed in the Positron UI.\n\nExample: On Linux or Mac, add `/custom/location/R/4.3.0/bin/R` to exclude the specific installation, or `/custom/location` to exclude any R installations within the directory.\n\nRequires a restart to take effect.",
38
39
"r.configuration.kernelPath.description": "Path on disk to the ARK kernel executable; use this to override the default (embedded) kernel. Note that this is not the path to R.",
39
40
"r.configuration.tracing.description": "Traces the communication between VS Code and the language server",
40
41
"r.configuration.tracing.off.description": "No tracing.",
0 commit comments