Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/tutorials/building_r.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ cd $BUILDDIR
directory. This step takes ~1 minute on the codespace.

```bash
$TOP_SRCDIR/configure --with-valgrind-instrumentation=1
$TOP_SRCDIR/configure --enable-R-shlib --with-valgrind-instrumentation=1

```

Expand Down
35 changes: 35 additions & 0 deletions scripts/setup_positron.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Setup script for Positron IDE with r-dev-env
# Configures custom R binaries and root folders for both Gitpod and Codespaces

echo "Setting up Positron IDE configuration for r-dev-env..."

# Create .vscode directory if it doesn't exist
mkdir -p .vscode

# Determine the correct workspace path based on environment
if [ -d "/workspace/r-dev-env" ]; then
WORKSPACE_PATH="/workspace/r-dev-env"
echo "Detected Gitpod environment"
elif [ -d "/workspaces/r-dev-env" ]; then
WORKSPACE_PATH="/workspaces/r-dev-env"
echo "Detected Codespaces/DevContainer environment"
else
echo "Warning: Could not detect workspace environment"
WORKSPACE_PATH="/workspace/r-dev-env"
fi

# Create Positron settings
cat > .vscode/settings.json << EOF
{
"positron.r.customBinaries": ["$WORKSPACE_PATH/build/r-devel/bin/R"],
"positron.r.customRootFolders": ["$WORKSPACE_PATH"]
}
EOF

echo "Positron configuration created at .vscode/settings.json"
echo "R binary path: $WORKSPACE_PATH/build/r-devel/bin/R"
echo ""
echo "After building R with --enable-R-shlib, use 'R: Select Interpreter' in Positron"
echo "to select the custom R binary for proper console functionality."