Swiftorial Logo
Home
Swift Lessons
Tutorials
Learn More
Career
Resources

Sidebar and Panels in VS Code

Introduction

The Sidebar and Panels in Visual Studio Code (VS Code) are essential components that enhance the coding experience. They provide quick access to various functionalities, such as file management, source control, extensions, and more. In this tutorial, we will explore each of these features in detail.

Understanding the Sidebar

The Sidebar is located on the left side of the VS Code interface. It contains several views that can be toggled based on the developer's needs. Here are the primary views available:

  • Explorer: Displays the file system of the current workspace, allowing users to navigate, open, and organize files and folders.
  • Search: Provides a search functionality to find text across files.
  • Source Control: Integrates with version control systems like Git, allowing users to manage repositories and view changes.
  • Run and Debug: Facilitates running and debugging applications directly within the IDE.
  • Extensions: Allows users to search for and install extensions that enhance VS Code's capabilities.

To toggle the Sidebar, use the shortcut Ctrl + B (Windows/Linux) or Cmd + B (macOS).

Explorer Panel

The Explorer is the default view in the Sidebar. It displays a tree view of files and folders in the workspace. Users can open files by double-clicking them or right-clicking to access more options.

To create a new file, right-click within the Explorer area and select New File.

Each file can be opened in a new tab, and changes will be auto-saved based on your settings. The Explorer also shows version control status indicators next to files tracked by Git.

Search Panel

The Search panel allows users to find text occurrences in their project. It supports regular expressions and case-sensitive searches.

To open the Search panel, use the shortcut Ctrl + Shift + F (Windows/Linux) or Cmd + Shift + F (macOS).

Simply enter the search term in the input box, and results will populate below, showing file names and snippets of the text found.

Source Control Panel

The Source Control panel is crucial for developers using version control systems. It provides a GUI for staging changes, committing, and pushing to remote repositories.

To access the Source Control panel, click the Source Control icon in the Sidebar or use Ctrl + Shift + G (Windows/Linux) or Cmd + Shift + G (macOS).

From here, you can see unstaged and staged changes, create branches, and view commit history.

Run and Debug Panel

The Run and Debug panel helps users run their applications and debug them effectively. You can configure launch settings and view output and debug information here.

To open the Run and Debug panel, click the Run icon or use Ctrl + Shift + D (Windows/Linux) or Cmd + Shift + D (macOS).

This panel allows you to set breakpoints, inspect variables, and navigate through your code during execution.

Extensions Panel

The Extensions panel allows you to browse and manage extensions in VS Code. Extensions can add functionality, support new programming languages, or enhance existing features.

To open the Extensions panel, click on the Extensions icon or use Ctrl + Shift + X (Windows/Linux) or Cmd + Shift + X (macOS).

From this panel, you can search for extensions, install or uninstall them, and view their details and ratings.

Conclusion

The Sidebar and Panels in VS Code are powerful tools that streamline the development process. By familiarizing yourself with these components, you can improve your productivity and enhance your coding experience. Explore each panel and customize your workspace to fit your workflow.