{"id":1092,"date":"2026-08-21T10:58:02","date_gmt":"2026-08-21T15:58:02","guid":{"rendered":"https:\/\/sts.doit.wisc.edu\/training-materials\/?post_type=activity&#038;p=1092"},"modified":"2026-08-21T10:58:02","modified_gmt":"2026-08-21T15:58:02","slug":"vs-code","status":"publish","type":"activity","link":"https:\/\/sts.doit.wisc.edu\/training-materials\/activity\/vs-code\/","title":{"rendered":"VS Code"},"content":{"rendered":"\n<section class=\"wp-block-sts-block-sts-custom-sections\">\n<h2 class=\"wp-block-heading\">Activity 1: Navigating VS Code &amp; Using the Command Palette<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Objective:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Familiarize students with the <strong>VS Code interface<\/strong>, including the Explorer, Editor, Terminal, and <strong>Command Palette<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>1. Open VS Code and Create a New Project:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Launch <strong>VS Code<\/strong> and open a new folder (File \u2192 Open Folder).<\/li>\n\n\n\n<li>Inside the folder, create a new file named <strong>index.html<\/strong>.<\/li>\n\n\n\n<li>Add the following basic structure:<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;!DOCTYPE html&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;html lang=&#8221;en&#8221;&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;head&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&lt;meta charset=&#8221;UTF-8&#8243;&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width, initial-scale=1.0&#8243;&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;VS Code Navigation&lt;\/title&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;\/head&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;body&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&lt;h1&gt;Welcome to VS Code!&lt;\/h1&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;\/body&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;\/html&gt;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>2. Use the Command Palette (<\/strong><strong>Ctrl + Shift + P<\/strong> <strong>or<\/strong> <strong>Cmd + Shift + P<\/strong> <strong>on Mac)<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the <strong>Command Palette<\/strong> and search for:\n<ul class=\"wp-block-list\">\n<li>\u201cChange Color Theme\u201d \u2192 Try switching themes.<\/li>\n\n\n\n<li>\u201cFormat Document\u201d \u2192 Use it to auto-format the HTML file.<\/li>\n\n\n\n<li>\u201cOpen Settings (JSON)\u201d \u2192 View and edit user settings.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3. Open the Integrated Terminal (<\/strong><strong>Ctrl + ~<\/strong><strong>)<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Navigate to the project folder using cd &lt;folder-name>.<\/li>\n\n\n\n<li>Run the command code . to open the folder in VS Code.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Test the Setup:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Try using <strong>keyboard shortcuts<\/strong> (Ctrl + B to toggle Explorer, Ctrl + J to toggle Terminal).<\/li>\n\n\n\n<li>Experiment with different <strong>VS Code themes<\/strong> and <strong>icon packs<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Extension Tasks:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install an Extension<\/strong> (Prettier, Live Server, or ESLint).<\/li>\n\n\n\n<li><strong>Use Split View<\/strong> to open two files side by side.<\/li>\n<\/ul>\n<\/section>\n\n\n\n<section class=\"wp-block-sts-block-sts-custom-sections\">\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<\/section>\n\n\n\n<section class=\"wp-block-sts-block-sts-custom-sections\">\n<h2 class=\"wp-block-heading\">Activity 2: Working with Extensions &amp; Customizing VS Code<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Objective:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Learn how to <strong>install, manage, and configure extensions<\/strong> in VS Code for a more efficient workflow.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>1. Open the Extensions Marketplace (<\/strong><strong>Ctrl + Shift + X<\/strong><strong>)<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Search for and install the following <strong>extensions<\/strong>:\n<ul class=\"wp-block-list\">\n<li><strong>Prettier \u2013 Code Formatter<\/strong><\/li>\n\n\n\n<li><strong>Live Server<\/strong> (for running HTML files)<\/li>\n\n\n\n<li><strong>Bracket Pair Colorizer<\/strong> (optional for better code readability)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>2. Configure Settings for Extensions<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open <strong>Settings (<\/strong><strong>Ctrl + ,<\/strong><strong>)<\/strong> and search for <strong>Prettier<\/strong>.<\/li>\n\n\n\n<li>Enable <strong>Format on Save<\/strong> (Editor: Format On Save).<\/li>\n\n\n\n<li>Save the settings and <strong>test auto-formatting<\/strong> by writing some messy code in a new script.js file.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3. Test Live Server<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open <strong>index.html<\/strong>, then click <strong>Go Live<\/strong> in the status bar.<\/li>\n\n\n\n<li>Make a change in the file and see it auto-refresh in the browser.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Test the Setup:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check if <strong>Prettier formats the code<\/strong> automatically when saving.<\/li>\n\n\n\n<li>Open the <strong>Extensions Sidebar<\/strong> and disable\/enable an extension to observe the changes.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Extension Tasks:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install an <strong>icon theme extension<\/strong> (e.g., <strong>Material Icon Theme<\/strong>).<\/li>\n\n\n\n<li>Modify settings in <strong>settings.json<\/strong> to change default VS Code behaviors.<\/li>\n<\/ul>\n<\/section>\n\n\n\n<section class=\"wp-block-sts-block-sts-custom-sections\">\n<h2 class=\"wp-block-heading\">Activity 3: Integrated Terminal &amp; Debugging Basics<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Objective:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Learn how to use the <strong>Integrated Terminal<\/strong> and <strong>debug JavaScript<\/strong> inside VS Code.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>1. Open the Integrated Terminal (<\/strong><strong>Ctrl + ~<\/strong><strong>)<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a new JavaScript file (script.js) and add the following code:<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">function greetUser(name) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;return `Hello, ${name}!`;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">console.log(greetUser(&#8220;VS Code&#8221;));<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Run the script using Node.js:<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">node script.js<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>2. Use the Debug Console<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set a <strong>breakpoint<\/strong> by clicking next to a line number.<\/li>\n\n\n\n<li>Open the <strong>Run &amp; Debug Panel (<\/strong><strong>Ctrl + Shift + D<\/strong><strong>)<\/strong> and start debugging (F5).<\/li>\n\n\n\n<li>Step through the code and inspect variable values.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3. Modify the Debug Configuration (<\/strong><strong>launch.json<\/strong><strong>)<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Click <strong>&#8220;Create a launch.json file&#8221;<\/strong> in the Debug Panel.<\/li>\n\n\n\n<li>Select <strong>Node.js<\/strong> and modify the file to customize debugging options.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Test the Setup:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Run the script in the terminal<\/strong> and check the output.<\/li>\n\n\n\n<li><strong>Use breakpoints<\/strong> to pause execution and inspect variables.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Extension Tasks:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Debug a <strong>Python or HTML\/CSS project<\/strong>.<\/li>\n\n\n\n<li>Add <strong>console logs<\/strong> to track program flow.<\/li>\n<\/ul>\n<\/section>\n\n\n\n<section class=\"wp-block-sts-block-sts-custom-sections\">\n<h2 class=\"wp-block-heading\">Activity 4: Git and Version Control in VS Code<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Objective:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Learn how to use <strong>Git inside VS Code<\/strong> for version control.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>1. Initialize a Git Repository<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open a new VS Code project folder and run:<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">git init<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a file <strong>README.md<\/strong> and add some text.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>2. Use Source Control Panel (<\/strong><strong>Ctrl + Shift + G<\/strong><strong>)<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Stage the changes (+ button).<\/li>\n\n\n\n<li>Add a commit message and commit the changes.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3. Connect to GitHub<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the <strong>Command Palette (<\/strong><strong>Ctrl + Shift + P<\/strong><strong>)<\/strong> and search for:\n<ul class=\"wp-block-list\">\n<li>&#8220;Git: Clone&#8221; \u2192 Clone an existing repository.<\/li>\n\n\n\n<li>&#8220;Git: Push&#8221; \u2192 Push changes to GitHub.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Test the Setup:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check if <strong>commits appear in the Source Control Panel<\/strong>.<\/li>\n\n\n\n<li>Try <strong>undoing a commit<\/strong> using git reset.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Extension Tasks:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Create a new branch<\/strong> and switch to it.<\/li>\n\n\n\n<li>Use <strong>GitLens extension<\/strong> to view commit history.<\/li>\n<\/ul>\n<\/section>\n\n\n\n<section class=\"wp-block-sts-block-sts-custom-sections\">\n<h2 class=\"wp-block-heading\">Activity 5: Mini-Project \u2013 Productivity Boost with VS Code<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Objective:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Combine <strong>extensions, keyboard shortcuts, and terminal commands<\/strong> to create an efficient workflow.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>1. Set Up a New Project with a Starter Template<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">mkdir my-project &amp;&amp; cd my-project<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">touch index.html style.css script.js<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>2. Use Extensions for Efficiency<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install and enable <strong>Emmet<\/strong> for faster HTML coding.<\/li>\n\n\n\n<li>Use <strong>Multi-Cursor Editing (<\/strong><strong>Alt + Click<\/strong><strong>)<\/strong> to edit multiple lines simultaneously.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3. Automate Tasks with a Task Runner<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the <strong>Command Palette (<\/strong><strong>Ctrl + Shift + P<\/strong><strong>)<\/strong> and select <strong>&#8220;Tasks: Configure Task&#8221;<\/strong>.<\/li>\n\n\n\n<li>Choose <strong>&#8220;Create a task.json file from template&#8221;<\/strong> and set up a <strong>build task<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>4. Organize with Workspaces<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Save the current setup as a <strong>VS Code Workspace (<\/strong><strong>File \u2192 Save Workspace As\u2026<\/strong><strong>)<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Test the Setup:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Run the Task Runner<\/strong> (Ctrl + Shift + B) and check if it executes the commands.<\/li>\n\n\n\n<li><strong>Use workspace settings<\/strong> to customize VS Code for a specific project.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Extension Tasks:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set up <strong>Prettier for auto-formatting<\/strong> on save.<\/li>\n\n\n\n<li>Configure a <strong>Live Server workspace<\/strong> for frontend development.<\/li>\n<\/ul>\n<\/section>\n","protected":false},"featured_media":0,"template":"","class_list":["post-1092","activity","type-activity","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/sts.doit.wisc.edu\/training-materials\/wp-json\/wp\/v2\/activity\/1092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sts.doit.wisc.edu\/training-materials\/wp-json\/wp\/v2\/activity"}],"about":[{"href":"https:\/\/sts.doit.wisc.edu\/training-materials\/wp-json\/wp\/v2\/types\/activity"}],"wp:attachment":[{"href":"https:\/\/sts.doit.wisc.edu\/training-materials\/wp-json\/wp\/v2\/media?parent=1092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}