Curriculum previewThis is not your assigned passport. No identity, answers, or completion progress are stored here.How to start your passport
Handbook / reference

reference

Visual Studio Code Setup And Daily Use

Prerequisites: browser access to the project repository. Install only the extensions required by that project and your selected passport tracks.

Goal: install VS Code, select the project environment, run repository checks, use Git, and review AI-assisted changes without losing control.

Prerequisites: browser access to the project repository. Install only the extensions required by that project and your selected passport tracks.

Execution context: installation and local settings run on your laptop. A VS Code terminal runs wherever the VS Code status bar says you are connected; verify before pasting local, Blade, or Euler commands.


Table of Contents#

  1. Why VS Code?
  2. Install VS Code
  3. Essential Extensions
  4. Conda Environments in VS Code
  5. Running Code
  6. Linting & Formatting with Ruff
  7. Git Collaboration inside VS Code
  8. AI Coding Tools
  9. Productivity Tips
  10. Troubleshooting

Why VS Code?#

  • Lightweight + extensible — starts fast, scales with extensions.
  • Single-window workflow — editor, terminal, debugger, Git, Jupyter.
  • Cross-platform — identical on Windows, macOS, Linux, and via Remote-SSH.

Install VS Code#

  1. Download from https://code.visualstudio.com/
  2. Run the installer. On Windows, keep defaults and tick “Add to PATH” / “Open with Code”.
  3. Launch VS Code → Help → About to confirm version.

Essential Extensions#

Extension Publisher Purpose
Python Microsoft Language support, debugger, Jupyter kernels
Jupyter Microsoft Run .ipynb notebooks inside VS Code
Ruff Astral Software Python linter / formatter
GitHub Pull Requests and Issues GitHub PR review and issues
GitHub Copilot GitHub Recommended no-cost student agent route after GitHub Education verification
Remote Development Microsoft Remote-SSH for Euler / lab machines

Install: Extensions sidebar (⌘/Ctrl + Shift + X) → search → Install.


Conda Environments in VS Code#

  1. Create / activate env (if needed)
    conda create -n lab python=3.11
    conda activate lab
    
  2. Select interpreter
    • Click Python version in status-bar (bottom-right), or
    • Command Palette -> Python: Select Interpreter -> choose the project's lab environment.

Interpreter choice is stored per workspace in .vscode/settings.json.


Running Code#

Python scripts#

  • Create hello.pyprint("Hello lab!")
  • Press Run ▶ (top-right) or F5 to debug.
  • Output appears in Terminal / Debug Console.

Jupyter notebooks#

  1. File → New File… → Jupyter Notebook (or save *.ipynb).
  2. Top-right kernel picker → select lab.
  3. Add cells → Run ▷ — Markdown & rich outputs render inline.

Linting & Formatting with Ruff#

  1. Install Ruff extension.

  2. Use the repository's existing pyproject.toml. For a new project, start with the IDEAL Lab template rather than inventing settings. A current minimal form is:

    [tool.ruff]
    line-length = 100
    
    [tool.ruff.lint]
    select = ["E4", "E7", "E9", "F", "I"]
    
  3. Issues appear live in the editor & Problems panel.

  4. Format file: Shift + Alt + F (or right-click → Format Document).


Git Collaboration inside VS Code#

Full sign-in instructions live in git_workflow.md.

Daily loop#

Step VS Code UI Shortcut
Pull latest ↧ icon / Git: Pull ⌘/Ctrl + Shift + P
Create branch Status-bar → branch → New
Stage → commit Source Control sidebar Ctrl + Enter
Push ↥ icon / Git: Push
PR Toast → Create Pull Request

Example — integrate two feature branches#

  1. Sync main — checkout mainPull.
  2. New branch integrate-wing-fuselagePush.
  3. Merge wing into integration branch → resolve conflicts → Push.
  4. Merge fuselage (same).
  5. Both developers test on integrate-wing-fuselage; repeat as needed.

AI Coding Tools#

Complete the manual FirstSteps change before delegating an edit. The canonical AI coding-agent guide explains the model, provider/gateway, harness, interface, permissions, cost, and data boundaries.

The recommended student route is GitHub Copilot Student, a personal no-cost GitHub Education benefit. It is not an ETH-purchased GitHub Copilot subscription. Zed with personal OpenRouter is an optional paid route, not a passport requirement.

VS Code can host several AI workflows:

Tool Best use Repo instruction file
GitHub Copilot Inline suggestions, chat, PR summaries and reviews .github/copilot-instructions.md, AGENTS.md
Codex Larger agentic edits, reviews, repo exploration AGENTS.md
Claude Code Planning, codebase exploration, careful refactors CLAUDE.md importing AGENTS.md
Cursor Agentic editing inside Cursor's VS Code-like editor .cursor/rules/ and AGENTS.md

Use the same operating loop for all of them:

  1. Ask for an explanation before edits.
  2. Give constraints: files to inspect, files not to touch, no new dependencies unless approved.
  3. Ask for tests or smoke checks before implementation.
  4. Review the diff yourself.
  5. Run verification before accepting the result.

Prefer one-time approval for an understood tool or terminal command. Do not enable broad automatic approval merely to avoid prompts.

Good prompt:

Goal: add a test for the CSV loader edge case.
Context: inspect src/data_loader.py and tests/test_data_loader.py.
Constraints: do not change public function names; do not add dependencies.
Verification: run pytest tests/test_data_loader.py.
Output: explain the failing behavior, add the test, then summarize the diff.

Never paste passwords, tokens, private keys, recovery codes, or strictly confidential data into an AI tool. Internal, confidential, personal, partner, or unpublished material requires approval for the exact tool, account mode, project, and data classification. Follow the Data And AI Policy.


Productivity Tips#

  • Command Palette: ⌘/Ctrl + Shift + P — launch anything.
  • Multi-cursor editing: Alt + Click (Option + Click on macOS).
  • Integrated Terminal: ⌃/Ctrl + ` — inherits active Conda env.
  • Remote-SSH: use the canonical Euler tunnel to work on an allocated compute node. Do not open the NAS root as a source-code workspace.
  • Customize settings: File → Preferences → Settings / Keyboard Shortcuts.

Troubleshooting#

Symptom Fix
Conda env not listed Activate env once in terminal → restart VS Code or run Python: Select Interpreter (Refresh).
Wrong notebook kernel Top-right kernel picker → choose correct env.
Linting silent Check Settings → Python › Linting: Enabled & Ruff extension status.
Git commands greyed Ensure folder is a Git repo (git status works).
AI tool silent Confirm sign-in, network access, extension status, and model entitlement.
Agent makes huge edits Stop, revert the unwanted diff, and ask for a smaller patch with explicit files.

For Euler connection symptoms, use Euler troubleshooting. A first Remote-SSH connection installing VS Code Server under ~/.vscode-server is normal.

Verification#

  • Help -> About reports a VS Code version.
  • The status bar identifies the expected local or remote context.
  • python --version and python -m pip --version identify the project environment.
  • Repository lint/tests run from the integrated terminal.
  • Source Control shows only intended changes.

Common Failure And Safe Recovery#

If VS Code uses the wrong machine, interpreter, or Git repository, stop running commands. Read the status bar and terminal prompt, close the remote window if necessary, reopen the intended folder, reselect the interpreter, and verify again. Do not solve context problems by reinstalling environments globally.

Ask For Help When#

The repository requires undocumented extensions/settings, Remote-SSH works in a terminal but not VS Code, or an extension requests access beyond the project.


Verified: 2026-08-26. Review by: 2026-11-26. Owner: lab software maintainer.