- Unreal Engine 4 Scripting with C++ Cookbook
- William Sherif Stephen Whittle
- 284字
- 2021-07-08 10:50:43
Formatting your code (Autocomplete settings) in Visual Studio
Code-writing formatting with Visual Studio is a pleasure. In this recipe, we'll discuss how to control the way Visual Studio lays out the text of your code.
Getting ready
Code has to be formatted correctly. You and your co-programmers will be able to better understand, grok, and keep your code bug-free if it is consistently formatted. This is why Visual Studio includes a number of auto-formatting tools inside the editor.
How to do it...
- Go to Tools | Options | Text Editor | C/C++. This dialog displays a window that allows you to toggle Automatic brace completion.
Automatic brace completion is the feature where, when you type
{
, a corresponding}
is automatically typed for you. This feature may irk you if you don't like the text editor inserting characters for you unexpectedly.You generally want Auto list members on, as that displays a nice dialog with the complete names of data members listed for you as soon as you start typing. This makes it easy to remember variable names, so you don't have to memorize them:
Tip
If you press Ctrl + Spacebar inside the code editor at any time, the auto list pops up.
- Some more autocomplete behavior options are located under Text Editor | C/C++ | Formatting:
Autoformat section: Highlight a section of text and select Edit | Advanced | Format Selection (Ctrl + K, Ctrl + F).
How it works...
The default autocomplete and autoformat behaviors may irk you. You need to converse with your team on how you want your code formatted (spaces or tab indents, size of indent, and so on), and then configure your Visual Studio settings accordingly.
- 用Python實現深度學習框架
- Learning Zurb Foundation
- ExtJS高級程序設計
- Test-Driven Machine Learning
- R數據科學實戰:工具詳解與案例分析
- Scala編程(第5版)
- Zabbix Performance Tuning
- IoT Projects with Bluetooth Low Energy
- IBM Cognos TM1 Developer's Certification guide
- Java程序設計教程
- 基于GPU加速的計算機視覺編程:使用OpenCV和CUDA實時處理復雜圖像數據
- Android 游戲開發大全(第二版)
- 深入淺出 HTTPS:從原理到實戰
- Java Web動態網站開發(第2版·微課版)
- JavaWeb從入門到精通(視頻實戰版)