Visual Studio Code Comment Out Block Mac



Installation

  1. Download Visual Studio Code for macOS.
  2. Open the browser's download list and locate the downloaded archive.
  3. Select the 'magnifying glass' icon to open the archive in Finder.
  4. Drag Visual Studio Code.app to the Applications folder, making it available in the macOS Launchpad.
  5. Add VS Code to your Dock by right-clicking on the icon to bring up the context menu and choosing Options, Keep in Dock.

Launching from the command line

You can also run VS Code from the terminal by typing 'code' after adding it to the path:

  • Launch VS Code.
  • Open the Command Palette (Cmd+Shift+P) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.

In this video, Bob explains why you would add code comments - essentially lines of code that are ignored by the compiler when an assembly is built - and de. The caret is moved to the end of the block comment. An alternative way to comment any block of code is to select it, press Alt+Enter and choose Comment selection. The same way works for uncommenting code inside a block comment - set the caret anywhere in the block comment, press Alt+Enter and choose Uncomment. Visual Studio Code is a streamlined code editor with support for development operations like debugging, task running, and version control. It aims to provide just the tools a developer needs for a quick code-build-debug cycle and leaves more complex workflows to fuller featured IDEs, such as Visual Studio IDE. Visual Studio for Mac makes it straightforward to select, cut, copy, and paste sections of your code. Rectangular blocks of code can be highlighted and selected by using the Option + Drag command on the code block. The formatting within this block selection is retained when pasting the block. F11/ ⇧ Step into/ out F10 Step over F5 Stop ⌘K I Show hover Integrated terminal ⌃` Show integrated terminal ⌃⇧` Create new terminal ⌘C Copy selection ⌘↑ / ↓ Scroll up/down / PgDn Scroll page up/down Home / End Scroll to top/bottom Other operating systems’ keyboard shortcuts and additional.

  • Restart the terminal for the new $PATH value to take effect. You'll be able to type 'code .' in any folder to start editing files in that folder.

Note: If you still have the old code alias in your .bash_profile (or equivalent) from an early VS Code version, remove it and replace it by executing the Shell Command: Install 'code' command in PATH command.

Alternative manual instructions

Instead of running the command above, you can manually add VS Code to your path, to do so run the following commands:

Start a new terminal to pick up your .bash_profile changes.

Note: The leading slash is required to prevent $PATH from expanding during the concatenation. Remove the leading slash if you want to run the export command directly in a terminal.

Note: Since zsh became the default shell in macOS Catalina, run the following commands to add VS Code to your path:

Visual Studio Code Comment Out Block Mac

Touch Bar support

Out of the box VS Code adds actions to navigate in editor history as well as the full Debug tool bar to control the debugger on your Touch Bar:

Mojave privacy protections

After upgrading to macOS Mojave version, you may see dialogs saying 'Visual Studio Code would like to access your {calendar/contacts/photos}.' This is due to the new privacy protections in Mojave and is not specific to VS Code. The same dialogs may be displayed when running other applications as well. The dialog is shown once for each type of personal data and it is fine to choose Don't Allow since VS Code does not need access to those folders. You can read a more detailed explanation in this blog post.

Updates

VS Code ships monthly releases and supports auto-update when a new release is available. If you're prompted by VS Code, accept the newest update and it will get installed (you won't need to do anything else to get the latest bits).

Note: You can disable auto-update if you prefer to update VS Code on your own schedule.

Preferences menu

You can configure VS Code through settings, color themes, and custom keybindings available through the Code > Preferences menu group.

You may see mention of File > Preferences in documentation, which is the Preferences menu group location on Windows and Linux. On a macOS, the Preferences menu group is under Code, not File.

Next steps

Studio

Once you have installed VS Code, these topics will help you learn more about VS Code:

  • Additional Components - Learn how to install Git, Node.js, TypeScript, and tools like Yeoman.
  • User Interface - A quick orientation around VS Code.
  • User/Workspace Settings - Learn how to configure VS Code to your preferences settings.

Common questions

Why do I see 'Visual Studio Code would like access to your calendar.'

If you are running macOS Mojave version, you may see dialogs saying 'Visual Studio Code would like to access your {calendar/contacts/photos}.' This is due to the new privacy protections in Mojave discussed above. It is fine to choose Don't Allow since VS Code does not need access to those folders.

VS Code fails to update

If VS Code doesn't update once it restarts, it might be set under quarantine by macOS. Follow the steps in this issue for resolution.

Does VS Code run on Mac M1 machines?

Yes, VS Code supports macOS ARM64 builds that can run on Macs with the Apple M1 chip. You can install the Universal build, which includes both Intel and Apple Silicon builds, or one of the platform specific builds.

Provides block comment completion for Javadoc-style multi-line comments and single-line comment blocks for most officially supported languages.

MAJOR CHANGES IN 1.0 UPDATE (Please Read)

A lot has changed in this update. Please open issues for any bugs you encounter.

Single-line Comment Blocks

You can now use single line comment blocks for languages with //, #, or ; style single line comments. Press Shift+Enter while on a commented line to insert a new commented line with the same level of indentation. See the Settings section for how to change the behavior so that Enter inserts a commented line while Shift+Enter breaks out of the comment block (this only works correctly for a subset of languages right now).

The Language Support section shows which languages are supported. See the Settings section for how to add single line comment support to languages that are not officially supported.

Visual Studio Code Comment Out Block Mac

Multi-line Comment Blocks

Visual Studio Code Comment Out Block Mac Version

This feature has not changed, but support has now been added for Less, Objective-C/C++, and Swift.

Usage

Javadoc-style comment blocks

Type /** to start a block comment, then hit the Enter key, and the extension will close the block. While inside the comment block, the extension will insert an asterisk at the start of every new line, and align the comment, respecting indentation.

QDoc-style (Qt) comment blocks

Use /*! in C/C++ files to start a QDoc comment block.

New: 'single-line' block comments

You can insert single line comment blocks for languages with //, #, or ; style single line comments. Press Shift+Enter while on a commented line to insert a new commented line with the same level of indentation. See the Settings section for issues and more options.

Language Support

Comment StyleLanguage Support
/** */C, C++, C#, CSS, Go, Groovy, Java, Less, Objective C/C++, PHP, Sass, Rust, Swift
/*! */C, C++
//, ///C, C++, C#, F#, Go, Groovy, Java, JavaScript, Less, Objective C/C++, PHP, Rust, Sass, Swift, TypeScript
#CoffeeScript, Dockerfile, Makefile, Perl, PowerShell, Python, R, Ruby, YAML
;Clojure

Settings

Reload the extension after changing any settings.

  • auto-comment-blocks.singleLineBlockOnEnter: If enabled, pressing Enter inserts a new commented line at the same indentation, and pressing Shift+Enter breaks the comment block.
    • Caution: This feature is buggy in many languages (see Issues section), but it seems to work fine for C, C++, Go, Less, PHP, Ruby, and Sass.
  • auto-comment-blocks.disabledLanguages: Add languageIds here to disable any comment completion for that language.
  • auto-comment-blocks.slashStyleBlocks: Add languageIds here to enable '//' and '///'-style single line comment blocks for that language.
  • auto-comment-blocks.hashStyleBlocks: Add languageIds here to enable '#'-style single line comment blocks for that language.
  • auto-comment-blocks.semicolonStyleBlocks: Add languageIds here to enable ';'-style single line comment blocks for that language.

Issues

  • Single-line blocks using Enter: if you enable the singleLineBlockOnEnter setting, there are a few things to keep in mind:
    • It seems to work find for C, C++, Go, Less, PHP, Ruby, and Sass.
    • It doesn't work at all for Python, JavaScript, and TypeScript.
    • For every other language, if you press Tab immediately after breaking out of a comment block, it will insert a commented line, for some unknown reason.
  • Sometimes multi-line completion/aseterisk insertion doesn't work. The reason is still unknown. It may go away if you reload your workspace.
  • Currently, VS Code only allows extensions to overwrite, instead of modify, existing language configurations. This means that this extension may clash with another extension that overwrites the same language configurations, causing one or both not to work. In that case, uninstalling this extension is the only option for now.

Please create an issue in the repository if you find any bugs, or have questions or feature requests.

Release Notes

Visual Studio Code Comment Line Mac

1.0.0

Visual Studio Code Comment Out Block Mac Os

Block

Visual Studio Code For Mac

  • Add multi-line comment support for Less, Objective-C/C++, and Swift.
  • Add single-line comment blocks for most officially supported languages. See README for more information.