zoukankan      html  css  js  c++  java
  • vscode tasks.json以及launch.json配置详解(待整理)

    tasks.json

      taks.json文件一般用来设定build环境,通过Terminal > Configure Default Build Task呼出task.json文件,官网给出的例子如下:

      

    {
      "version": "2.0.0",
      "tasks": [
        {
          "type": "shell",
          "label": "cl.exe build active file",
          "command": "cl.exe",
          "args": [
            "/Zi",
            "/EHsc",
            "/Fe:",
            "${fileDirname}\${fileBasenameNoExtension}.exe",
            "${file}"
          ],
          "problemMatcher": ["$msCompile"],
          "group": {
            "kind": "build",
            "isDefault": true
          }
        }
      ]
    }

      这里command用来指定要执行的程序,args字段用于记录执行command需要涉及到的参数。isDefault = true指定该tasks.json是(command + shift + b)快捷键执行的默认task。这里有更多详细的task.json的参数介绍。

    lauch.json

      用来debug程序,快捷键为f5,通过Run > Add Configuration呼出lauch.json。官方给出的案例如下:

    {
      "version": "0.2.0",
      "configurations": [
        {
          "name": "cl.exe build and debug active file",
          "type": "cppvsdbg",
          "request": "launch",
          "program": "${fileDirname}\${fileBasenameNoExtension}.exe",
          "args": [],
          "stopAtEntry": false,
          "cwd": "${workspaceFolder}",
          "environment": [],
          "externalConsole": false,
          "preLaunchTask": "cl.exe build active file"
        }
      ]
    }

      program字段用来制定需要执行的程序。其余字段详见这里

      debug的例子还是看官方文档比较好,https://code.visualstudio.com/docs/cpp/config-msvc#_step-through-the-code

  • 相关阅读:
    TeamViewer的替代品:realVNC
    Introduction of Generator in Python
    Excel: assign label to scatter chart using specific cell values
    reverse/inverse a mapping but with multiple values for each key
    虚拟化与云计算
    现代计算机简介
    CentOS 7 安装中网络设置111
    机械硬盘原理
    文件系统
    最重要的块设备——硬盘
  • 原文地址:https://www.cnblogs.com/z1141000271/p/14963333.html
Copyright © 2011-2022 走看看