You can collapse (fold) code fragments reducing them to a single visible line. In this way, you can hide the details that, at the moment, seem unimportant. If and when necessary, the folded code fragments can be expanded (unfolded).
Folded code fragments, normally, are shown as shaded ellipses ().
If the folded code block contains errors, JetBrains Rider highlights the folded fragment in red.
You can extend the editor area to the whole size of the IDE window by temporarily hiding all tool windows — press Ctrl+Shift+F12 or double-click the current editor tab.
Code folding means
Keynote: A Fresh Look at Visual Studio for Mac with Amanda Silver, Scott Hunter and Jon Galloway Read more Whether you’re completely new to Visual Studio for Mac, haven’t used it in a while, or use it daily and want to learn more, now’s a great time for a close look.
You can collapse and expand code fragments by using:
- Code folding toggles (, or). These toggles are shown in the editor to the left of the corresponding folding regions. If a region is unfolded, indicates the beginning of the region while is located at its end. For folded regions, the toggle is shown as.If you hold the Alt key and click, or, the region is collapsed or expanded recursively, for example along with all its subordinate regions.
- Commands of the Folding menu and associated keyboard shortcuts. The Folding menu can be accessed from the main menu (Code | Folding), or as a context menu in the editor. The shortcuts are shown right in the menu. See Commands of the Folding menu and associated shortcuts.
- Folded fragments themselves: click to expand the corresponding fragment. See also, Viewing folded code fragments.
Folding predefined and custom regions
You can fold and unfold:
- Predefined regions that correspond import declarations, method bodies, classes, documentation comments, etc. The predefined regions, roughly, correspond to the ones listed under Collapse by default on the Editor | General | Code Folding page of JetBrains Rider settings Ctrl+Alt+S. For the predefined regions, the folding toggles are available right away, without the need to perform any additional actions.
- Any selected code fragment. A custom folding region for a selection is created and removed by means of the Code | Folding | Fold Selection/ Remove Region command Ctrl+..
Code folding works for the keywords
if
/ while
/ else
/for
/ try
/ except
/finally
/ with
in case of at least two statements. Commands of the Folding menu and associated shortcuts
The Folding menu can be accessed from the main menu (Code | Folding), or as a context menu in the editor.
Command | Shortcut | Description |
---|---|---|
Expand | N/A | Expand the current collapsed fragment. |
Collapse | N/A | Collapse the current folding region. |
Expand Recursively | Ctrl+Alt+NumPad Plus | Expand the current folded fragment and all the subordinate collapsed folding regions within that fragment. |
Collapse Recursively | Ctrl+Alt+NumPad Minus | Collapse the current folding region and all the subordinate folding regions within it. |
Expand All | Ctrl+Shift+NumPad Plus | Expand all collapsed fragments within the selection, or, if nothing is selected, expand all the collapsed fragments in the current file. |
Collapse All | N/A | Collapse all folding regions within the selection, or, if nothing is selected, collapse all the folding regions in the current file. |
Expand to level | 1, 2, 3, 4 or 5 | Ctrl+NumPad *, 1 Ctrl+NumPad *, 2 Ctrl+NumPad *, 3 Ctrl+NumPad *, 4 Ctrl+NumPad *, 5 | Expand the current fragment and all the nested fragments up to the specified level. |
Expand all to level | 1, 2, 3, 4 or 5 | Ctrl+Shift+NumPad *, 1 Ctrl+Shift+NumPad *, 2 Ctrl+Shift+NumPad *, 3 Ctrl+Shift+NumPad *, 4 Ctrl+Shift+NumPad *, 5 | Expand all the collapsed fragments in the file up to the specified nesting level. |
Expand doc comments | Expand all documentation comments in the current file. | |
Collapse doc comments | Collapse all documentation comments in the current file. | |
Fold Selection / Remove region | Ctrl+. | Collapse the selected fragment and create a custom folding region for it to make it 'foldable' / Expand the current fragment and remove the corresponding custom folding region to make the fragment 'unfoldable'. |
Specifying code folding preferences
You can specify:
- Whether the code folding toggles should be shown.
- Which folding regions should be collapsed by default.
The corresponding settings are on the Editor | General | Code Folding page of JetBrains Rider settings Ctrl+Alt+S.
Viewing folded code fragments
To see the contents of a folded fragment, point to the ellipsis that indicates that fragment.
- Latest Version:Visual Studio Code 1.42.1 LATEST
- Requirements:Mac OS X 10.11 or later
- Author / Product:Microsoft Corporation / Visual Studio Code for Mac
- Old Versions:
- Filename:VSCode-darwin-stable.zip
- Details:Visual Studio Code for Mac 2020 full offline installer setup for Mac
Visual Studio Code for Mac is a powerful code editor redefined and optimized for building and debugging modern web and cloud applications. The app provides developers with a new choice of developer tool that combines the simplicity and streamlined experience of a code editor with the best of what developers need for their core code-edit-debug cycle. Visual Studio Code is the first code editor, and first cross-platform development tool - supporting OSX, Linux, and Windows - in the Visual Studio family.
At its heart, Visual Studio Code for macOS features a powerful, fast code editor great for day-to-day use. The Preview release of Code already has many of the features developers need in a code and text editor, including navigation, keyboard support with customizable bindings, syntax highlighting, bracket matching, auto indentation, and snippets, with support for dozens of languages.
Meet IntelliSense
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in
Working with Git has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted Git service.
Extensible and customizable
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won't slow down your editor.
Note: Requires 64-bit processor.
Also Available: Download Visual Studio Code for Windows
At its heart, Visual Studio Code for macOS features a powerful, fast code editor great for day-to-day use. The Preview release of Code already has many of the features developers need in a code and text editor, including navigation, keyboard support with customizable bindings, syntax highlighting, bracket matching, auto indentation, and snippets, with support for dozens of languages.
Meet IntelliSense
Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
Print statement debugging is a thing of the past
Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
Git commands built-in
Working with Git has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted Git service.
Extensible and customizable
Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won't slow down your editor.
Note: Requires 64-bit processor.
Also Available: Download Visual Studio Code for Windows