Set up VS Code Installation and initial setup
Prepare Visual Studio Code (VS Code) to edit HTML and jsPsych files. Follow these steps to install it, open the course materials, and configure useful extensions.
Understand the course folder structure
After extracting the course ZIP, keep the jspsych folder and its contents together. In VS Code, open the whole jspsych folder—not an individual HTML file or the parent website folder.
jspsych/
├── index.html
├── vscode.html
├── hello-world.html
├── fixation.html
├── image.html
├── audio.html
├── video.html
├── gonogo.html
├── sample-hello-world.html
├── sample-fixation.html
├── sample-image.html
├── sample-audio.html
├── sample-video.html
├── sample-gonogo.html
├── dist/
│ └── jsPsych and plugin files
├── media/
│ └── image, audio, and video files
└── en/
└── English lesson pages
To open the course in VS Code, choose File → Open Folder (on macOS, File → Open… may be shown), select the extracted jspsych folder, and choose Select Folder or Open. The Explorer on the left should show the lesson HTML files, dist, and media together.
If VS Code asks whether you trust the authors of the files, make sure you are opening the course materials you received, then select Trust. You can open index.html in a browser to read the lessons; internet access is only needed for external links and downloads.
Download and install VS Code
Open the official VS Code download page ↗
macOS
- Download the macOS version from the official page.
- Open the downloaded
.dmgfile. - Drag Visual Studio Code.app into the Applications folder.
- Launch VS Code from Applications. Choose Apple silicon for Macs with an Apple M-series chip, Intel for older Intel-based Macs, or Universal if you are unsure.
macOS Catalina 10.15: The current VS Code release does not support Catalina; VS Code 1.97 was the last supported release. If possible, update macOS before installing the latest VS Code. See the official release notes ↗.
Windows
- Download the User Installer for Windows from the official page.
- Run the downloaded
.exefile. - Follow the installer instructions, then launch VS Code.
Open the course folder
- Extract the course ZIP. Do not edit files while they are still inside the ZIP archive.
- In VS Code, choose File → Open Folder.
- Select the extracted
jspsychfolder itself. - Confirm that the Explorer shows
dist,media, the lesson pages, and thesample-*.htmlfiles together.
If VS Code asks whether you trust the folder, verify that it is the course material and then choose Trust.
Change the VS Code display language
You can use the VS Code menus in Japanese or another language you prefer. A display-language pack changes the VS Code interface; it does not change the language of your code or this course.
- Select the square-shaped Extensions icon in the Activity Bar on the left, or open the Extensions view with Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (macOS).
- Search for
Japanese Language Packand select Japanese Language Pack for Visual Studio Code. Check that the publisher is Microsoft and the extension ID isMS-CEINTL.vscode-language-pack-ja, then select Install. - To use a different language, search the Marketplace for that language's official VS Code Language Pack. Check the publisher and extension details before installing it.
- Open the Command Palette with Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS). Run Configure Display Language, choose the language you want, and restart VS Code when prompted.
- To return to English, run Configure Display Language again and select
en.
Recommended extensions
Extensions add features to VS Code. They are optional, but the following tools can make it easier to preview pages, understand code structure, and work with more than one project. Open the Extensions view, search by the exact name or ID below, and check the publisher before installing. The extension links open the Marketplace in a new tab.
- Live Server
ritwickdey.LiveServer· Publisher: Ritwick DeyStarts a small local web server for the selected HTML page and refreshes the browser when you save changes. In the Explorer, right-click an HTML file and select Open with Live Server. This is especially useful for jsPsych examples with audio, video, or preloaded files, which may not work correctly when opened directly with
file://. - indent-rainbow
oderwat.indent-rainbow· Publisher: oderwatShows different background colors for each indentation level. This makes nested HTML elements and JavaScript blocks easier to follow, and can help you spot a line that is indented inconsistently. After installation, the colors appear in the editor automatically.
- Project Manager
alefragnani.project-manager· Publisher: Alessandro FragnaniSaves folders as named projects and makes it easier to switch between them. It is not necessary for this course, which uses one course folder, but can be useful later when you work with several experiment or research folders.
- Print
pdconsec.vscode-print· Publisher: PD ConsultingAdds a way to print source code. It can be useful when you want a paper copy of an HTML or JavaScript file for review or class discussion. Check the print preview before printing to make sure long lines and page breaks are readable.
Install only the extensions you need. The course examples do not require Project Manager or Print, and HTML files can be viewed without Live Server; Live Server is recommended for running the jsPsych examples.
Open the Hello World example
- In the Explorer on the left, select
sample-hello-world.htmldirectly under thejspsychfolder. Do not select a sample file from insideen; the shared sample files are kept besidedistandmedia. - Right-click the file and choose Open with Live Server. If you did not install Live Server, open the HTML file in a browser instead.
- The browser should show “はじめてのHTML / My first HTML page” and “Hello World!”.
- Change a line of text in VS Code, save the file, and confirm that the browser preview updates.
