Skip to content

Commit 2115ff0

Browse files
author
mikeblome
committed
new file for launch (again)
1 parent c9a2a13 commit 2115ff0

5 files changed

Lines changed: 22 additions & 14 deletions

docs/build/cppproperties-schema-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ When the Linux workload is installed, the following environments are available f
7777
|linux_x64|Target x64 Linux remotely|
7878
|linux_arm|Target ARM Linux remotely|
7979

80-
## <a name="user_defined_enviroments"></a> User-defined environments
80+
## <a name="user_defined_environments"></a> User-defined environments
8181

8282
You can optionally use the `environments` property to define sets of variables in *CppProperties.json* either globally or per-configuration. These variables behave like environment variables in the context of an Open Folder project and can be accessed with the ${env.\<VARIABLE>} syntax from *tasks.vs.json* and *launch.vs.json* after they are defined here. However, they are not necessarily set as actual environment variables in any command prompt that Visual Studio uses internally.
8383

@@ -156,6 +156,6 @@ If you are not seeing the IntelliSense that you expect, you can troubleshoot by
156156

157157
![Diagnostic logging](media/diagnostic-logging.png)
158158

159-
Output is piped to the **Output Window** and is visible when you choose **Show Output From: Visual C++ Log*. The output contains, among other things, the list of actual include paths that IntelliSense is trying to use. If the paths do not match the ones in *CppProperties.json*, try closing the folder and deleting the *.vs* sub-folder which contains cached browsing data.
159+
Output is piped to the **Output Window** and is visible when you choose **Show Output From: Visual C++ Log**. The output contains, among other things, the list of actual include paths that IntelliSense is trying to use. If the paths do not match the ones in *CppProperties.json*, try closing the folder and deleting the *.vs* sub-folder which contains cached browsing data.
160160

161161
To troubleshoot IntelliSense errors caused by missing include paths, open the **Error List** and filter its output to "IntelliSense only" and error code E1696 "cannot open source file ...".

docs/build/launch-vs-schema-reference-cpp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ externalConsole|boolean|If true, a console is launched for the debuggee. If fals
5858
|pipeTransport|string|When present, this tells the debugger to connect to a remote computer using another executable as a pipe that will relay standard input/output between Visual Studio and the MI-enabled debugger (such as gdb). Allowed values: one or more [Pipe Transport Options](#pipe_transport_options).|
5959

6060

61-
## <a name="launch_setup_options"></a> Launch setup commands
61+
## <a name="launch_setup_commands"></a> Launch setup commands
6262

6363
Used with the setupCommands property:
6464

@@ -81,7 +81,7 @@ Used with the pipeTransport property:
8181
|pipeEnv|object|Environment variables passed to the pipe program.|
8282
|quoteArgs|boolean|If individual arguments contain characters (such as spaces or tabs), should it be quoted? If 'false', the debugger command will no longer be automatically quoted. Default is 'true'.|
8383

84-
## <a name="source_file_map_otpions"></a> Source file map options
84+
## <a name="source_file_map_options"></a> Source file map options
8585

8686
Use with the sourceFIleMap property:
8787

docs/build/open-folder-projects-cpp.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ CMake is integrated in the Visual Studio IDE as a component of the C++ desktop w
2222

2323
## Other build systems
2424

25-
To use the Visual Studio IDE with a build system or compiler toolset that is not directly supported from the main menu select **File | Open | Folder** or press **Ctrl + Shift + Alt + O**. Navigate to the folder that contains your source code files. To build the project, define custom tasks, or configure IntelliSense for system headers, you add three JSON files:
25+
To use the Visual Studio IDE with a build system or compiler toolset that is not directly supported from the main menu select **File | Open | Folder** or press **Ctrl + Shift + Alt + O**. Navigate to the folder that contains your source code files. To build the project, configure IntelliSense and set debugging parameters, you add three JSON files:
2626

2727
| | |
2828
|-|-|
2929
|CppProperties.json|Specify custom configuration information for browsing. Create this file, if needed, in your root project folder. (Not used in CMake projects.)|
3030
|tasks.vs.json|Specify custom build commands. Accessed via the **Solution Explorer** context menu item **Configure Tasks**.|
3131
|launch.vs.json|Specify command line arguments for the debugger. Accessed via the **Solution Explorer** context menu item **Debug and Launch Settings**.|
3232

33-
### Configure IntelliSense and browsing hints with CppProperties.json
33+
## Configure IntelliSense and browsing hints with CppProperties.json
3434

3535
For IntelliSense and browsing behavior such as **Go to Definition** to work correctly, Visual Studio needs to know which compiler you are using, where the system headers are, and where any additional include files are located if they are not directly in the folder you have opened (the workspace folder). To specify a configuration, you can choose **Manage Configurations** from the dropdown in the main toolbar:
3636

@@ -68,6 +68,8 @@ If, for example, you choose **x64-Debug**, Visual Studio creates a file called *
6868

6969
This configuration "inherits" the environment variables of the Visual Studio [x64 Developer Command Prompt](building-on-the-command-line.md). One of those variables is `INCLUDE` and you can refer to it here by using the `${env.INCLUDE}` macro. The `includePath` property tells Visual Studio where to look for all the sources that it needs for IntelliSense. In this case, it says "look in the all the directories specified by the INCLUDE environment variable, and also all the directories in the current working folder tree." The `name` property is the name that will appear in the dropdown, and can be anything you like. The `defines` property provides hints to IntelliSense when it encounters conditional compilation blocks. The `intelliSenseMode` property provides some additional hints based on the compiler type. Several options are available for MSVC, GCC, and Clang.
7070

71+
## Example configuration for GCC
72+
7173
If you are using a compiler other than Microsoft C++, you have to create a custom configuration and environment in *CppProperties.json*. The following example shows a complete *CppProperties.json* file with a single custom configuration for using GCC in an MSYS2 installation:
7274

7375
```json
@@ -109,6 +111,8 @@ When everything is working correctly, you will see IntelliSense from the GCC hea
109111

110112
![GCC IntelliSense](media/gcc-intellisense.png)
111113

114+
## Enable IntelliSense diagnostics
115+
112116
If you are not seeing the IntelliSense that you expect, you can troubleshoot by going to **Tools** > **Options** > **Text Editor** > **C/C++** > **Advanced** and setting **Enable Logging** to **true**. To start with, try setting **Logging Level** to 5, and **Logging Filters** to 8.
113117

114118
![Diagnostic logging](media/diagnostic-logging.png)
@@ -121,7 +125,7 @@ You can automate build scripts or any other external operations on the files you
121125

122126
![Open Folder Configure Tasks](media/configure-tasks.png)
123127

124-
This creates (or opens) the *tasks.vs.json* file in the .vs folder which Visual Studio creates in your root project folder. You can define any arbitrary task in this file and then invoke it from the **Solution Explorer** context menu. To continue with the GCC example, the following example shows a complete *tasks.vs.json* file with as single task that invokes *g++.exe* to build a project. Assume the project contains a single file called *hello.cpp*.
128+
This creates (or opens) the *tasks.vs.json* file in the .vs folder which Visual Studio creates in your root project folder. You can define any arbitrary task in this file and then invoke it from the **Solution Explorer** context menu. To continue the GCC example, the following snippet shows a complete *tasks.vs.json* file with as single task that invokes *g++.exe* to build a project. Assume the project contains a single file called *hello.cpp*.
125129

126130
```json
127131
{
@@ -144,9 +148,9 @@ This creates (or opens) the *tasks.vs.json* file in the .vs folder which Visual
144148

145149
```
146150

147-
The file is placed in the *.vs* subfolder which you can see if you click on **Show All Files** at the top of **Solution Explorer**. You can run this task by right-clicking on the project node in **Solution Explorer** and choosing **build hello**. When the task completes you should see a new file, *hello.exe* in **Solution Explorer**.
151+
The JSON file is placed in the *.vs* subfolder which you can see if you click on the **Show All Files** button at the top of **Solution Explorer**. You can run this task by right-clicking on the project node in **Solution Explorer** and choosing **build hello**. When the task completes you should see a new file, *hello.exe* in **Solution Explorer**.
148152

149-
You can define many kinds of tasks. The following example shows a tasks.vs.json file that defines a single task. `taskName` defines the name that appears in the context menu. `appliesTo` defines which files the command can be performed on. The `command` property refers to the COMSPEC environment variable, which identifies the path for the console (*cmd.exe* on Windows). You can also reference environment variables that are declared in CppProperties.json or CMakeSettings.json. The `args` property specifies the command line to be invoked. The `${file}` macro retrieves the selected file in **Solution Explorer**. The following example will display the filename of the currently selected .cpp file.
153+
You can define many kinds of tasks. The following example shows a *tasks.vs.json file* that defines a single task. `taskName` defines the name that appears in the context menu. `appliesTo` defines which files the command can be performed on. The `command` property refers to the COMSPEC environment variable, which identifies the path for the console (*cmd.exe* on Windows). You can also reference environment variables that are declared in CppProperties.json or CMakeSettings.json. The `args` property specifies the command line to be invoked. The `${file}` macro retrieves the selected file in **Solution Explorer**. The following example will display the filename of the currently selected .cpp file.
150154

151155
```json
152156
{
@@ -163,13 +167,13 @@ You can define many kinds of tasks. The following example shows a tasks.vs.json
163167
}
164168
```
165169

166-
After saving tasks.vs.json, you can right-click any .cpp file in the folder, choose **Echo filename** from the context menu, and see the file name displayed in the Output window.
170+
After saving *tasks.vs.json*, you can right-click any *.cpp* file in the folder, choose **Echo filename** from the context menu, and see the file name displayed in the Output window.
167171

168172
For more information, see [Tasks.vs.json schema reference](tasks-vs-json-schema-reference-cpp.md).
169173

170174
### Configure debugging parameters with launch.vs.json
171175

172-
To customize your program’s command line arguments, right-click on the executable in **Solution Explorer** and select **Debug and Launch Settings**. This will open an existing **launch.vs.json** file, or if none exists, it will create a new file with a minimal task defined. First you are given a choice of what kind of debug session you want to configure. For debugging a MinGw-w64 project, we choose **C/C++ Launch for MinGGW/Cygwin (gdb)**. This creates a launch configuration for using *gdb.exe* with some educated guesses about default values. One of those default values is `MINGW_PREFIX`. You can substitute the literal path (as shown below) or you can define a `MINGW_PREFIX` property in *CppProperties.json*:
176+
To customize your program’s command line arguments and debugging instructions, right-click on the executable in **Solution Explorer** and select **Debug and Launch Settings**. This will open an existing *launch.vs.json* file, or if none exists, it will create a new file with a minimal task defined. First you are given a choice of what kind of debug session you want to configure. For debugging a MinGw-w64 project, we choose **C/C++ Launch for MinGGW/Cygwin (gdb)**. This creates a launch configuration for using *gdb.exe* with some educated guesses about default values. One of those default values is `MINGW_PREFIX`. You can substitute the literal path (as shown below) or you can define a `MINGW_PREFIX` property in *CppProperties.json*:
173177

174178
```json
175179
{
@@ -195,7 +199,9 @@ To start debugging, choose the executable in the debug dropdown, then click the
195199

196200
![Launch debugger](media/launch-debugger-gdb.png)
197201

198-
You should see the **Initializing Debugger** dialog and then an external console window that is running your program.
202+
You should see the **Initializing Debugger** dialog and then an external console window that is running your program.
203+
204+
For more information, see [launch.vs.json schema reference](launch-vs-schema-reference.md).
199205

200206
## Launching other executables
201207

docs/build/tasks-vs-json-schema-reference-cpp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.assetid: abd1985e-3717-4338-9e80-869db5435175
66
---
77
# Tasks.vs.json (C++)
88

9-
A *tasks.vs.json* file can be added to an Open Folder project to define any arbitrary task and then invoke it from the **Solution Explorer** context menu. CMake projects do not use this file because all the build commands are specified in *CMakeLists.txt*. For build systems other than CMake, *tasks.vs.json* is where you can specify build commands and invoke build scripts. For general information about using *tasks.vs.json*, see [Customize build and debug tasks for "Open Folder" development](/visualstudio/ide/customize-build-and-debug-tasks-in-visual-studio).
9+
To tell Visual Studio how to build your source code in an an Open Folder project, add a *tasks.vs.json* file. You can define any arbitrary task here and then invoke it from the **Solution Explorer** context menu. CMake projects do not use this file because all the build commands are specified in *CMakeLists.txt*. For build systems other than CMake, *tasks.vs.json* is where you can specify build commands and invoke build scripts. For general information about using *tasks.vs.json*, see [Customize build and debug tasks for "Open Folder" development](/visualstudio/ide/customize-build-and-debug-tasks-in-visual-studio).
1010

1111
A task has a `type` property which may have one of four values: `default`, `launch`, `remote`, or `msbuild`. Most tasks should use `launch` unless a remote connection is required.
1212

@@ -90,7 +90,7 @@ When the task type is `remote`, these properties are available:
9090
|`remoteWorkingDirectory`|string|The current working directory on the remote machine.|
9191
|`localCopyDirectory`|string|The local directory to copy to the remote machine. Defaults to the current working directory.|
9292
|`remoteCopyDirectory`|string|The directory on the remote machine into which `localCopyDirectory` is copied.|
93-
|`remoteCopyMethod`|string| Allowed values: "none", "sftp", "rsync"|The method to use for copying. rsync is recommended for large projects.|
93+
|`remoteCopyMethod`|string| The method to use for copying. Allowed values: "none", "sftp", "rsync". rsync is recommended for large projects.|
9494
|`remoteCopySourcesOutputVerbosity`|string| Allowed values: "Normal","Verbose","Diagnostic".|
9595
|`rsyncCommandArgs`|string|Defaults to "-t --delete".|
9696
|`remoteCopyExclusionList`|array|Comma-separated list of files in `localCopyDirectory` to exclude from copy operations.|

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@
8686
href: build/cppproperties-schema-reference.md
8787
- name: Tasks.vs.json schema reference (C++)
8888
href: build/tasks-vs-json-schema-reference-cpp.md
89+
- name: Launch.vs.json schema reference (C++)
90+
href: build/launch-vs-schema-reference-cpp.md
8991
- name: CMake projects
9092
expanded: false
9193
items:

0 commit comments

Comments
 (0)